Module java.base
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
,WritableElementPREVIEW<T>
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
AttributeMapper
PREVIEW to mediate between the classfile
format and the CustomAttributePREVIEW representation.- Since:
- 22
-
Constructor Summary
ModifierConstructorDescriptionprotected
CustomAttribute
(AttributeMapperPREVIEW<T> mapper) Construct a CustomAttributePREVIEW. -
Method Summary
Modifier and TypeMethodDescriptionfinal AttributeMapperPREVIEW
<T> Returns theAttributeMapper
PREVIEW associated with this attribute.final String
Returns the name of the attribute.final void
Writes the element to the specified writer
-
Constructor Details
-
CustomAttribute
Construct a CustomAttributePREVIEW.- Parameters:
mapper
- the attribute mapper
-
-
Method Details
-
attributeMapper
Description copied from interface:Attribute
Returns theAttributeMapper
PREVIEW associated with this attribute.- Specified by:
attributeMapper
in interfaceAttributePREVIEW<T extends CustomAttributePREVIEW<T>>
- Returns:
- the
AttributeMapper
PREVIEW associated with this attribute
-
attributeName
Description copied from interface:Attribute
Returns the name of the attribute.- Specified by:
attributeName
in interfaceAttributePREVIEW<T extends CustomAttributePREVIEW<T>>
- Returns:
- the name of the attribute
-
writeTo
Description copied from interface:WritableElement
Writes the element to the specified writer- Specified by:
writeTo
in interfaceWritableElementPREVIEW<T extends CustomAttributePREVIEW<T>>
- Parameters:
buf
- the writer
-
CustomAttribute
when preview features are enabled.