|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.runtime.PlatformObject
org.eclipse.jdt.internal.core.JavaElement
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.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 |
Fields inherited from interface 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 |
Method Summary | |
---|---|
void |
copy(IJavaElement container,
IJavaElement sibling,
java.lang.String rename,
boolean force,
org.eclipse.core.runtime.IProgressMonitor monitor)
|
void |
delete(boolean force,
org.eclipse.core.runtime.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. |
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)
|
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); |
org.eclipse.core.runtime.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,
org.eclipse.core.runtime.IProgressMonitor monitor)
|
void |
rename(java.lang.String newName,
boolean force,
org.eclipse.core.runtime.IProgressMonitor monitor)
|
IResource |
resource()
|
Methods inherited from class org.eclipse.jdt.internal.core.JavaElement |
---|
close, exists, getAncestor, getAttachedJavadoc, getChildren, getChildrenOfType, getClassFile, getElementInfo, getElementInfo, getElementName, getHandleFromMemento, getHandleIdentifier, getHandleMemento, getJavaModel, getJavaProject, getOpenable, getParent, getPrimaryElement, getPrimaryElement, getResource, getSchedulingRule, getSourceMapper, hashCode, isAncestorOf, isReadOnly, newJavaModelException, newNotPresentException, readableName, resolved, toDebugString, toString, toStringInfo, toStringWithAncestors, toStringWithAncestors, unresolved |
Methods inherited from class org.eclipse.core.runtime.PlatformObject |
---|
getAdapter |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.jdt.core.ISourceReference |
---|
exists |
Methods inherited from interface org.eclipse.jdt.core.IJavaElement |
---|
getElementType |
Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
---|
getAdapter |
Field Detail |
---|
public int occurrenceCount
Method Detail |
---|
public void copy(IJavaElement container, IJavaElement sibling, java.lang.String rename, boolean force, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
JavaModelException
ISourceManipulation
public void delete(boolean force, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
JavaModelException
ISourceManipulation
public boolean equals(java.lang.Object o)
JavaElement
If a subclass has other requirements for equality, this method must be overridden.
equals
in class JavaElement
Object.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
public IAnnotation getAnnotation(java.lang.String name)
public IAnnotation[] getAnnotations() throws JavaModelException
JavaModelException
public ICompilationUnit getCompilationUnit()
getCompilationUnit
in class JavaElement
IMember
public IResource getCorrespondingResource() throws JavaModelException
getCorrespondingResource
in interface IJavaElement
null
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 JavaElement
public IJavaElement getHandleUpdatingCountFromMemento(MementoTokenizer memento, WorkingCopyOwner owner)
public int getOccurrenceCount()
public IOpenable getOpenableParent()
getOpenableParent
in class JavaElement
public org.eclipse.core.runtime.IPath getPath()
IJavaElement
getPath
in interface IJavaElement
public IResource resource()
resource
in class JavaElement
public java.lang.String getSource() throws JavaModelException
ISourceReference
getSourceRange
.
For class files, this returns the source of the entire compilation unit associated with the class file (if there is one).
getSource
in interface ISourceReference
null
if this element has no
associated source code
JavaModelException
- if an exception occurs while accessing its corresponding resourceISourceReference
public ISourceRange getSourceRange() throws JavaModelException
ISourceReference
For 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 null
is either returned,
or a source range with a -1 offset and a 0 length.
getSourceRange
in interface ISourceReference
null
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
IJavaElement
null
if this element is not contained
in a resource.
getUnderlyingResource
in interface IJavaElement
null
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 JavaElement
JavaModelException
IParent
public boolean isStructureKnown() throws JavaModelException
IJavaElement
false
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 IJavaElement
true
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, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
JavaModelException
ISourceManipulation
public void rename(java.lang.String newName, boolean force, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
JavaModelException
ISourceManipulation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |