Class SignatureUtils

java.lang.Object
io.micronaut.sourcegen.bytecode.core.SignatureUtils

@Internal public final class SignatureUtils extends Object
JVM generic-signature operations shared by bytecode writers.

The result is the standard JVMS signature string. Keeping this operation independent of a bytecode library lets the ASM and JDK ClassFile backends use exactly the same generic metadata.

Since:
2.2
  • Method Details

    • getFieldSignature

      public static @Nullable String getFieldSignature(@Nullable ObjectDef objectDef, FieldDef fieldDef)
      Parameters:
      objectDef - The contextual object, if any
      fieldDef - The field
      Returns:
      The field signature, or null when its descriptor is sufficient
    • getClassSignature

      public static String getClassSignature(ClassDef classDef)
      Parameters:
      classDef - The class
      Returns:
      The class signature
    • getRecordSignature

      public static String getRecordSignature(RecordDef recordDef)
      Parameters:
      recordDef - The record
      Returns:
      The record signature
    • getInterfaceSignature

      public static @Nullable String getInterfaceSignature(InterfaceDef interfaceDef)
      Parameters:
      interfaceDef - The interface
      Returns:
      The interface signature, or null when no generic metadata is needed
    • getMethodSignature

      public static @Nullable String getMethodSignature(@Nullable ObjectDef objectDef, MethodDef methodDef)
      Parameters:
      objectDef - The contextual object, if any
      methodDef - The method
      Returns:
      The method signature, or null when its descriptor is sufficient