Interface SignatureAttribute
- All Superinterfaces:
AttributePREVIEW<SignatureAttributePREVIEW>
,ClassElementPREVIEW
,ClassFileElementPREVIEW
,FieldElementPREVIEW
,MethodElementPREVIEW
,WritableElementPREVIEW<SignatureAttributePREVIEW>
public sealed interface SignatureAttribute
extends AttributePREVIEW<SignatureAttributePREVIEW>, ClassElementPREVIEW, MethodElementPREVIEW, FieldElementPREVIEW
SignatureAttribute
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 the
Signature
attribute 4.7.9, which
can appear on classes, methods, or fields. Delivered as a
ClassElement
PREVIEW, FieldElement
PREVIEW, or
MethodElement
PREVIEW when traversing
the corresponding model type.
The attribute does not permit multiple instances in a given location. Subsequent occurrence of the attribute takes precedence during the attributed element build or transformation.
The attribute was introduced in the Java SE Platform version 5.0.
- Since:
- 22
-
Method Summary
Modifier and TypeMethodDescriptiondefault ClassSignaturePREVIEW
Parse the signature as a class signature.default MethodSignaturePREVIEW
Parse the signature as a method signature.Parse the signature as a type signature.static SignatureAttributePREVIEW
of
(ClassSignaturePREVIEW classSignature) Returns aSignature
attribute for a class.static SignatureAttributePREVIEW
Returns aSignature
attribute.static SignatureAttributePREVIEW
of
(MethodSignaturePREVIEW methodSignature) Returns aSignature
attribute for a method.static SignatureAttributePREVIEW
Returns aSignature
attribute.Returns the signature for the class, method, or field.Methods declared in interface java.lang.classfile.AttributePREVIEW
attributeMapper, attributeName
Methods declared in interface java.lang.classfile.WritableElementPREVIEW
writeTo
-
Method Details
-
signature
-
asClassSignature
Parse the signature as a class signature.- Returns:
- the class signature
-
asMethodSignature
Parse the signature as a method signature.- Returns:
- the method signature
-
asTypeSignature
-
of
Returns aSignature
attribute for a class.- Parameters:
classSignature
- the signature- Returns:
- a
Signature
attribute for a class
-
of
Returns aSignature
attribute for a method.- Parameters:
methodSignature
- the signature- Returns:
- a
Signature
attribute for a method
-
of
Returns aSignature
attribute.- Parameters:
signature
- the signature- Returns:
- a
Signature
attribute
-
of
Returns aSignature
attribute.- Parameters:
signature
- the signature- Returns:
- a
Signature
attribute
-
SignatureAttribute
when preview features are enabled.