Klasse SourceField

Alle implementierten Schnittstellen:
IAnnotatable, IField, IJavaElement, IMember, IParent, ISourceManipulation, ISourceReference, org.eclipse.core.runtime.IAdaptable
Bekannte direkte Unterklassen:
ResolvedSourceField

public class SourceField extends NamedMember implements IField
Siehe auch:
  • Konstruktordetails

    • SourceField

      protected SourceField(JavaElement parent, String name)
      Constructs a handle to the field with the given name in the specified type.
  • Methodendetails

    • equals

      public boolean equals(Object o)
      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 Klasse SourceRefElement
      Siehe auch:
    • findNode

      public ASTNode findNode(CompilationUnit ast)
      Beschreibung aus Klasse kopiert: SourceRefElement
      Returns the ASTNode that corresponds to this JavaElement or null if there is no corresponding node.
      Setzt außer Kraft:
      findNode in Klasse SourceRefElement
    • getConstant

      public Object getConstant() throws JavaModelException
      Beschreibung aus Schnittstelle kopiert: 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.

      Angegeben von:
      getConstant in Schnittstelle IField
      Gibt zurück:
      the constant value associated with this field, or null if not available
      Löst aus:
      JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource
      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 Schnittstelle IJavaElement
      Gibt zurück:
      the kind of element; one of the constants declared in IJavaElement
      Siehe auch:
    • getKey

      public String getKey()
      Beschreibung aus Schnittstelle kopiert: 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.

      Angegeben von:
      getKey in Schnittstelle IField
      Gibt zurück:
      the binding key for this field
      Siehe auch:
    • getHandleMementoDelimiter

      protected char getHandleMementoDelimiter()
      Beschreibung aus Klasse kopiert: JavaElement
      Returns the char that marks the start of this handles contribution to a memento.
      Setzt außer Kraft:
      getHandleMementoDelimiter in Klasse Member
      Siehe auch:
    • getPrimaryElement

      public JavaElement getPrimaryElement(boolean checkOwner)
      Setzt außer Kraft:
      getPrimaryElement in Klasse JavaElement
    • getTypeSignature

      public String getTypeSignature() throws JavaModelException
      Beschreibung aus Schnittstelle kopiert: 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.

      Angegeben von:
      getTypeSignature in Schnittstelle IField
      Gibt zurück:
      the type signature of this field
      Löst aus:
      JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource
      Siehe auch:
    • isEnumConstant

      public boolean isEnumConstant() throws JavaModelException
      Beschreibung aus Schnittstelle kopiert: IField
      Returns whether this field represents an enum constant.
      Angegeben von:
      isEnumConstant in Schnittstelle IField
      Gibt zurück:
      whether this field represents an enum constant
      Löst aus:
      JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource
    • isResolved

      public boolean isResolved()
      Beschreibung aus Schnittstelle kopiert: IField
      Returns whether this field represents a resolved field. If a field is resolved, its key contains resolved information.
      Angegeben von:
      isResolved in Schnittstelle IField
      Gibt zurück:
      whether this field represents a resolved field.
    • resolved

      public JavaElement resolved(Binding binding)
      Setzt außer Kraft:
      resolved in Klasse JavaElement
    • toStringInfo

      protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo)
      Beschreibung aus Klasse kopiert: JavaElement
      Debugging purposes
      Setzt außer Kraft:
      toStringInfo in Klasse JavaElement
      Parameter:
      showResolvedInfo - TODO
    • isRecordComponent

      public boolean isRecordComponent() throws JavaModelException
      Beschreibung aus Schnittstelle kopiert: IField
      Returns whether this field represents a record component.
      Angegeben von:
      isRecordComponent in Schnittstelle IField
      Gibt zurück:
      whether this field represents a record component.
      Löst aus:
      JavaModelException