org.jcoderz.commons.tracing
Class AsmUtil

java.lang.Object
  extended by org.jcoderz.commons.tracing.AsmUtil

public final class AsmUtil
extends Object

Utility classes around the ASM package. See http://asm.objectweb.org/

Author:
Andreas Mandel

Field Summary
static int MAX_BIPUSH
          Maximum value that can be set using the Opcodes.BIPUSH.
static int MAX_ICONST
          Maximum value that can be set using the Opcodes.ICONST_0.
static int MAX_SIPUSH
          Maximum value that can be set using the Opcodes.SIPUSH.
 
Method Summary
static void loadConstant(InsnList cmd, int i)
          Add a command to the stack that loads the given integer constant.
static String toString(ClassNode classNode)
          Human readable name of the class.
static String toString(ClassNode cn, MethodNode mn)
          Human readable name of the method.
static String toString(int access)
          Returns a string representation containing the access keywords implied by the given int.
static String toString(LocalVariableNode node)
          Human readable name of the local variable.
static String toString(MethodNode mn)
          To string helper to get nice comments about the MethodNode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_ICONST

public static final int MAX_ICONST
Maximum value that can be set using the Opcodes.ICONST_0.

See Also:
Constant Field Values

MAX_BIPUSH

public static final int MAX_BIPUSH
Maximum value that can be set using the Opcodes.BIPUSH.

See Also:
Constant Field Values

MAX_SIPUSH

public static final int MAX_SIPUSH
Maximum value that can be set using the Opcodes.SIPUSH.

See Also:
Constant Field Values
Method Detail

loadConstant

public static void loadConstant(InsnList cmd,
                                int i)
Add a command to the stack that loads the given integer constant. The method takes care to use the most efficient opcode.

Parameters:
cmd - the command list where to add the command.
i - the value to be loaded.

toString

public static String toString(MethodNode mn)
To string helper to get nice comments about the MethodNode.

Parameters:
mn - the method node.
Returns:
a human readable string representation describing the method node

toString

public static String toString(ClassNode classNode)
Human readable name of the class.

Parameters:
classNode - the asm class node.
Returns:
Human readable name of the class.

toString

public static String toString(ClassNode cn,
                              MethodNode mn)
Human readable name of the method.

Parameters:
cn - the asm class node.
mn - the asm method node.
Returns:
Human readable name of the class and method.

toString

public static String toString(LocalVariableNode node)
Human readable name of the local variable.

Parameters:
node - the asm local variable node.
Returns:
Human readable name of the local variable.

toString

public static String toString(int access)
Returns a string representation containing the access keywords implied by the given int. See Opcodes ACC* for the values.

Parameters:
access - the int value holding the access bits. See Opcodes ACC* for the values.
Returns:
a string representation containing the access keywords implied by the given int.


Copyright 2007 The jCoderZ Project.