站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 server API Documentation 英文版文档

Utility (JBoss Server API) - JBoss 4.0.1 sp1 server API Documentation 英文版文档


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.

Version:
$Revision: 1.2 $
Author:
Neale Swinnerton, Jason Dillon
See Also:
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

Utility

public Utility()
Method Detail

getType

public static org.apache.bcel.generic.Type getType(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

getTypes

public static org.apache.bcel.generic.Type[] getTypes(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 String getObjectEquivalentClassName(org.apache.bcel.generic.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:
IllegalArgumentException - Unexpected type


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.