Interface SignatureAttribute

All Superinterfaces:
Attribute<SignatureAttribute>, ClassElement, ClassFileElement, FieldElement, MethodElement

public sealed interface SignatureAttribute extends Attribute<SignatureAttribute>, ClassElement, MethodElement, FieldElement
Models the Signature attribute (JVMS 4.7.9), which can appear on classes, methods, or fields. Delivered as a ClassElement, FieldElement, or MethodElement 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:
24
  • Method Details

    • signature

      Utf8Entry signature()
      Returns the signature for the class, method, or field.
      Returns:
      the signature for the class, method, or field
    • asClassSignature

      default ClassSignature asClassSignature()
      Parse the signature as a class signature.
      Returns:
      the class signature
    • asMethodSignature

      default MethodSignature asMethodSignature()
      Parse the signature as a method signature.
      Returns:
      the method signature
    • asTypeSignature

      default Signature asTypeSignature()
      Parse the signature as a type signature.
      Returns:
      the type signature
    • of

      static SignatureAttribute of(ClassSignature classSignature)
      Returns a Signature attribute for a class.
      Parameters:
      classSignature - the signature
      Returns:
      a Signature attribute for a class
    • of

      static SignatureAttribute of(MethodSignature methodSignature)
      Returns a Signature attribute for a method.
      Parameters:
      methodSignature - the signature
      Returns:
      a Signature attribute for a method
    • of

      static SignatureAttribute of(Signature signature)
      Returns a Signature attribute.
      Parameters:
      signature - the signature
      Returns:
      a Signature attribute
    • of

      static SignatureAttribute of(Utf8Entry signature)
      Returns a Signature attribute.
      Parameters:
      signature - the signature
      Returns:
      a Signature attribute