Package org.spongepowered.asm.util
Class SignaturePrinter
java.lang.Object
org.spongepowered.asm.util.SignaturePrinter
Generates callback signature for callback pretty-print
-
Constructor Summary
ConstructorsConstructorDescriptionSignaturePrinter(String name, String desc) SignaturePrinter(String name, org.objectweb.asm.Type returnType, org.objectweb.asm.tree.LocalVariableNode[] args) SignaturePrinter(String name, org.objectweb.asm.Type returnType, org.objectweb.asm.Type[] args) SignaturePrinter(String name, org.objectweb.asm.Type returnType, org.objectweb.asm.Type[] argTypes, String[] argNames) SignaturePrinter(org.objectweb.asm.tree.MethodNode method) SignaturePrinter(org.objectweb.asm.tree.MethodNode method, String[] argNames) SignaturePrinter(org.objectweb.asm.Type[] args) SignaturePrinter(org.objectweb.asm.Type returnType, org.objectweb.asm.Type[] args) -
Method Summary
Modifier and TypeMethodDescriptionReturn only the arguments portion of this signature as a Java-style blockGet string representation of this signature's return typestatic StringgetTypeName(org.objectweb.asm.Type type) Get the source code name for the specified typestatic StringgetTypeName(org.objectweb.asm.Type type, boolean box) Get the source code name for the specified typestatic StringgetTypeName(org.objectweb.asm.Type type, boolean box, boolean fullyQualified) Get the source code name for the specified typebooleanGet whether this printer will fully-qualify class names in generated signaturessetFullyQualified(boolean fullyQualified) Set whether this signature generates fully-qualified class output, mainly used when generating signatures for MirrorsetModifiers(String modifiers) Set modifiers on this signature explicitly.voidsetModifiers(org.objectweb.asm.tree.MethodNode method) Set modifiers on this signature using the supplied method nodeReturn this signature in descriptor format (return type after args)toString()
-
Constructor Details
-
SignaturePrinter
public SignaturePrinter(org.objectweb.asm.tree.MethodNode method) -
SignaturePrinter
-
SignaturePrinter
-
SignaturePrinter
-
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
-
-
Method Details
-
getFormattedArgs
Return only the arguments portion of this signature as a Java-style block -
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
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
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
-
toDescriptor
Return this signature in descriptor format (return type after args) -
getTypeName
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
Get the source code name for the specified type- Parameters:
type- Type to generate a friendly name forbox- 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
Get the source code name for the specified type- Parameters:
type- Type to generate a friendly name forbox- True to return the equivalent boxing type for primitivesfullyQualified- fully-qualify class names- Returns:
- String representation of the specified type, eg "int" for an integer primitive or "String" for java.lang.String
-