public class ResolvedBinaryField extends BinaryMember
nameoccurrenceCountJEM_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_PACKAGEDECLARATION, JEM_PACKAGEFRAGMENT, JEM_PACKAGEFRAGMENTROOT, JEM_STRING, JEM_TYPE, JEM_TYPE_PARAMETER, NO_ELEMENTS, NO_INFO, parentANNOTATION, 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 and Description |
|---|
ResolvedBinaryField(JavaElement parent,
java.lang.String name,
java.lang.String uniqueKey) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o)
Returns true if this handle represents the same Java element
as the given handle.
|
IAnnotation[] |
getAnnotations()
Returns the annotations for this element.
|
java.lang.String |
getAttachedJavadoc(IProgressMonitor monitor)
Returns the Javadoc as HTML source if this element has attached Javadoc,
null otherwise. |
java.lang.Object |
getConstant()
Returns the constant value associated with this field
or
null if this field has none. |
int |
getElementType()
Returns this element's kind encoded as an integer.
|
int |
getFlags()
Returns the modifier flags for this member.
|
protected char |
getHandleMementoDelimiter()
Returns the
char that marks the start of this handles
contribution to a memento. |
java.lang.String |
getKey()
Returns the binding key for this field only if the given field is
resolved. |
java.lang.String |
getKey(boolean forceOpen) |
java.lang.String |
getTypeSignature()
Returns the type signature of this field.
|
boolean |
isEnumConstant()
Returns whether this field represents an enum constant.
|
boolean |
isResolved()
Returns whether this field represents a resolved field.
|
JavaElement |
resolved(Binding binding) |
protected void |
toStringInfo(int tab,
java.lang.StringBuffer buffer,
java.lang.Object info,
boolean showResolvedInfo)
Debugging purposes
|
JavaElement |
unresolved() |
copy, getAnnotations, getCategories, getNameRange, getSourceRange, getStandardAnnotations, isBinary, isStructureKnown, move, rename, setContentsgetElementName, getFullyQualifiedName, getFullyQualifiedParameterizedName, getKey, getKey, getKey, getOccurrenceCountSignature, getPackageFragment, getTypeParameters, getTypeQualifiedName, resolveType, resolveTypeareSimilarMethods, convertConstant, findMethods, getClassFile, getDeclaringType, getHandleFromMemento, getJavadocRange, getOuterMostLocalContext, getType, getTypeRoot, isMainMethod, isReadOnly, readableNameclosing, createElementInfo, delete, findNode, generateInfos, getAnnotation, getCompilationUnit, getCorrespondingResource, getHandleMemento, getHandleUpdatingCountFromMemento, getOccurrenceCount, getOpenableParent, getPath, getSource, getUnderlyingResource, hasChildren, resource, toStringNameappendEscapedDelimiter, close, escapeMementoName, exists, getAncestor, getChildren, getChildrenOfType, getElementInfo, getElementInfo, getHandleFromMemento, getHandleIdentifier, getHandleMemento, getJavadocBaseLocation, getJavaModel, getJavaProject, getLibraryJavadocLocation, getOpenable, getParent, getPrimaryElement, getPrimaryElement, getResource, getSchedulingRule, getSourceElementAt, getSourceMapper, getURLContents, hashCode, isAncestorOf, newDoesNotExistStatus, newJavaModelException, newNotPresentException, openWhenClosed, tabString, toDebugString, toString, toString, toStringAncestors, toStringChildren, toStringInfo, toStringWithAncestors, toStringWithAncestors, validateAndCacheclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetElementNamegetCategories, getClassFile, getCompilationUnit, getDeclaringType, getJavadocRange, getOccurrenceCount, getType, getTypeRoot, isBinaryexists, getAncestor, getCorrespondingResource, getHandleIdentifier, getJavaModel, getJavaProject, getOpenable, getParent, getPath, getPrimaryElement, getResource, getSchedulingRule, getUnderlyingResource, isReadOnly, isStructureKnownexists, getNameRange, getSource, getSourceRangecopy, delete, move, renamegetChildren, hasChildrengetAnnotationpublic ResolvedBinaryField(JavaElement parent, java.lang.String name, java.lang.String uniqueKey)
public java.lang.String getKey()
IFieldresolved.
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.
getKey in interface IFieldgetKey in class BinaryMemberIBinding.getKey(),
BindingKey,
IField.isResolved()public java.lang.String getKey(boolean forceOpen)
Binding.computeUniqueKey()public boolean isResolved()
IFieldisResolved in interface IFieldprotected void toStringInfo(int tab,
java.lang.StringBuffer buffer,
java.lang.Object info,
boolean showResolvedInfo)
JavaElementshowResolvedInfo - TODOpublic JavaElement unresolved()
unresolved in class JavaElementpublic 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 IAnnotation[] getAnnotations() throws JavaModelException
IAnnotatablegetAnnotations in interface IAnnotatablegetAnnotations in class SourceRefElementJavaModelException - if this element does not exist or if an
exception occurs while accessing its corresponding resource.public java.lang.Object getConstant()
throws JavaModelException
IFieldnull 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.
getConstant in interface IFieldnull if not availableJavaModelException - if this element does not exist or if an
exception occurs while accessing its corresponding resourcepublic int getFlags()
throws JavaModelException
IMemberFlags.
For binary members, flags from the class file
as well as derived flags Flags.AccAnnotationDefault and Flags.AccDefaultMethod are included.
For source members, only flags as indicated in the source are returned. Thus if an interface
defines a method void myMethod();, the flags don't include the
'public' flag. Source flags include Flags.AccAnnotationDefault as well.
public int getElementType()
IJavaElementgetElementType in interface IJavaElementIJavaElementIJavaElementprotected char getHandleMementoDelimiter()
JavaElementchar that marks the start of this handles
contribution to a memento.getHandleMementoDelimiter in class MemberJavaElement.getHandleMemento()public java.lang.String getTypeSignature()
throws JavaModelException
IField
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 IFieldJavaModelException - if this element does not exist or if an
exception occurs while accessing its corresponding resourceSignaturepublic boolean isEnumConstant()
throws JavaModelException
IFieldisEnumConstant in interface IFieldJavaModelException - if this element does not exist or if an
exception occurs while accessing its corresponding resourcepublic JavaElement resolved(Binding binding)
resolved in class JavaElementpublic java.lang.String getAttachedJavadoc(IProgressMonitor monitor)
throws JavaModelException
IJavaElementReturns the Javadoc as HTML source if this element has attached Javadoc,
null otherwise.
This should be used only for binary elements. Source elements will always return null.
The encoding used to read the Javadoc is the one defined by the content type of the file. If none is defined, then the project's encoding of this Java element is used. If the project's encoding cannot be retrieved, then the platform encoding is used.
In case the Javadoc doesn't exist for this element, null is returned.
The HTML is extracted from the attached Javadoc and provided as is. No transformation or validation is done.
getAttachedJavadoc in interface IJavaElementgetAttachedJavadoc in class JavaElementmonitor - the given progress monitor, can be nullnull if noneJavaModelException - if:IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME