org.curjent.impl.asm
Class Type

java.lang.Object
  extended by org.curjent.impl.asm.Type

public final class Type
extends Object

A Java type. This class can be used to make it easier to manipulate type and method descriptors.

Author:
Eric Bruneton, Chris Nokleberg

Constructor Summary
Type()
           
 
Method Summary
static String getDescriptor(Class<?> c)
          Returns the descriptor corresponding to the given Java type.
private static void getDescriptor(StringBuffer buf, Class<?> c)
          Appends the descriptor of the given class to the given string buffer.
static String getInternalName(Class<?> c)
          Returns the internal name of the given class.
static String getMethodDescriptor(Method m)
          Returns the descriptor corresponding to the given method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Type

public Type()
Method Detail

getInternalName

public static String getInternalName(Class<?> c)
Returns the internal name of the given class. The internal name of a class is its fully qualified name, as returned by Class.getName(), where '.' are replaced by '/'.

Parameters:
c - an object or array class.
Returns:
the internal name of the given class.

getDescriptor

public static String getDescriptor(Class<?> c)
Returns the descriptor corresponding to the given Java type.

Parameters:
c - an object class, a primitive class or an array class.
Returns:
the descriptor corresponding to the given class.

getMethodDescriptor

public static String getMethodDescriptor(Method m)
Returns the descriptor corresponding to the given method.

Parameters:
m - a { @link Method Method} object.
Returns:
the descriptor of the given method.

getDescriptor

private static void getDescriptor(StringBuffer buf,
                                  Class<?> c)
Appends the descriptor of the given class to the given string buffer.

Parameters:
buf - the string buffer to which the descriptor must be appended.
c - the class whose descriptor must be computed.


Copyright 2009-2011 Tom Landon
Apache License 2.0