|
||||||||||
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
org.eclipse.jdt.internal.core.LocalVariable
public class LocalVariable
Field Summary | |
---|---|
IAnnotation[] |
annotations
|
int |
declarationSourceEnd
|
int |
declarationSourceStart
|
int |
nameEnd
|
int |
nameStart
|
Fields inherited from class org.eclipse.jdt.internal.core.SourceRefElement |
---|
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 |
Constructor Summary | |
---|---|
LocalVariable(JavaElement parent,
java.lang.String name,
int declarationSourceStart,
int declarationSourceEnd,
int nameStart,
int nameEnd,
java.lang.String typeSignature,
Annotation[] astAnnotations)
|
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Returns true if this handle represents the same Java element as the given handle. |
boolean |
exists()
Returns whether this Java element exists in the model. |
IAnnotation |
getAnnotation(java.lang.String annotationName)
Returns the annotation with the given name declared on this element. |
IAnnotation[] |
getAnnotations()
Returns the annotations for this element. |
IResource |
getCorrespondingResource()
Elements within compilation units and class files have no corresponding resource. |
java.lang.String |
getElementName()
Returns the name of this element. |
int |
getElementType()
Returns this element's kind encoded as an integer. |
IJavaElement |
getHandleFromMemento(java.lang.String token,
MementoTokenizer memento,
WorkingCopyOwner owner)
|
ISourceRange |
getNameRange()
Returns the source range of this local variable's name. |
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. |
java.lang.String |
getTypeSignature()
Returns the type signature of this local variable. |
IResource |
getUnderlyingResource()
Returns the smallest underlying resource that contains this element, or null if this element is not contained
in a resource. |
int |
hashCode()
Returns the hash code for this Java element. |
boolean |
isStructureKnown()
Returns whether the structure of this element is known. |
IResource |
resource()
|
Methods inherited from class org.eclipse.jdt.internal.core.SourceRefElement |
---|
copy, delete, findNode, getCompilationUnit, getHandleUpdatingCountFromMemento, getOccurrenceCount, getOpenableParent, hasChildren, move, rename |
Methods inherited from class org.eclipse.jdt.internal.core.JavaElement |
---|
close, getAncestor, getAttachedJavadoc, getChildren, getChildrenOfType, getClassFile, getElementInfo, getElementInfo, getHandleFromMemento, getHandleIdentifier, getHandleMemento, getJavaModel, getJavaProject, getOpenable, getParent, getPrimaryElement, getPrimaryElement, getResource, getSchedulingRule, getSourceMapper, 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.IJavaElement |
---|
getAncestor, getAttachedJavadoc, getHandleIdentifier, getJavaModel, getJavaProject, getOpenable, getParent, getPrimaryElement, getResource, getSchedulingRule, isReadOnly |
Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
---|
getAdapter |
Field Detail |
---|
public int declarationSourceStart
public int declarationSourceEnd
public int nameStart
public int nameEnd
public IAnnotation[] annotations
Constructor Detail |
---|
public LocalVariable(JavaElement parent, java.lang.String name, int declarationSourceStart, int declarationSourceEnd, int nameStart, int nameEnd, java.lang.String typeSignature, Annotation[] astAnnotations)
Method Detail |
---|
public boolean equals(java.lang.Object o)
JavaElement
If a subclass has other requirements for equality, this method must be overridden.
equals
in class SourceRefElement
Object.equals(java.lang.Object)
public boolean exists()
IJavaElement
Java elements are handle objects that may or may not be backed by an
actual element. Java elements that are backed by an actual element are
said to "exist", and this method returns true
. For Java
elements that are not working copies, it is always the case that if the
element exists, then its parent also exists (provided it has one) and
includes the element as one of its children. It is therefore possible
to navigated to any existing Java element from the root of the Java model
along a chain of existing Java elements. On the other hand, working
copies are said to exist until they are destroyed (with
IWorkingCopy.destroy
). Unlike regular Java elements, a
working copy never shows up among the children of its parent element
(which may or may not exist).
exists
in interface IJavaElement
exists
in interface ISourceReference
exists
in class JavaElement
true
if this element exists in the Java model, and
false
if this element does not existIJavaElement
public IAnnotation getAnnotation(java.lang.String annotationName)
IAnnotatable
getAnnotation
in interface IAnnotatable
getAnnotation
in class SourceRefElement
annotationName
- the given simple name
public IAnnotation[] getAnnotations() throws JavaModelException
IAnnotatable
getAnnotations
in interface IAnnotatable
getAnnotations
in class SourceRefElement
JavaModelException
- if this element does not exist or if an
exception occurs while accessing its corresponding resource.public IJavaElement getHandleFromMemento(java.lang.String token, MementoTokenizer memento, WorkingCopyOwner owner)
getHandleFromMemento
in class SourceRefElement
public IResource getCorrespondingResource()
SourceRefElement
getCorrespondingResource
in interface IJavaElement
getCorrespondingResource
in class SourceRefElement
null
if noneIJavaElement
public java.lang.String getElementName()
IJavaElement
getElementName
in interface IJavaElement
getElementName
in interface ILocalVariable
getElementName
in class JavaElement
IAdaptable
public int getElementType()
IJavaElement
getElementType
in interface IJavaElement
IJavaElement
IJavaElement
public ISourceRange getNameRange()
ILocalVariable
getNameRange
in interface ILocalVariable
public org.eclipse.core.runtime.IPath getPath()
IJavaElement
getPath
in interface IJavaElement
getPath
in class SourceRefElement
public IResource resource()
resource
in class SourceRefElement
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
getSource
in class SourceRefElement
null
if this element has no
associated source code
JavaModelException
- if an exception occurs while accessing its corresponding resourceISourceReference
public ISourceRange getSourceRange()
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
getSourceRange
in class SourceRefElement
null
or [-1, 0] if this element has no
associated source codeISourceReference
public java.lang.String getTypeSignature()
ILocalVariable
The type signature may be either unresolved (for source types)
or resolved (for binary types), and either basic (for basic types)
or rich (for parameterized types). See Signature
for details.
getTypeSignature
in interface ILocalVariable
Signature
public IResource getUnderlyingResource() throws JavaModelException
IJavaElement
null
if this element is not contained
in a resource.
getUnderlyingResource
in interface IJavaElement
getUnderlyingResource
in class SourceRefElement
null
if none
JavaModelException
- if this element does not exist or if an
exception occurs while accessing its underlying resourceIJavaElement
public int hashCode()
JavaElement
hashCode
in class JavaElement
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
isStructureKnown
in class SourceRefElement
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |