|
|||||||||
| 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
org.aspectj.org.eclipse.jdt.internal.core.LocalVariable
public class LocalVariable
| Field Summary | |
|---|---|
IAnnotation[] |
annotations
|
int |
declarationSourceEnd
|
int |
declarationSourceStart
|
int |
nameEnd
|
int |
nameStart
|
static ILocalVariable[] |
NO_LOCAL_VARIABLES
|
| Fields inherited from class org.aspectj.org.eclipse.jdt.internal.core.SourceRefElement |
|---|
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 | |
|---|---|
LocalVariable(JavaElement parent,
java.lang.String name,
int declarationSourceStart,
int declarationSourceEnd,
int nameStart,
int nameEnd,
java.lang.String typeSignature,
Annotation[] astAnnotations,
int flags,
boolean isParameter)
|
|
| Method Summary | |
|---|---|
protected void |
closing(java.lang.Object info)
This element is being closed. |
protected java.lang.Object |
createElementInfo()
Returns a new element info for this element. |
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. |
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 annotationName)
Returns the annotation with the given name declared on this element. |
IAnnotation[] |
getAnnotations()
Returns the annotations for this element. |
IClassFile |
getClassFile()
|
IResource |
getCorrespondingResource()
Elements within compilation units and class files have no corresponding resource. |
IMember |
getDeclaringMember()
Returns the declaring member of this local variable. |
java.lang.String |
getElementName()
Returns the name of this element. |
int |
getElementType()
Returns this element's kind encoded as an integer. |
int |
getFlags()
Returns the modifier flags for this local variable. |
IJavaElement |
getHandleFromMemento(java.lang.String token,
MementoTokenizer memento,
WorkingCopyOwner owner)
|
protected void |
getHandleMemento(java.lang.StringBuffer buff)
|
protected char |
getHandleMementoDelimiter()
Returns the char that marks the start of this handles
contribution to a memento. |
ISourceRange |
getNameRange()
Returns the source range of this local variable's name. |
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. |
ITypeRoot |
getTypeRoot()
Returns the Java type root in which this local variable is declared. |
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 |
isParameter()
Returns true if this local variable is a method parameter, false otherwise. |
boolean |
isStructureKnown()
Returns whether the structure of this element is known. |
IResource |
resource()
|
protected void |
toStringInfo(int tab,
java.lang.StringBuffer buffer,
java.lang.Object info,
boolean showResolvedInfo)
Debugging purposes |
| Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.SourceRefElement |
|---|
copy, delete, findNode, getCompilationUnit, getHandleUpdatingCountFromMemento, getOccurrenceCount, getOpenableParent, hasChildren, move, rename, toStringName |
| 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.IJavaElement |
|---|
getAncestor, getAttachedJavadoc, getHandleIdentifier, getJavaModel, getJavaProject, getOpenable, getParent, getPrimaryElement, getResource, getSchedulingRule, isReadOnly |
| Field Detail |
|---|
public static final ILocalVariable[] NO_LOCAL_VARIABLES
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,
int flags,
boolean isParameter)
| Method Detail |
|---|
protected void closing(java.lang.Object info)
SourceRefElement
closing in class SourceRefElementprotected java.lang.Object createElementInfo()
SourceRefElement
createElementInfo in class SourceRefElementpublic boolean equals(java.lang.Object o)
JavaElementIf a subclass has other requirements for equality, this method must be overridden.
equals in class SourceRefElementObject.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 IJavaElementexists in interface ISourceReferenceexists in class JavaElementtrue if this element exists in the Java model, and
false if this element does not existIJavaElement
protected void generateInfos(java.lang.Object info,
java.util.HashMap newElements,
IProgressMonitor pm)
JavaElement
generateInfos in class SourceRefElementpublic IAnnotation getAnnotation(java.lang.String annotationName)
IAnnotatable
getAnnotation in interface IAnnotatablegetAnnotation in class SourceRefElementannotationName - the given simple name
public IAnnotation[] getAnnotations()
throws JavaModelException
IAnnotatable
getAnnotations in interface IAnnotatablegetAnnotations in class SourceRefElementJavaModelException - 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 SourceRefElementprotected void getHandleMemento(java.lang.StringBuffer buff)
getHandleMemento in class SourceRefElementprotected char getHandleMementoDelimiter()
JavaElementchar that marks the start of this handles
contribution to a memento.
getHandleMementoDelimiter in class JavaElementpublic IResource getCorrespondingResource()
SourceRefElement
getCorrespondingResource in interface IJavaElementgetCorrespondingResource in class SourceRefElementnull if noneIJavaElementpublic IMember getDeclaringMember()
This is a handle-only method.
getDeclaringMember in interface ILocalVariablepublic java.lang.String getElementName()
IJavaElement
getElementName in interface IJavaElementgetElementName in interface ILocalVariablegetElementName in class JavaElementIAdaptablepublic int getElementType()
IJavaElement
getElementType in interface IJavaElementIJavaElementIJavaElementpublic int getFlags()
Flags.
Note that only flags as indicated in the source are returned.
getFlags in interface ILocalVariableFlagspublic IClassFile getClassFile()
getClassFile in class JavaElementIMember.getClassFile()public ISourceRange getNameRange()
getNameRange in interface ILocalVariablegetNameRange in interface ISourceReferencepublic IPath getPath()
IJavaElement
getPath in interface IJavaElementgetPath in class SourceRefElementpublic IResource resource()
resource in class SourceRefElement
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 ISourceReferencegetSource in class SourceRefElementnull if this element has no
associated source code
JavaModelException - if an exception occurs while accessing its corresponding resourceISourceReference
public ISourceRange getSourceRange()
throws JavaModelException
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, 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 ISourceReferencegetSourceRange in class SourceRefElementnull or [-1, 0] if this element has no
associated source code
JavaModelException - if an exception occurs while accessing its corresponding resourceISourceReferencepublic ITypeRoot getTypeRoot()
This is a handle-only method.
getTypeRoot in interface ILocalVariablepublic 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 ILocalVariableSignature
public IResource getUnderlyingResource()
throws JavaModelException
IJavaElementnull if this element is not contained
in a resource.
getUnderlyingResource in interface IJavaElementgetUnderlyingResource in class SourceRefElementnull if none
JavaModelException - if this element does not exist or if an
exception occurs while accessing its underlying resourceIJavaElementpublic int hashCode()
JavaElement
hashCode in class JavaElementpublic boolean isParameter()
true if this local variable is a method parameter, false otherwise.
isParameter in interface ILocalVariabletrue if this local variable is a method parameter, false otherwise
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 IJavaElementisStructureKnown in class SourceRefElementtrue 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
protected void toStringInfo(int tab,
java.lang.StringBuffer buffer,
java.lang.Object info,
boolean showResolvedInfo)
JavaElement
toStringInfo in class JavaElementshowResolvedInfo - TODO
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||