Class ResolvedBinaryField

All Implemented Interfaces:
IAnnotatable, IField, IJavaElement, IMember, IParent, ISourceManipulation, ISourceReference, org.eclipse.core.runtime.IAdaptable

public class ResolvedBinaryField extends BinaryMember
Handle representing a binary field that is resolved. The uniqueKey contains the genericSignature of the resolved field. Use BindingKey to decode it.
  • Constructor Details

  • Method Details

    • getKey

      public String getKey()
      Description copied from interface: IField
      Returns the binding key for this field only if the given field is resolved. 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 interface IField
      Overrides:
      getKey in class BinaryMember
      Returns:
      the binding key for this field
      See Also:
    • getKey

      public String getKey(boolean forceOpen)
      See Also:
      • invalid reference
        org.eclipse.jdt.internal.compiler.lookup.Binding#computeUniqueKey()
    • 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 interface IField
      Returns:
      whether this field represents a resolved field.
    • toStringInfo

      protected void toStringInfo(int tab, StringBuilder buffer, Object info, boolean showResolvedInfo)
      Description copied from class: JavaElement
      Debugging purposes
      Parameters:
      showResolvedInfo - TODO
    • unresolved

      public org.aspectj.org.eclipse.jdt.internal.core.BinaryField unresolved()
      Overrides:
      unresolved in class JavaElement
    • equals

      public boolean equals(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:
    • getAnnotations

      public IAnnotation[] getAnnotations() throws JavaModelException
      Description copied from interface: IAnnotatable
      Returns the annotations for this element. Returns an empty array if this element has no annotations.
      Specified by:
      getAnnotations in interface IAnnotatable
      Overrides:
      getAnnotations in class SourceRefElement
      Returns:
      the annotations of this element, in the order declared in the source, or an empty array if none
      Throws:
      JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.
    • getConstant

      public Object getConstant() throws JavaModelException
      Description copied from interface: IField
      Returns the constant value associated with this field or null 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 interface IField
      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
    • getFlags

      public int getFlags() throws JavaModelException
      Description copied from interface: IMember
      Returns the modifier flags for this member. The flags can be examined using class Flags.

      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.

      Specified by:
      getFlags in interface IMember
      Overrides:
      getFlags in class Member
      Returns:
      the modifier flags for this member
      Throws:
      JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.
      See Also:
    • 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:
    • getHandleMementoDelimiter

      protected char getHandleMementoDelimiter()
      Description copied from class: JavaElement
      Returns the char that marks the start of this handles contribution to a memento.
      Overrides:
      getHandleMementoDelimiter in class Member
      See Also:
    • getTypeSignature

      public String getTypeSignature() throws JavaModelException
      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 interface IField
      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:
    • isEnumConstant

      public boolean isEnumConstant() throws JavaModelException
      Description copied from interface: IField
      Returns whether this field represents an enum constant.
      Specified by:
      isEnumConstant in interface IField
      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
    • resolved

      public JavaElement resolved(Binding binding)
      Overrides:
      resolved in class JavaElement
    • getAttachedJavadoc

      public String getAttachedJavadoc(org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
      Description copied from interface: IJavaElement

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

      Specified by:
      getAttachedJavadoc in interface IJavaElement
      Overrides:
      getAttachedJavadoc in class JavaElement
      Parameters:
      monitor - the given progress monitor, can be null
      Returns:
      the extracted javadoc from the attached javadoc, null if none
      Throws:
      JavaModelException - if:
      • this element does not exist
      • retrieving the attached javadoc fails (timed-out, invalid URL, ...)
      • the format of the javadoc doesn't match expected standards (different anchors,...)
      See Also:
    • isRecordComponent

      public boolean isRecordComponent() throws JavaModelException
      Description copied from interface: IField
      Returns whether this field represents a record component.
      Specified by:
      isRecordComponent in interface IField
      Returns:
      whether this field represents a record component.
      Throws:
      JavaModelException