|
||||||||||
PREV CLASS (src) NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.bcel.classfile.Utility org.jboss.proxy.compiler.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.
Class.getName()
,
Serialized FormConstructor 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 |
public Utility()
Method Detail |
public static Type getType(java.lang.Class clazz)
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;
clazz
- a Class
value
Type
valueUtility
(src) public static Type[] getTypes(java.lang.Class[] classes)
org.apache.bcel.generic.Type
for an array of Classes
classes
- a Class[]
value
Type[]
valuepublic static java.lang.String getObjectEquivalentClassName(BasicType t)
e.g int <-> java.lang.Integer char <-> Character
t
- a BasicType
value
String
value
java.lang.IllegalArgumentException
- Unexpected type
|
||||||||||
PREV CLASS (src) NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |