Package org.spongepowered.asm.util
Class SignaturePrinter
- java.lang.Object
-
- org.spongepowered.asm.util.SignaturePrinter
-
public class SignaturePrinter extends java.lang.ObjectGenerates 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetFormattedArgs()Return only the arguments portion of this signature as a Java-style blockjava.lang.StringgetReturnType()Get string representation of this signature's return typestatic java.lang.StringgetTypeName(org.objectweb.asm.Type type)Get the source code name for the specified typestatic java.lang.StringgetTypeName(org.objectweb.asm.Type type, boolean box)Get the source code name for the specified typestatic java.lang.StringgetTypeName(org.objectweb.asm.Type type, boolean box, boolean fullyQualified)Get the source code name for the specified typebooleanisFullyQualified()Get whether this printer will fully-qualify class names in generated signaturesSignaturePrintersetFullyQualified(boolean fullyQualified)Set whether this signature generates fully-qualified class output, mainly used when generating signatures for MirrorSignaturePrintersetModifiers(java.lang.String modifiers)Set modifiers on this signature explicitly.voidsetModifiers(org.objectweb.asm.tree.MethodNode method)Set modifiers on this signature using the supplied method nodejava.lang.StringtoDescriptor()Return this signature in descriptor format (return type after args)java.lang.StringtoString()
-
-
-
Constructor Detail
-
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 Detail
-
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:
toStringin classjava.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 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
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 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
-
-