- All Superinterfaces:
AttributedElement,ClassElement,ClassFileElement,CompoundElement<FieldElement>,Iterable<FieldElement>,WritableElement<FieldModel>
- All Known Implementing Classes:
BufferedFieldBuilder.Model,FieldImpl
public sealed interface FieldModel
extends WritableElement<FieldModel>, CompoundElement<FieldElement>, AttributedElement, ClassElement
permits BufferedFieldBuilder.Model, FieldImpl
Models a field. The contents of the field can be traversed via
a streaming view (e.g.,
CompoundElement.elements()), 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 inherited from interface org.glavo.classfile.AttributedElement
attributes, findAttribute, findAttributesMethods inherited from interface org.glavo.classfile.CompoundElement
elementList, elements, elementStream, forEachElement, iteratorMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.glavo.classfile.WritableElement
writeTo
-
Method Details
-
flags
AccessFlags flags()Returns the access flags.- Returns:
- the access flags
-
parent
Optional<ClassModel> 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
Utf8Entry fieldName()Returns the name of this field.- Returns:
- the name of this field
-
fieldType
Utf8Entry fieldType()Returns the field descriptor of this field.- Returns:
- the field descriptor of this field
-
fieldTypeSymbol
Returns the field descriptor of this field, as a symbolic descriptor.- Returns:
- the field descriptor of this field, as a symbolic descriptor
-