Class SignaturePrinter

java.lang.Object
org.spongepowered.asm.util.SignaturePrinter

public class SignaturePrinter extends Object
Generates callback signature for callback pretty-print
  • Constructor Details

    • SignaturePrinter

      public SignaturePrinter(org.objectweb.asm.tree.MethodNode method)
    • SignaturePrinter

      public SignaturePrinter(org.objectweb.asm.tree.MethodNode method, String[] argNames)
    • SignaturePrinter

      public SignaturePrinter(ITargetSelectorByName member)
    • SignaturePrinter

      public SignaturePrinter(String name, String desc)
    • SignaturePrinter

      public SignaturePrinter(org.objectweb.asm.Type[] args)
    • SignaturePrinter

      public SignaturePrinter(org.objectweb.asm.Type returnType, org.objectweb.asm.Type[] args)
    • SignaturePrinter

      public SignaturePrinter(String name, org.objectweb.asm.Type returnType, org.objectweb.asm.Type[] args)
    • SignaturePrinter

      public SignaturePrinter(String name, org.objectweb.asm.Type returnType, org.objectweb.asm.tree.LocalVariableNode[] args)
    • SignaturePrinter

      public SignaturePrinter(String name, org.objectweb.asm.Type returnType, org.objectweb.asm.Type[] argTypes, String[] argNames)
  • Method Details

    • getFormattedArgs

      public String getFormattedArgs()
      Return only the arguments portion of this signature as a Java-style block
    • getReturnType

      public String getReturnType()
      Get string representation of this signature's return type
    • setModifiers

      public void setModifiers(org.objectweb.asm.tree.MethodNode method)
      Set modifiers on this signature using the supplied method node
      Parameters:
      method - method node to read modifiers from
    • setModifiers

      public SignaturePrinter setModifiers(String modifiers)
      Set modifiers on this signature explicitly. Use the special token ${returnType} to insert the return type into the modifier string.
      Parameters:
      modifiers - modifiers to prepend
      Returns:
      fluent interface
    • setFullyQualified

      public SignaturePrinter setFullyQualified(boolean fullyQualified)
      Set whether this signature generates fully-qualified class output, mainly used when generating signatures for Mirror
      Parameters:
      fullyQualified - new value for fully-qualified
      Returns:
      fluent interface
    • isFullyQualified

      public boolean isFullyQualified()
      Get whether this printer will fully-qualify class names in generated signatures
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toDescriptor

      public String toDescriptor()
      Return this signature in descriptor format (return type after args)
    • getTypeName

      public static String getTypeName(org.objectweb.asm.Type type)
      Get the source code name for the specified type
      Parameters:
      type - Type to generate a friendly name for
      Returns:
      String representation of the specified type, eg "int" for an integer primitive or "String" for java.lang.String
    • getTypeName

      public static String getTypeName(org.objectweb.asm.Type type, boolean box)
      Get the source code name for the specified type
      Parameters:
      type - Type to generate a friendly name for
      box - True to return the equivalent boxing type for primitives
      Returns:
      String representation of the specified type, eg "int" for an integer primitive or "String" for java.lang.String
    • getTypeName

      public static String getTypeName(org.objectweb.asm.Type type, boolean box, boolean fullyQualified)
      Get the source code name for the specified type
      Parameters:
      type - Type to generate a friendly name for
      box - True to return the equivalent boxing type for primitives
      fullyQualified - fully-qualify class names
      Returns:
      String representation of the specified type, eg "int" for an integer primitive or "String" for java.lang.String