Interface FieldModel

All Superinterfaces:
AttributedElementPREVIEW, ClassElementPREVIEW, ClassFileElementPREVIEW, CompoundElementPREVIEW<FieldElementPREVIEW>, Iterable<FieldElementPREVIEW>

FieldModel is a preview API of the Java platform.
Programs can only use FieldModel when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Models a field. The contents of the field can be traversed via a streaming view, or via random access (e.g., flags()), or by freely mixing the two.
Since:
22
  • Method Details

    • flags

      Returns the access flags.
      Returns:
      the access flags
    • parent

      Returns the class model this field is a member of, if known.
      Returns:
      the class model this field is a member of, if known
    • fieldName

      Utf8EntryPREVIEW fieldName()
      Returns the name of this field.
      Returns:
      the name of this field
    • fieldType

      Utf8EntryPREVIEW fieldType()
      Returns the field descriptor of this field.
      Returns:
      the field descriptor of this field
    • fieldTypeSymbol

      default ClassDesc fieldTypeSymbol()
      Returns the field descriptor of this field, as a symbolic descriptor.
      Returns:
      the field descriptor of this field, as a symbolic descriptor