|
|||||||||||
PREV CLASS 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()
Constructor Summary | |
Utility()
|
Method Summary | |
static String |
getObjectEquivalentClassName(org.apache.bcel.generic.BasicType t)
Get the Object equivalent Class name for a primitive |
static org.apache.bcel.generic.Type |
getType(Class clazz)
Get the org.apache.bcel.generic.Type for a class. |
static org.apache.bcel.generic.Type[] |
getTypes(Class[] classes)
Get the org.apache.bcel.generic.Type for an array of Classes |
Methods inherited from class org.apache.bcel.classfile.Utility |
accessToString, accessToString, classOrInterface, clearBit, codeToString, codeToString, codeToString, codeToString, compactClassName, compactClassName, compactClassName, convertString, decode, encode, fillup, format, getSignature, isJavaIdentifierPart, isSet, methodSignatureArgumentTypes, methodSignatureArgumentTypes, methodSignatureReturnType, methodSignatureReturnType, methodSignatureToString, methodSignatureToString, methodSignatureToString, methodTypeToSignature, printArray, printArray, printArray, printArray, printArray, replace, searchOpcode, setBit, signatureToString, signatureToString, toHexString, typeOfMethodSignature, typeOfSignature |
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 org.apache.bcel.generic.Type getType(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
public static org.apache.bcel.generic.Type[] getTypes(Class[] classes)
org.apache.bcel.generic.Type
for an array of Classes
classes
- a Class[]
value
Type[]
valuepublic static String getObjectEquivalentClassName(org.apache.bcel.generic.BasicType t)
e.g int <-> java.lang.Integer char <-> Character
t
- a BasicType
value
String
value
IllegalArgumentException
- Unexpected type
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |