org.aspectj.org.eclipse.jdt.internal.core
Class LocalVariable

java.lang.Object
  extended by PlatformObject
      extended by org.aspectj.org.eclipse.jdt.internal.core.JavaElement
          extended by org.aspectj.org.eclipse.jdt.internal.core.SourceRefElement
              extended by org.aspectj.org.eclipse.jdt.internal.core.LocalVariable
All Implemented Interfaces:
IJavaElement, ILocalVariable, ISourceReference

public class LocalVariable
extends SourceRefElement
implements ILocalVariable


Field Summary
 int declarationSourceEnd
           
 int declarationSourceStart
           
 int nameEnd
           
 int nameStart
           
 
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_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
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)
           
 
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).
 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)
           
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.
 IResource getResource()
          Returns 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.
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 org.aspectj.org.eclipse.jdt.internal.core.JavaElement
close, escapeMementoName, getAncestor, getAttachedJavadoc, getChildren, getChildrenOfType, getClassFile, getElementInfo, getElementInfo, getHandleFromMemento, getHandleIdentifier, getHandleMemento, getJavadocBaseLocation, getJavaModel, getJavaProject, getLibraryJavadocLocation, getOpenable, getParent, getPrimaryElement, getPrimaryElement, getSchedulingRule, getSourceElementAt, getSourceMapper, getURLContents, isAncestorOf, isReadOnly, newJavaModelException, newNotPresentException, openWhenClosed, readableName, resolved, tabString, toDebugString, toString, toString, toStringAncestors, toStringChildren, toStringInfo, toStringWithAncestors, toStringWithAncestors, unresolved
 
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, getSchedulingRule, isReadOnly
 

Field Detail

declarationSourceStart

public int declarationSourceStart

declarationSourceEnd

public int declarationSourceEnd

nameStart

public int nameStart

nameEnd

public int nameEnd
Constructor Detail

LocalVariable

public LocalVariable(JavaElement parent,
                     java.lang.String name,
                     int declarationSourceStart,
                     int declarationSourceEnd,
                     int nameStart,
                     int nameEnd,
                     java.lang.String typeSignature)
Method Detail

closing

protected void closing(java.lang.Object info)
Description copied from class: SourceRefElement
This element is being closed. Do any necessary cleanup.

Overrides:
closing in class SourceRefElement

createElementInfo

protected java.lang.Object createElementInfo()
Description copied from class: SourceRefElement
Returns a new element info for this element.

Overrides:
createElementInfo in class SourceRefElement

equals

public boolean equals(java.lang.Object o)
Description copied from class: JavaElement
Returns true if this handle represents the same Java element as the given handle. By default, two handles represent the same element if they are identical or if they represent the same type of element, have equal names, parents, and occurrence counts.

If a subclass has other requirements for equality, this method must be overridden.

Overrides:
equals in class SourceRefElement
See Also:
Object.equals(java.lang.Object)

exists

public boolean exists()
Description copied from interface: IJavaElement
Returns whether this Java element exists in the model.

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).

Specified by:
exists in interface IJavaElement
Specified by:
exists in interface ISourceReference
Overrides:
exists in class JavaElement
Returns:
true if this element exists in the Java model, and false if this element does not exist
See Also:
IJavaElement

generateInfos

protected void generateInfos(java.lang.Object info,
                             java.util.HashMap newElements,
                             IProgressMonitor pm)
Description copied from class: JavaElement
Generates the element infos for this element, its ancestors (if they are not opened) and its children (if it is an Openable). Puts the newly created element info in the given map.

Overrides:
generateInfos in class SourceRefElement

getHandleFromMemento

public IJavaElement getHandleFromMemento(java.lang.String token,
                                         MementoTokenizer memento,
                                         WorkingCopyOwner owner)
Overrides:
getHandleFromMemento in class SourceRefElement

getHandleMemento

protected void getHandleMemento(java.lang.StringBuffer buff)
Overrides:
getHandleMemento in class SourceRefElement

getHandleMementoDelimiter

protected char getHandleMementoDelimiter()
Description copied from class: JavaElement
Returns the char that marks the start of this handles contribution to a memento.

Specified by:
getHandleMementoDelimiter in class JavaElement

getCorrespondingResource

public IResource getCorrespondingResource()
Description copied from class: SourceRefElement
Elements within compilation units and class files have no corresponding resource.

Specified by:
getCorrespondingResource in interface IJavaElement
Overrides:
getCorrespondingResource in class SourceRefElement
Returns:
the corresponding resource, or null if none
See Also:
IJavaElement

