Class SourceField
java.lang.Object
org.eclipse.core.runtime.PlatformObject
org.aspectj.org.eclipse.jdt.internal.core.JavaElement
org.aspectj.org.eclipse.jdt.internal.core.SourceRefElement
org.aspectj.org.eclipse.jdt.internal.core.Member
org.aspectj.org.eclipse.jdt.internal.core.NamedMember
org.aspectj.org.eclipse.jdt.internal.core.SourceField
- All Implemented Interfaces:
IAnnotatable
,IField
,IJavaElement
,IMember
,IParent
,ISourceManipulation
,ISourceReference
,org.eclipse.core.runtime.IAdaptable
- Direct Known Subclasses:
ResolvedSourceField
- See Also:
IField
-
Field Summary
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.core.NamedMember
name
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_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
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_MODULE, JAVA_PROJECT, LOCAL_VARIABLE, METHOD, PACKAGE_DECLARATION, PACKAGE_FRAGMENT, PACKAGE_FRAGMENT_ROOT, TYPE, TYPE_PARAMETER
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SourceField(JavaElement parent, String name)
Constructs a handle to the field with the given name in the specified type. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if this handle represents the same Java element as the given handle.findNode(CompilationUnit ast)
Returns theASTNode
that corresponds to thisJavaElement
ornull
if there is no corresponding node.Returns the constant value associated with this field ornull
if this field has none.int
Returns this element's kind encoded as an integer.protected char
Returns thechar
that marks the start of this handles contribution to a memento.getKey()
Returns the binding key for this field only if the given field isresolved
.getPrimaryElement(boolean checkOwner)
Returns the type signature of this field.boolean
Returns whether this field represents an enum constant.boolean
Returns whether this field represents a record component.boolean
Returns whether this field represents a resolved field.protected void
toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo)
Debugging purposesMethods inherited from class org.aspectj.org.eclipse.jdt.internal.core.NamedMember
getElementName, getFullyQualifiedName, getFullyQualifiedParameterizedName, getKey, getKey, getKey, getKey, getOccurrenceCountSignature, getPackageFragment, getTypeParameters, getTypeQualifiedName, resolveType, resolveType
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.Member
areSimilarMethods, convertConstant, findMethods, getCategories, getClassFile, getDeclaringType, getFlags, getHandleFromMemento, getJavadocRange, getNameRange, getOuterMostLocalContext, getType, getTypeRoot, isBinary, isMainMethod, isReadOnly, readableName
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.SourceRefElement
closing, copy, createElementInfo, delete, generateInfos, getAnnotation, getAnnotations, getCompilationUnit, getCorrespondingResource, getHandleMemento, getHandleUpdatingCountFromMemento, getOccurrenceCount, getOpenableParent, getPath, getSource, getSourceRange, getUnderlyingResource, hasChildren, isStructureKnown, move, rename, resource, toStringName
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.JavaElement
appendEscapedDelimiter, close, escapeMementoName, exists, getAncestor, getAttachedJavadoc, getChildren, getChildrenOfType, getElementInfo, getElementInfo, getHandleFromMemento, getHandleIdentifier, getHandleMemento, getJavadocBaseLocation, getJavaModel, getJavaProject, getLibraryJavadocLocation, getOpenable, getParent, getPrimaryElement, getResource, getSchedulingRule, getSourceElementAt, getSourceMapper, getURLContents, hashCode, isAncestorOf, newDoesNotExistStatus, newJavaModelException, newNotPresentException, openWhenClosed, setParent, tabString, toDebugString, toString, toString, toStringAncestors, toStringChildren, toStringInfo, toStringWithAncestors, toStringWithAncestors, unresolved, validateAndCache
Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
Methods inherited from interface org.aspectj.org.eclipse.jdt.core.IAnnotatable
getAnnotation, getAnnotations
Methods inherited from interface org.aspectj.org.eclipse.jdt.core.IField
getElementName
Methods inherited from interface org.aspectj.org.eclipse.jdt.core.IJavaElement
exists, getAncestor, getAttachedJavadoc, getCorrespondingResource, getHandleIdentifier, getJavaModel, getJavaProject, getOpenable, getParent, getPath, getPrimaryElement, getResource, getSchedulingRule, getUnderlyingResource, isReadOnly, isStructureKnown
Methods inherited from interface org.aspectj.org.eclipse.jdt.core.IMember
getCategories, getClassFile, getCompilationUnit, getDeclaringType, getFlags, getJavadocRange, getOccurrenceCount, getType, getTypeRoot, isBinary
Methods inherited from interface org.aspectj.org.eclipse.jdt.core.IParent
getChildren, hasChildren
Methods inherited from interface org.aspectj.org.eclipse.jdt.core.ISourceManipulation
copy, delete, move, rename
Methods inherited from interface org.aspectj.org.eclipse.jdt.core.ISourceReference
exists, getNameRange, getSource, getSourceRange
-
Constructor Details
-
SourceField
Constructs a handle to the field with the given name in the specified type.
-
-
Method Details
-
equals
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 classSourceRefElement
- See Also:
Object.equals(java.lang.Object)
-
findNode
Description copied from class:SourceRefElement
Returns theASTNode
that corresponds to thisJavaElement
ornull
if there is no corresponding node.- Overrides:
findNode
in classSourceRefElement
-
getConstant
Description copied from interface:IField
Returns the constant value associated with this field ornull
if this field has none. To have a constant value, the field needs to be final and initialized with a compile-time constant expression.For types from source, this currently only works if the field initializer is a literal (returns
null
for more complex constant expressions).For primitive types, returns the boxed value.
- Specified by:
getConstant
in interfaceIField
- Returns:
- the constant value associated with this field, or
null
if not available - Throws:
JavaModelException
- if this element does not exist or if an exception occurs while accessing its corresponding resource- See Also:
IField
-
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 interfaceIJavaElement
- Returns:
- the kind of element; one of the constants declared in
IJavaElement
- See Also:
IJavaElement
-
getKey
Description copied from interface:IField
Returns the binding key for this field only if the given field isresolved
. A binding key is a key that uniquely identifies this field. It allows access to generic info for parameterized fields.If the given field is not resolved, the returned key is simply the java element's key.
- Specified by:
getKey
in interfaceIField
- Returns:
- the binding key for this field
- See Also:
IBinding.getKey()
,BindingKey
,IField.isResolved()
-
getHandleMementoDelimiter
protected char getHandleMementoDelimiter()Description copied from class:JavaElement
Returns thechar
that marks the start of this handles contribution to a memento.- Overrides:
getHandleMementoDelimiter
in classMember
- See Also:
JavaElement.getHandleMemento()
-
getPrimaryElement
- Overrides:
getPrimaryElement
in classJavaElement
-
getTypeSignature
Description copied from interface:IField
Returns the type signature of this field. For enum constants, this returns the signature of the declaring enum class.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 interfaceIField
- Returns:
- the type signature of this field
- Throws:
JavaModelException
- if this element does not exist or if an exception occurs while accessing its corresponding resource- See Also:
IField
-
isEnumConstant
Description copied from interface:IField
Returns whether this field represents an enum constant.- Specified by:
isEnumConstant
in interfaceIField
- Returns:
- whether this field represents an enum constant
- Throws:
JavaModelException
- if this element does not exist or if an exception occurs while accessing its corresponding resource
-
isResolved
public boolean isResolved()Description copied from interface:IField
Returns whether this field represents a resolved field. If a field is resolved, its key contains resolved information.- Specified by:
isResolved
in interfaceIField
- Returns:
- whether this field represents a resolved field.
-
resolved
- Overrides:
resolved
in classJavaElement
-
toStringInfo
Description copied from class:JavaElement
Debugging purposes- Overrides:
toStringInfo
in classJavaElement
showResolvedInfo
- TODO
-
isRecordComponent
Description copied from interface:IField
Returns whether this field represents a record component.- Specified by:
isRecordComponent
in interfaceIField
- Returns:
- whether this field represents a record component.
- Throws:
JavaModelException
-