Class SignaturePrinter

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

public class SignaturePrinter
extends java.lang.Object
Generates callback signature for callback pretty-print
  • Constructor Summary

    Constructors
    Constructor Description
    SignaturePrinter​(java.lang.String name, java.lang.String desc)  
    SignaturePrinter​(java.lang.String name, org.objectweb.asm.Type returnType, org.objectweb.asm.tree.LocalVariableNode[] args)  
    SignaturePrinter​(java.lang.String name, org.objectweb.asm.Type returnType, org.objectweb.asm.Type[] args)  
    SignaturePrinter​(java.lang.String name, org.objectweb.asm.Type returnType, org.objectweb.asm.Type[] argTypes, java.lang.String[] argNames)  
    SignaturePrinter​(org.objectweb.asm.tree.MethodNode method)  
    SignaturePrinter​(org.objectweb.asm.tree.MethodNode method, java.lang.String[] argNames)  
    SignaturePrinter​(org.objectweb.asm.Type[] args)  
    SignaturePrinter​(org.objectweb.asm.Type returnType, org.objectweb.asm.Type[] args)  
    SignaturePrinter​(ITargetSelectorByName member)  
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getFormattedArgs()
    Return only the arguments portion of this signature as a Java-style block
    java.lang.String getReturnType()
    Get string representation of this signature's return type
    static java.lang.String getTypeName​(org.objectweb.asm.Type type)
    Get the source code name for the specified type
    static java.lang.String getTypeName​(org.objectweb.asm.Type type, boolean box)
    Get the source code name for the specified type
    static java.lang.String getTypeName​(org.objectweb.asm.Type type, boolean box, boolean fullyQualified)
    Get the source code name for the specified type
    boolean isFullyQualified()
    Get whether this printer will fully-qualify class names in generated signatures
    SignaturePrinter setFullyQualified​(boolean fullyQualified)
    Set whether this signature generates fully-qualified class output, mainly used when generating signatures for Mirror
    SignaturePrinter setModifiers​(java.lang.String modifiers)
    Set modifiers on this signature explicitly.
    void setModifiers​(org.objectweb.asm.tree.MethodNode method)
    Set modifiers on this signature using the supplied method node
    java.lang.String toDescriptor()
    Return this signature in descriptor format (return type after args)
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SignaturePrinter

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

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

      public SignaturePrinter​(ITargetSelectorByName member)
    • SignaturePrinter

      public SignaturePrinter​(java.lang.String name, java.lang.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​(java.lang.String name, org.objectweb.asm.Type returnType, org.objectweb.asm.Type[] args)
    • SignaturePrinter

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

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

    • getFormattedArgs

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

      public java.lang.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​(java.lang.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 java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • toDescriptor

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

      public static java.lang.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 java.lang.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 java.lang.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