|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.deltax.util.SignatureAnalyzer
A class to analyze a Java method signature declaration, returning information on type names.
When returning information, the class may or may not consider primitive types, arrays, or both. If primitive types are returned, the returned type names may include char, boolean, etc. If arrays are considered, the returned type names may have [] qualifications.
Constructor Summary | |
SignatureAnalyzer(java.lang.String signature)
Create an analyzer for the given signature, which returns both primitive and array type names |
|
SignatureAnalyzer(java.lang.String signature,
boolean excludePrimitive,
boolean excludeArrays)
Create an analyzer for the given signature. |
Method Summary | |
int |
countParameters()
Return the number of (considered) parameters in the signature |
static char |
getInternalPrimitiveTypeDescriptor(java.lang.String javaType)
Return the internal type descriptor name for an java primitive type |
static java.lang.String |
getJavaPrimitiveTypeName(char primitiveTypeDescriptor)
Return the java name for an internal type descriptor of primitive type * @param primitiveTypeDescriptor the internal primitive type descriptor * @return the java name for an internal type descriptor of primitive type |
static java.lang.String |
getJavaTypeName(java.lang.Class cls)
|
static java.lang.String |
getJavaTypeName(java.lang.String typeDescriptor)
Return the java name for an internal type descriptor of primitive, array or object type * @param typeDescriptor the internal type descriptor * @return the externalized name for the type descriptor |
static java.lang.Class |
getPrimitiveTypeClass(java.lang.String javaPrimitiveTypeName)
|
java.lang.String |
getReturnTypeName()
Return name of the method's return type. |
static java.lang.Class |
getTypeClass(java.lang.String javaType)
|
boolean |
hasMoreParameters()
Return true if nextParameterTypeName() has more
parameters to return |
static boolean |
isPrimitiveTypeName(java.lang.String javaTypeName)
|
java.lang.String |
nextParameterTypeName()
Return the type name of the next parameter in the list. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SignatureAnalyzer(java.lang.String signature, boolean excludePrimitive, boolean excludeArrays)
signature
- the method signature to analyze, in internal formexcludePrimitive
- if true, primitive types will be discardedexcludeArrays
- if true only the component type of array types
will be included in the type informationpublic SignatureAnalyzer(java.lang.String signature)
signature
- the method signature to analyze, in internal formMethod Detail |
public java.lang.String getReturnTypeName()
construction
, and the method's return type
is primitive, will return null.
If only array component types are to be considered (as declared at construction
), and the method's return type
is an array, the array's element type will be returned (or null if it's primitive and
primitive types are excluded).
public int countParameters()
public boolean hasMoreParameters()
nextParameterTypeName()
has more
parameters to return
nextParameterTypeName()
has more
parameters to returnpublic java.lang.String nextParameterTypeName()
construction settings
, primitive
types may be excluded and array types may the component type name only.
public static java.lang.String getJavaPrimitiveTypeName(char primitiveTypeDescriptor)
public static char getInternalPrimitiveTypeDescriptor(java.lang.String javaType)
javaType
- the internal primitive type descriptor
public static java.lang.String getJavaTypeName(java.lang.String typeDescriptor)
public static java.lang.String getJavaTypeName(java.lang.Class cls)
public static java.lang.Class getTypeClass(java.lang.String javaType) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public static java.lang.Class getPrimitiveTypeClass(java.lang.String javaPrimitiveTypeName)
public static boolean isPrimitiveTypeName(java.lang.String javaTypeName)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |