Klasse LocalVariable
- Alle implementierten Schnittstellen:
IAnnotatable
,IJavaElement
,ILocalVariable
,ISourceReference
,org.eclipse.core.runtime.IAdaptable
-
Feldübersicht
Modifizierer und TypFeldBeschreibungIAnnotation[][]
int
int
int
int
static final ILocalVariable[]
Von Klasse geerbte Felder org.aspectj.org.eclipse.jdt.internal.core.SourceRefElement
occurrenceCount
Von Klasse geerbte Felder org.aspectj.org.eclipse.jdt.internal.core.JavaElement
JEM_ANNOTATION, JEM_CLASSFILE, JEM_COMPILATIONUNIT, JEM_COUNT, JEM_DELIMITER_ESCAPE, JEM_ESCAPE, JEM_FIELD, JEM_IMPORTDECLARATION, JEM_INITIALIZER, JEM_JAVAPROJECT, JEM_LAMBDA_EXPRESSION, JEM_LAMBDA_METHOD, JEM_LOCALVARIABLE, JEM_METHOD, JEM_MODULAR_CLASSFILE, JEM_MODULE, JEM_PACKAGEDECLARATION, JEM_PACKAGEFRAGMENT, JEM_PACKAGEFRAGMENTROOT, JEM_STRING, JEM_TYPE, JEM_TYPE_PARAMETER, NO_ELEMENTS, NO_INFO, NO_STRINGS
Von Schnittstelle geerbte Felder org.aspectj.org.eclipse.jdt.core.IJavaElement
ANNOTATION, CLASS_FILE, COMPILATION_UNIT, FIELD, IMPORT_CONTAINER, IMPORT_DECLARATION, INITIALIZER, JAVA_MODEL, JAVA_MODULE, JAVA_PROJECT, LOCAL_VARIABLE, METHOD, PACKAGE_DECLARATION, PACKAGE_FRAGMENT, PACKAGE_FRAGMENT_ROOT, TYPE, TYPE_PARAMETER
-
Konstruktorübersicht
KonstruktorBeschreibungLocalVariable
(JavaElement parent, String name, int declarationSourceStart, int declarationSourceEnd, int nameStart, int nameEnd, String typeSignature, Annotation[] astAnnotations, int flags, boolean isParameter) LocalVariable
(JavaElement parent, String name, int declarationSourceStart, int declarationSourceEnd, int nameStart, int nameEnd, String typeSignature, Annotation[] astAnnotations, int flags, boolean isParameter, Annotation[][] astAnnotationsOnDimensions) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected void
This element is being closed.protected Object
Returns a new element info for this element.boolean
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
(Object info, HashMap newElements, org.eclipse.core.runtime.IProgressMonitor pm) Generates the element infos for this element, its ancestors (if they are not opened) and its children (if it is an Openable).getAnnotation
(String annotationName) Returns the annotation with the given name declared on this element.Returns the annotations for this element.org.eclipse.core.resources.IResource
Elements within compilation units and class files have no corresponding resource.Returns the declaring member of this local variable.Returns the name of this element.int
Returns this element's kind encoded as an integer.int
getFlags()
Returns the modifier flags for this local variable.getHandleFromMemento
(String token, MementoTokenizer memento, WorkingCopyOwner owner) protected void
getHandleMemento
(StringBuffer buff) protected void
getHandleMemento
(StringBuffer buff, boolean memoizeParent) protected char
Returns thechar
that marks the start of this handles contribution to a memento.getKey
(boolean forceOpen) 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.Returns the source code associated with this element.Returns the source range associated with this element.Returns the Java type root in which this local variable is declared.Returns the type signature of this local variable.org.eclipse.core.resources.IResource
Returns the smallest underlying resource that contains this element, ornull
if this element is not contained in a resource.int
hashCode()
Returns the hash code for this Java element.boolean
Returnstrue
if this local variable is a method parameter,false
otherwise.boolean
Returns whether the structure of this element is known.org.eclipse.core.resources.IResource
resource()
protected void
toStringInfo
(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) Debugging purposesVon Klasse geerbte Methoden org.aspectj.org.eclipse.jdt.internal.core.SourceRefElement
copy, delete, findNode, getCompilationUnit, getHandleUpdatingCountFromMemento, getOccurrenceCount, getOpenableParent, hasChildren, move, rename, toStringName
Von Klasse geerbte Methoden org.aspectj.org.eclipse.jdt.internal.core.JavaElement
appendEscapedDelimiter, close, escapeMementoName, getAncestor, getAttachedJavadoc, getChildren, getChildrenOfType, getElementInfo, getElementInfo, getHandleFromMemento, getHandleIdentifier, getHandleMemento, getJavadocBaseLocation, getJavaModel, getJavaProject, getLibraryJavadocLocation, getOpenable, getParent, getPrimaryElement, getPrimaryElement, getResource, getSchedulingRule, getSourceElementAt, getSourceMapper, getURLContents, isAncestorOf, isReadOnly, newDoesNotExistStatus, newJavaModelException, newNotPresentException, openWhenClosed, readableName, resolved, setParent, tabString, toDebugString, toString, toString, toStringAncestors, toStringChildren, toStringInfo, toStringWithAncestors, toStringWithAncestors, unresolved, validateAndCache
Von Klasse geerbte Methoden org.eclipse.core.runtime.PlatformObject
getAdapter
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden org.eclipse.core.runtime.IAdaptable
getAdapter
Von Schnittstelle geerbte Methoden org.aspectj.org.eclipse.jdt.core.IJavaElement
getAncestor, getAttachedJavadoc, getHandleIdentifier, getJavaModel, getJavaProject, getOpenable, getParent, getPrimaryElement, getResource, getSchedulingRule, isReadOnly
-
Felddetails
-
NO_LOCAL_VARIABLES
-
declarationSourceStart
public int declarationSourceStart -
declarationSourceEnd
public int declarationSourceEnd -
nameStart
public int nameStart -
nameEnd
public int nameEnd -
annotations
-
annotationsOnDimensions
-
-
Konstruktordetails
-
LocalVariable
public LocalVariable(JavaElement parent, String name, int declarationSourceStart, int declarationSourceEnd, int nameStart, int nameEnd, String typeSignature, Annotation[] astAnnotations, int flags, boolean isParameter) -
LocalVariable
public LocalVariable(JavaElement parent, String name, int declarationSourceStart, int declarationSourceEnd, int nameStart, int nameEnd, String typeSignature, Annotation[] astAnnotations, int flags, boolean isParameter, Annotation[][] astAnnotationsOnDimensions)
-
-
Methodendetails
-
closing
Beschreibung aus Klasse kopiert:SourceRefElement
This element is being closed. Do any necessary cleanup.- Setzt außer Kraft:
closing
in KlasseSourceRefElement
-
createElementInfo
Beschreibung aus Klasse kopiert:SourceRefElement
Returns a new element info for this element.- Setzt außer Kraft:
createElementInfo
in KlasseSourceRefElement
-
equals
Beschreibung aus Klasse kopiert: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.
- Setzt außer Kraft:
equals
in KlasseSourceRefElement
- Siehe auch:
-
exists
public boolean exists()Beschreibung aus Schnittstelle kopiert: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 (withIWorkingCopy.destroy
). Unlike regular Java elements, a working copy never shows up among the children of its parent element (which may or may not exist).- Angegeben von:
exists
in SchnittstelleIJavaElement
- Angegeben von:
exists
in SchnittstelleISourceReference
- Setzt außer Kraft:
exists
in KlasseJavaElement
- Gibt zurück:
true
if this element exists in the Java model, andfalse
if this element does not exist- Siehe auch:
-
generateInfos
protected void generateInfos(Object info, HashMap newElements, org.eclipse.core.runtime.IProgressMonitor pm) Beschreibung aus Klasse kopiert: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.- Setzt außer Kraft:
generateInfos
in KlasseSourceRefElement
-
getAnnotation
Beschreibung aus Schnittstelle kopiert:IAnnotatable
Returns the annotation with the given name declared on this element. This is a handle-only method. The annotation may or may not exist.- Angegeben von:
getAnnotation
in SchnittstelleIAnnotatable
- Setzt außer Kraft:
getAnnotation
in KlasseSourceRefElement
- Parameter:
annotationName
- the given simple name- Gibt zurück:
- the annotation with the given name declared on this element
-
getAnnotations
Beschreibung aus Schnittstelle kopiert:IAnnotatable
Returns the annotations for this element. Returns an empty array if this element has no annotations.- Angegeben von:
getAnnotations
in SchnittstelleIAnnotatable
- Setzt außer Kraft:
getAnnotations
in KlasseSourceRefElement
- Gibt zurück:
- the annotations of this element, in the order declared in the source, or an empty array if none
- Löst aus:
JavaModelException
- if this element does not exist or if an exception occurs while accessing its corresponding resource.
-
getHandleFromMemento
public IJavaElement getHandleFromMemento(String token, MementoTokenizer memento, WorkingCopyOwner owner) - Setzt außer Kraft:
getHandleFromMemento
in KlasseSourceRefElement
-
getHandleMemento
- Setzt außer Kraft:
getHandleMemento
in KlasseSourceRefElement
-
getHandleMemento
-
getHandleMementoDelimiter
protected char getHandleMementoDelimiter()Beschreibung aus Klasse kopiert:JavaElement
Returns thechar
that marks the start of this handles contribution to a memento.- Angegeben von:
getHandleMementoDelimiter
in KlasseJavaElement
-
getCorrespondingResource
public org.eclipse.core.resources.IResource getCorrespondingResource()Beschreibung aus Klasse kopiert:SourceRefElement
Elements within compilation units and class files have no corresponding resource.- Angegeben von:
getCorrespondingResource
in SchnittstelleIJavaElement
- Setzt außer Kraft:
getCorrespondingResource
in KlasseSourceRefElement
- Gibt zurück:
- the corresponding resource, or
null
if none - Siehe auch:
-
getDeclaringMember
Returns the declaring member of this local variable.This is a handle-only method.
- Angegeben von:
getDeclaringMember
in SchnittstelleILocalVariable
- Gibt zurück:
- the declaring member of this local variable
- Seit:
- 3.7
-
getElementName
Beschreibung aus Schnittstelle kopiert:IJavaElement
Returns the name of this element. This is a handle-only method.- Angegeben von:
getElementName
in SchnittstelleIJavaElement
- Angegeben von:
getElementName
in SchnittstelleILocalVariable
- Setzt außer Kraft:
getElementName
in KlasseJavaElement
- Gibt zurück:
- the element name
- Siehe auch:
-
getElementType
public int getElementType()Beschreibung aus Schnittstelle kopiert:IJavaElement
Returns this element's kind encoded as an integer. This is a handle-only method.- Angegeben von:
getElementType
in SchnittstelleIJavaElement
- Gibt zurück:
- the kind of element; one of the constants declared in
IJavaElement
- Siehe auch:
-
getFlags
public int getFlags()Returns the modifier flags for this local variable. The flags can be examined using classFlags
.Note that only flags as indicated in the source are returned.
- Angegeben von:
getFlags
in SchnittstelleILocalVariable
- Gibt zurück:
- the modifier flags for this local variable
- Seit:
- 3.7
- Siehe auch:
-
getClassFile
- Setzt außer Kraft:
getClassFile
in KlasseJavaElement
- Siehe auch:
-
getNameRange
Returns the source range of this local variable's name.- Angegeben von:
getNameRange
in SchnittstelleILocalVariable
- Angegeben von:
getNameRange
in SchnittstelleISourceReference
- Gibt zurück:
- the source range of this local variable's name
- Seit:
- 3.7
-
getPath
public org.eclipse.core.runtime.IPath getPath()Beschreibung aus Schnittstelle kopiert:IJavaElement
Returns the path to the innermost resource enclosing this element. If this element is not included in an external library, the path returned is the full, absolute path to the underlying resource, relative to the workbench. If this element is included in an external library, the path returned is the absolute path to the archive or to the folder in the file system. This is a handle-only method.- Angegeben von:
getPath
in SchnittstelleIJavaElement
- Setzt außer Kraft:
getPath
in KlasseSourceRefElement
- Gibt zurück:
- the path to the innermost resource enclosing this element
-
resource
public org.eclipse.core.resources.IResource resource()- Setzt außer Kraft:
resource
in KlasseSourceRefElement
-
getSource
Beschreibung aus Schnittstelle kopiert: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 bygetSourceRange
.For class files, this returns the source of the entire compilation unit associated with the class file (if there is one).
- Angegeben von:
getSource
in SchnittstelleISourceReference
- Setzt außer Kraft:
getSource
in KlasseSourceRefElement
- Gibt zurück:
- the source code, or
null
if this element has no associated source code - Löst aus:
JavaModelException
- if an exception occurs while accessing its corresponding resource- Siehe auch:
-
getSourceRange
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).
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.- Angegeben von:
getSourceRange
in SchnittstelleISourceReference
- Setzt außer Kraft:
getSourceRange
in KlasseSourceRefElement
- Gibt zurück:
- the source range, or either
null
or [-1, 0] if this element has no associated source code - Löst aus:
JavaModelException
- if an exception occurs while accessing its corresponding resource- Seit:
- 3.7
- Siehe auch:
-
getTypeRoot
Returns the Java type root in which this local variable is declared.This is a handle-only method.
- Angegeben von:
getTypeRoot
in SchnittstelleILocalVariable
- Gibt zurück:
- the Java type root in which this local variable is declared
- Seit:
- 3.7
-
getTypeSignature
Beschreibung aus Schnittstelle kopiert: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.- Angegeben von:
getTypeSignature
in SchnittstelleILocalVariable
- Gibt zurück:
- the type signature of this local variable.
- Siehe auch:
-
getUnderlyingResource
Beschreibung aus Schnittstelle kopiert:IJavaElement
Returns the smallest underlying resource that contains this element, ornull
if this element is not contained in a resource.- Angegeben von:
getUnderlyingResource
in SchnittstelleIJavaElement
- Setzt außer Kraft:
getUnderlyingResource
in KlasseSourceRefElement
- Gibt zurück:
- the underlying resource, or
null
if none - Löst aus:
JavaModelException
- if this element does not exist or if an exception occurs while accessing its underlying resource- Siehe auch:
-
hashCode
public int hashCode()Beschreibung aus Klasse kopiert: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.- Setzt außer Kraft:
hashCode
in KlasseJavaElement
-
isParameter
public boolean isParameter()Returnstrue
if this local variable is a method parameter,false
otherwise.- Angegeben von:
isParameter
in SchnittstelleILocalVariable
- Gibt zurück:
true
if this local variable is a method parameter,false
otherwise- Seit:
- 3.7
-
isStructureKnown
Beschreibung aus Schnittstelle kopiert:IJavaElement
Returns whether the structure of this element is known. For example, for a compilation unit that has syntax errors,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.
- Angegeben von:
isStructureKnown
in SchnittstelleIJavaElement
- Setzt außer Kraft:
isStructureKnown
in KlasseSourceRefElement
- Gibt zurück:
true
if the structure of this element is known- Löst aus:
JavaModelException
- if this element does not exist or if an exception occurs while accessing its corresponding resource- Siehe auch:
-
getKey
- Löst aus:
JavaModelException
- Siehe auch:
-
toStringInfo
Beschreibung aus Klasse kopiert:JavaElement
Debugging purposes- Setzt außer Kraft:
toStringInfo
in KlasseJavaElement
- Parameter:
showResolvedInfo
- TODO
-