org.eclipse.xtend.shared.ui.core
Class AbstractResource

java.lang.Object
  extended by org.eclipse.xtend.shared.ui.core.AbstractResource
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, Resource, IXtendXpandResource
Direct Known Subclasses:
CheckResourceImpl, XpandResourceImpl, XtendResourceImpl

public abstract class AbstractResource
extends java.lang.Object
implements IXtendXpandResource


Constructor Summary
protected AbstractResource(org.eclipse.core.resources.IStorage res)
           
 
Method Summary
 void analyze(ExecutionContext ctx)
          analyzes the underlying AST and adds respective markers to the underlying IFile (getCorrspondingFile())
protected abstract  void analyze(ExecutionContext ctx, java.util.Set<AnalysationIssue> issues)
           
 java.lang.Object getAdapter(java.lang.Class adapter)
          Returns an object which is an instance of the given class associated with this object.
 Resource getExtXptResource()
          returns the root element of the AST
 java.lang.String getFullyQualifiedName()
           
 java.lang.String[] getImportedExtensions()
           
 java.lang.String[] getImportedNamespaces()
           
 org.eclipse.core.resources.IStorage getUnderlyingStorage()
           
protected abstract  boolean internalRefresh()
           
 boolean refresh()
          updates the underlying AST
 void setExtXptResource(Resource res)
           
 void setFullyQualifiedName(java.lang.String fqn)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.xtend.shared.ui.core.IXtendXpandResource
getFileExtension
 

Constructor Detail

AbstractResource

protected AbstractResource(org.eclipse.core.resources.IStorage res)
Method Detail

setExtXptResource

public void setExtXptResource(Resource res)

getExtXptResource

public Resource getExtXptResource()
Description copied from interface: IXtendXpandResource
returns the root element of the AST

Specified by:
getExtXptResource in interface IXtendXpandResource
Returns:

getUnderlyingStorage

public org.eclipse.core.resources.IStorage getUnderlyingStorage()
Specified by:
getUnderlyingStorage in interface IXtendXpandResource

getFullyQualifiedName

public java.lang.String getFullyQualifiedName()
Specified by:
getFullyQualifiedName in interface Resource

getImportedNamespaces

public java.lang.String[] getImportedNamespaces()
Specified by:
getImportedNamespaces in interface Resource

setFullyQualifiedName

public void setFullyQualifiedName(java.lang.String fqn)
Specified by:
setFullyQualifiedName in interface Resource

getImportedExtensions

public java.lang.String[] getImportedExtensions()
Specified by:
getImportedExtensions in interface Resource

analyze

public final void analyze(ExecutionContext ctx)
Description copied from interface: IXtendXpandResource
analyzes the underlying AST and adds respective markers to the underlying IFile (getCorrspondingFile())

Specified by:
analyze in interface IXtendXpandResource

analyze

protected abstract void analyze(ExecutionContext ctx,
                                java.util.Set<AnalysationIssue> issues)

refresh

public final boolean refresh()
Description copied from interface: IXtendXpandResource
updates the underlying AST

Specified by:
refresh in interface IXtendXpandResource
Returns:
true if the source could be parsed and an AST is available

internalRefresh

protected abstract boolean internalRefresh()

getAdapter

public final java.lang.Object getAdapter(java.lang.Class adapter)
Returns an object which is an instance of the given class associated with this object. Returns null if no such object can be found.

This implementation of the method declared by IAdaptable passes the request along to the platform's adapter manager; roughly Platform.getAdapterManager().getAdapter(this, adapter).

Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable
Parameters:
adapter - the class to adapt to
Returns:
the adapted object or null
See Also:
IAdaptable#getAdapter(Class)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object