jodd.asm
Class AsmUtil

java.lang.Object
  extended by jodd.asm.AsmUtil

public class AsmUtil
extends java.lang.Object

Generic ASM utils.


Constructor Summary
AsmUtil()
           
 
Method Summary
static java.lang.Class loadBaseTypeClass(java.lang.String desc)
          Loads base class type.
static java.lang.String typedesc2ClassName(java.lang.String desc)
          Converts bytecode-like description to java class name that can be loaded with a classloader.
static java.lang.String typedescToSignature(java.lang.String desc)
          Returns java-like signature of a bytecode-like description.
static java.lang.String typedescToSignature(java.lang.String desc, jodd.mutable.MutableInteger from)
          Returns java-like signature of a bytecode-like description.
static java.lang.String typeref2Name(java.lang.String desc)
          Converts type reference to java-name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsmUtil

public AsmUtil()
Method Detail

typedesc2ClassName

public static java.lang.String typedesc2ClassName(java.lang.String desc)
Converts bytecode-like description to java class name that can be loaded with a classloader. Uses less-known feature of class loaders for loading array classes. For base types returns the one-letter string that can be used with loadBaseTypeClass(String).

See Also:
typedescToSignature(String, jodd.mutable.MutableInteger)

typeref2Name

public static java.lang.String typeref2Name(java.lang.String desc)
Converts type reference to java-name.


loadBaseTypeClass

public static java.lang.Class loadBaseTypeClass(java.lang.String desc)
                                         throws java.lang.ClassNotFoundException
Loads base class type.

Throws:
java.lang.ClassNotFoundException

typedescToSignature

public static java.lang.String typedescToSignature(java.lang.String desc)
Returns java-like signature of a bytecode-like description.

See Also:
typedescToSignature(String, jodd.mutable.MutableInteger)

typedescToSignature

public static java.lang.String typedescToSignature(java.lang.String desc,
                                                   jodd.mutable.MutableInteger from)
Returns java-like signature of a bytecode-like description. Only first description is parsed. The field signature represents the value of an argument to a function or the value of a variable. It is a series of bytes generated by the following grammar:
  ::= 
       ::= ||
        ::= B|C|D|F|I|J|S|Z
      ::= L;
       ::= [

 The meaning of the base types is as follows:
 B byte signed byte
 C char character
 D double double precision IEEE float
 F float single precision IEEE float
 I int integer
 J long long integer
 L; ... an object of the given class
 S short signed short
 Z boolean true or false
 [ ... array
 
This method converts this string into a Java type declaration such as String[].



Copyright © 2003-2012 Jodd Team