Interface FieldModel
- All Superinterfaces:
AttributedElementPREVIEW,ClassElementPREVIEW,ClassFileElementPREVIEW,CompoundElementPREVIEW<FieldElementPREVIEW>,Iterable<FieldElementPREVIEW>
public sealed interface FieldModel
extends CompoundElementPREVIEW<FieldElementPREVIEW>, AttributedElementPREVIEW, ClassElementPREVIEW
FieldModel is a preview API of the Java platform.
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 Summary
Modifier and TypeMethodDescriptionReturns the name of this field.Returns the field descriptor of this field.default ClassDescReturns the field descriptor of this field, as a symbolic descriptor.flags()Returns the access flags.parent()Returns the class model this field is a member of, if known.Methods declared in interface java.lang.classfile.AttributedElementPREVIEW
attributes, findAttribute, findAttributesMethods declared in interface java.lang.classfile.CompoundElementPREVIEW
elementList, elementStream, forEach, iteratorMethods declared in interface java.lang.Iterable
spliterator
-
Method Details
-
flags
-
parent
Optional<ClassModelPREVIEW> 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
-
fieldType
-
fieldTypeSymbol
Returns the field descriptor of this field, as a symbolic descriptor.- Returns:
- the field descriptor of this field, as a symbolic descriptor
-
FieldModelwhen preview features are enabled.