Class CustomAttribute<T extends CustomAttributePREVIEW<T>>
java.lang.Object
java.lang.classfile.CustomAttribute<T>
- Type Parameters:
T- the custom attribute type
- All Implemented Interfaces:
AttributePREVIEW<T>,ClassElementPREVIEW,ClassFileElementPREVIEW,CodeElementPREVIEW,FieldElementPREVIEW,MethodElementPREVIEW
public abstract non-sealed class CustomAttribute<T extends CustomAttributePREVIEW<T>>
extends Object
implements AttributePREVIEW<T>, CodeElementPREVIEW, ClassElementPREVIEW, MethodElementPREVIEW, FieldElementPREVIEW
CustomAttribute 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 non-standard attribute of a classfile. Clients should extend
this class to provide an implementation class for non-standard attributes,
and provide an
AttributeMapperPREVIEW to mediate between the classfile
format and the CustomAttribute representation.- Since:
- 22
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCustomAttribute(AttributeMapperPREVIEW<T> mapper) Construct a CustomAttribute. -
Method Summary
Modifier and TypeMethodDescriptionfinal AttributeMapperPREVIEW<T> Returns theAttributeMapperPREVIEW associated with this attribute.final StringReturns the name of the attribute.
-
Constructor Details
-
CustomAttribute
Construct a CustomAttribute.- Parameters:
mapper- the attribute mapper
-
-
Method Details
-
attributeMapper
Description copied from interface:AttributeReturns theAttributeMapperPREVIEW associated with this attribute.- Specified by:
attributeMapperin interfaceAttributePREVIEW<T extends CustomAttributePREVIEW<T>>- Returns:
- the
AttributeMapperPREVIEW associated with this attribute
-
attributeName
Description copied from interface:AttributeReturns the name of the attribute.- Specified by:
attributeNamein interfaceAttributePREVIEW<T extends CustomAttributePREVIEW<T>>- Returns:
- the name of the attribute
-
CustomAttributewhen preview features are enabled.