org.jboss.proxy.compiler
Class Utility

java.lang.Object
  extended byorg.apache.bcel.classfile.Utility
      extended byorg.jboss.proxy.compiler.Utility

public abstract class Utility
extends org.apache.bcel.classfile.Utility

Some Routines to convert from java.lang.Class to org.apache.bcel.generic.Type. These get round some inconsistencies with Class.getName() wrt primitives.

 e.g. 

  Character.Type.getName() returns char.

 

I think it should return C. Don't know if this is a code bug. But there's a bug on Bug Parade (#4369208) about the javadoc being misleading.

See Also:
Class.getName(), Serialized Form

Constructor Summary
Utility()
           
 
Method Summary
static java.lang.String getObjectEquivalentClassName(BasicType t)
          Get the Object equivalent Class name for a primitive
static Type getType(java.lang.Class clazz)
          Get the org.apache.bcel.generic.Type for a class.
static Type[] getTypes(java.lang.Class[] classes)
          Get the org.apache.bcel.generic.Type for an array of Classes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utility

public Utility()
Method Detail

getType

public static Type getType(java.lang.Class clazz)
Get the org.apache.bcel.generic.Type for a class. This handles the case where the class represents an n-dimensional array by relying on the fact that Class.getName() on an array returns the signature
 e.g.

   new Object[].getClass().getName() returns [Ljava.lang.Object;

 

Parameters:
clazz - a Class value
Returns:
a Type value
See Also:
Utility (src)

getTypes

public static Type[] getTypes(java.lang.Class[] classes)
Get the org.apache.bcel.generic.Type for an array of Classes

Parameters:
classes - a Class[] value
Returns:
a Type[] value

getObjectEquivalentClassName

public static java.lang.String getObjectEquivalentClassName(BasicType t)
Get the Object equivalent Class name for a primitive
 e.g

   int   <-> java.lang.Integer
   char  <-> Character

 

Parameters:
t - a BasicType value
Returns:
a String value
Throws:
java.lang.IllegalArgumentException - Unexpected type