|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectPlatformObject
org.aspectj.org.eclipse.jdt.internal.core.JavaElement
org.aspectj.org.eclipse.jdt.internal.core.SourceRefElement
public abstract class SourceRefElement
Abstract class for Java elements which implement ISourceReference.
| Field Summary | |
|---|---|
int |
occurrenceCount
|
| Fields inherited from class org.aspectj.org.eclipse.jdt.internal.core.JavaElement |
|---|
JEM_ANNOTATION, JEM_CLASSFILE, JEM_COMPILATIONUNIT, JEM_COUNT, JEM_ESCAPE, JEM_FIELD, JEM_IMPORTDECLARATION, JEM_INITIALIZER, JEM_JAVAPROJECT, JEM_LOCALVARIABLE, JEM_METHOD, JEM_PACKAGEDECLARATION, JEM_PACKAGEFRAGMENT, JEM_PACKAGEFRAGMENTROOT, JEM_TYPE, JEM_TYPE_PARAMETER, NO_ELEMENTS, NO_INFO, parent |
| Fields inherited from interface org.aspectj.org.eclipse.jdt.core.IJavaElement |
|---|
ANNOTATION, CLASS_FILE, COMPILATION_UNIT, FIELD, IMPORT_CONTAINER, IMPORT_DECLARATION, INITIALIZER, JAVA_MODEL, JAVA_PROJECT, LOCAL_VARIABLE, METHOD, PACKAGE_DECLARATION, PACKAGE_FRAGMENT, PACKAGE_FRAGMENT_ROOT, TYPE, TYPE_PARAMETER |
| Constructor Summary | |
|---|---|
protected |
SourceRefElement(JavaElement parent)
|
| Method Summary | |
|---|---|
protected void |
closing(java.lang.Object info)
This element is being closed. |
void |
copy(IJavaElement container,
IJavaElement sibling,
java.lang.String rename,
boolean force,
IProgressMonitor monitor)
|
protected java.lang.Object |
createElementInfo()
Returns a new element info for this element. |
void |
delete(boolean force,
IProgressMonitor monitor)
|
boolean |
equals(java.lang.Object o)
Returns true if this handle represents the same Java element as the given handle. |
ASTNode |
findNode(CompilationUnit ast)
Returns the ASTNode that corresponds to this JavaElement
or null if there is no corresponding node. |
protected void |
generateInfos(java.lang.Object info,
java.util.HashMap newElements,
IProgressMonitor pm)
Generates the element infos for this element, its ancestors (if they are not opened) and its children (if it is an Openable). |
IAnnotation |
getAnnotation(java.lang.String name)
|
IAnnotation[] |
getAnnotations()
|
ICompilationUnit |
getCompilationUnit()
|
IResource |
getCorrespondingResource()
Elements within compilation units and class files have no corresponding resource. |
IJavaElement |
getHandleFromMemento(java.lang.String token,
MementoTokenizer memento,
WorkingCopyOwner workingCopyOwner)
|
protected void |
getHandleMemento(java.lang.StringBuffer buff)
|
IJavaElement |
getHandleUpdatingCountFromMemento(MementoTokenizer memento,
WorkingCopyOwner owner)
|
int |
getOccurrenceCount()
|
IOpenable |
getOpenableParent()
Return the first instance of IOpenable in the hierarchy of this type (going up the hierarchy from this type); |
IPath |
getPath()
Returns the path to the innermost resource enclosing this element. |
java.lang.String |
getSource()
Returns the source code associated with this element. |
ISourceRange |
getSourceRange()
Returns the source range associated with this element. |
IResource |
getUnderlyingResource()
Returns the smallest underlying resource that contains this element, or null if this element is not contained
in a resource. |
boolean |
hasChildren()
|
boolean |
isStructureKnown()
Returns whether the structure of this element is known. |
void |
move(IJavaElement container,
IJavaElement sibling,
java.lang.String rename,
boolean force,
IProgressMonitor monitor)
|
void |
rename(java.lang.String newName,
boolean force,
IProgressMonitor monitor)
|
IResource |
resource()
|
protected void |
toStringName(java.lang.StringBuffer buffer)
Debugging purposes |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.aspectj.org.eclipse.jdt.core.ISourceReference |
|---|
exists, getNameRange |
| Methods inherited from interface org.aspectj.org.eclipse.jdt.core.IJavaElement |
|---|
getElementType |
| Field Detail |
|---|
public int occurrenceCount
| Constructor Detail |
|---|
protected SourceRefElement(JavaElement parent)
| Method Detail |
|---|
protected void closing(java.lang.Object info)
throws JavaModelException
closing in class JavaElementJavaModelExceptionprotected java.lang.Object createElementInfo()
createElementInfo in class JavaElement
public void copy(IJavaElement container,
IJavaElement sibling,
java.lang.String rename,
boolean force,
IProgressMonitor monitor)
throws JavaModelException
JavaModelExceptionISourceManipulation
public void delete(boolean force,
IProgressMonitor monitor)
throws JavaModelException
JavaModelExceptionISourceManipulationpublic boolean equals(java.lang.Object o)
JavaElementIf a subclass has other requirements for equality, this method must be overridden.
equals in class JavaElementObject.equals(java.lang.Object)public ASTNode findNode(CompilationUnit ast)
ASTNode that corresponds to this JavaElement
or null if there is no corresponding node.
findNode in class JavaElement
protected void generateInfos(java.lang.Object info,
java.util.HashMap newElements,
IProgressMonitor pm)
throws JavaModelException
JavaElement
generateInfos in class JavaElementJavaModelExceptionpublic IAnnotation getAnnotation(java.lang.String name)
public IAnnotation[] getAnnotations()
throws JavaModelException
JavaModelExceptionpublic ICompilationUnit getCompilationUnit()
getCompilationUnit in class JavaElementIMember
public IResource getCorrespondingResource()
throws JavaModelException
getCorrespondingResource in interface IJavaElementnull if none
JavaModelException - if this element does not exist or if an
exception occurs while accessing its corresponding resourceIJavaElement
public IJavaElement getHandleFromMemento(java.lang.String token,
MementoTokenizer memento,
WorkingCopyOwner workingCopyOwner)
getHandleFromMemento in class JavaElementprotected void getHandleMemento(java.lang.StringBuffer buff)
getHandleMemento in class JavaElement
public IJavaElement getHandleUpdatingCountFromMemento(MementoTokenizer memento,
WorkingCopyOwner owner)
public int getOccurrenceCount()
public IOpenable getOpenableParent()
getOpenableParent in class JavaElementpublic IPath getPath()
IJavaElement
getPath in interface IJavaElementpublic IResource resource()
resource in class JavaElement
public java.lang.String getSource()
throws JavaModelException
ISourceReferencegetSourceRange.
For class files, this returns the source of the entire compilation unit associated with the class file (if there is one).
getSource in interface ISourceReferencenull if this element has no
associated source code
JavaModelException - if an exception occurs while accessing its corresponding resourceISourceReference
public ISourceRange getSourceRange()
throws JavaModelException
ISourceReferenceFor class files, this returns the range of the entire compilation unit associated with the class file (if there is one).
If this element has no associated source code, either null is returned,
or a source range with a -1 offset and a 0 length. SourceRange.isAvailable(ISourceRange)
can be used to detect that case.
getSourceRange in interface ISourceReferencenull or [-1, 0] if this element has no
associated source code
JavaModelException - if an exception occurs while accessing its corresponding resourceISourceReference
public IResource getUnderlyingResource()
throws JavaModelException
IJavaElementnull if this element is not contained
in a resource.
getUnderlyingResource in interface IJavaElementnull if none
JavaModelException - if this element does not exist or if an
exception occurs while accessing its underlying resourceIJavaElement
public boolean hasChildren()
throws JavaModelException
hasChildren in class JavaElementJavaModelExceptionIParent
public boolean isStructureKnown()
throws JavaModelException
IJavaElementfalse is returned.
If the structure of an element is unknown, navigations will return reasonable
defaults. For example, getChildren for a compilation unit with
syntax errors will return a collection of the children that could be parsed.
Note: This does not imply anything about consistency with the underlying resource/buffer contents.
isStructureKnown in interface IJavaElementtrue if the structure of this element is known
JavaModelException - if this element does not exist or if an
exception occurs while accessing its corresponding resourceIJavaElement
public void move(IJavaElement container,
IJavaElement sibling,
java.lang.String rename,
boolean force,
IProgressMonitor monitor)
throws JavaModelException
JavaModelExceptionISourceManipulation
public void rename(java.lang.String newName,
boolean force,
IProgressMonitor monitor)
throws JavaModelException
JavaModelExceptionISourceManipulationprotected void toStringName(java.lang.StringBuffer buffer)
JavaElement
toStringName in class JavaElement
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||