Schnittstelle IField

Alle Superschnittstellen:
org.eclipse.core.runtime.IAdaptable, IAnnotatable, IJavaElement, IMember, IParent, ISourceManipulation, ISourceReference
Alle bekannten Implementierungsklassen:
AssistSourceField, ResolvedBinaryField, ResolvedSourceField, SourceField

public interface IField extends IMember, IAnnotatable
Represents a field declared in a type.
  • Methodendetails

    • getConstant

      Object getConstant() throws JavaModelException
      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.

      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
    • getElementName

      String getElementName()
      Returns the simple name of this field.
      Angegeben von:
      getElementName in Schnittstelle IJavaElement
      Gibt zurück:
      the simple name of this field.
    • getKey

      String getKey()
      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.

      Gibt zurück:
      the binding key for this field
      Seit:
      3.1
      Siehe auch:
    • getTypeSignature

      String getTypeSignature() throws JavaModelException
      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.

      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

      boolean isEnumConstant() throws JavaModelException
      Returns whether this field represents an enum constant.
      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
      Seit:
      3.1
    • isResolved

      boolean isResolved()
      Returns whether this field represents a resolved field. If a field is resolved, its key contains resolved information.
      Gibt zurück:
      whether this field represents a resolved field.
      Seit:
      3.1
    • isRecordComponent

      boolean isRecordComponent() throws JavaModelException
      Returns whether this field represents a record component.
      Gibt zurück:
      whether this field represents a record component.
      Löst aus:
      JavaModelException
      Seit:
      3.26