getElementName

public java.lang.String getElementName()
Description copied from interface: IJavaElement
Returns the name of this element. This is a handle-only method.

Specified by:
getElementName in interface IJavaElement
Specified by:
getElementName in interface ILocalVariable
Overrides:
getElementName in class JavaElement
Returns:
the element name
See Also:
IAdaptable

getElementType

public int getElementType()
Description copied from interface: IJavaElement
Returns this element's kind encoded as an integer. This is a handle-only method.

Specified by:
getElementType in interface IJavaElement
Returns:
the kind of element; one of the constants declared in IJavaElement
See Also:
IJavaElement

getNameRange

public ISourceRange getNameRange()
Description copied from interface: ILocalVariable
Returns the source range of this local variable's name.

Specified by:
getNameRange in interface ILocalVariable
Returns:
the source range of this local variable's name

getPath

public IPath getPath()
Description copied from interface: IJavaElement
Returns the path to the innermost resource enclosing this element. If this element is not included in an external archive, the path returned is the full, absolute path to the underlying resource, relative to the workbench. If this element is included in an external archive, the path returned is the absolute path to the archive in the file system. This is a handle-only method.

Specified by:
getPath in interface IJavaElement
Overrides:
getPath in class SourceRefElement
Returns:
the path to the innermost resource enclosing this element

getResource

public IResource getResource()
Description copied from interface: IJavaElement
Returns the innermost resource enclosing this element. If this element is included in an archive and this archive is not external, this is the underlying resource corresponding to the archive. If this element is included in an external archive, null is returned. This is a handle-only method.

Specified by:
getResource in interface IJavaElement
Overrides:
getResource in class SourceRefElement
Returns:
the innermost resource enclosing this element, null if this element is included in an external archive

getSource

public java.lang.String getSource()
                           throws JavaModelException
Description copied from interface: ISourceReference
Returns the source code associated with this element. This extracts the substring from the source buffer containing this source element. This corresponds to the source range that would be returned by getSourceRange.

For class files, this returns the source of the entire compilation unit associated with the class file (if there is one).

Specified by:
getSource in interface ISourceReference
Overrides:
getSource in class SourceRefElement
Returns:
the source code, or null if this element has no associated source code
Throws:
JavaModelException - if an exception occurs while accessing its corresponding resource
See Also:
ISourceReference

getSourceRange

public ISourceRange getSourceRange()
Description copied from interface: ISourceReference
Returns the source range associated with this element.

For class files, this returns the range of the entire compilation unit associated with the class file (if there is one).

Specified by:
getSourceRange in interface ISourceReference
Overrides:
getSourceRange in class SourceRefElement
Returns:
the source range, or null if this element has no associated source code
See Also:
ISourceReference

getTypeSignature

public java.lang.String getTypeSignature()
Description copied from interface: ILocalVariable
Returns the type signature of this local variable.

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.

Specified by:
getTypeSignature in interface ILocalVariable
Returns:
the type signature of this local variable.
See Also:
Signature

getUnderlyingResource

public IResource getUnderlyingResource()
                                throws JavaModelException
Description copied from interface: IJavaElement
Returns the smallest underlying resource that contains this element, or null if this element is not contained in a resource.

Specified by:
getUnderlyingResource in interface IJavaElement
Overrides:
getUnderlyingResource in class SourceRefElement
Returns:
the underlying resource, or null if none
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its underlying resource
See Also:
IJavaElement

hashCode

public int hashCode()
Description copied from class: JavaElement
Returns the hash code for this Java element. By default, the hash code for an element is a combination of its name and parent's hash code. Elements with other requirements must override this method.

Overrides:
hashCode in class JavaElement

isStructureKnown

public boolean isStructureKnown()
                         throws JavaModelException
Description copied from interface: IJavaElement
Returns whether the structure of this element is known. For example, for a compilation unit that could not be parsed, false is returned. If the structure of an element is unknown, navigations will return reasonable defaults. For example, getChildren will return an empty collection.

Note: This does not imply anything about consistency with the underlying resource/buffer contents.

Specified by:
isStructureKnown in interface IJavaElement
Overrides:
isStructureKnown in class SourceRefElement
Returns:
true if the structure of this element is known
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource
See Also:
IJavaElement

toStringInfo

protected void toStringInfo(int tab,
                            java.lang.StringBuffer buffer,
                            java.lang.Object info,
                            boolean showResolvedInfo)
Description copied from class: JavaElement
Debugging purposes

Overrides:
toStringInfo in class JavaElement
showResolvedInfo - TODO