Method Summary |
|
public static Boolean | booleanValueOf(boolean value) Utility to perform the same function as the JDK 1.4 method
Boolean.valueOf(boolean), so we have no real dependency on JDK 1.4. |
public static boolean | classesAreDescendents(ClassLoaderResolver clr, String class_name_1, String class_name_2) Method to check if 2 classes are direct descendents. |
public static Object | convertValue(Object value, Class cls) Convenience method to convert the passed value to an object of the specified type (if possible).
If no such conversion is supported will return null. |
public static String | createFullClassName(String pkg_name, String cls_name) Utility to create the full class name given the package and class name.
Some examples
packageName=test className=Test, returns result=test.Test
packageName=test className=test1.Test, returns result=test1.Test
packageName=<null> className=Test, returns result=Test
packageName=<null> className=test1.Test, returns result=test1.Test
Parameters: pkg_name - package name. Parameters: cls_name - class name. |
public static void | dumpClassInformation(Class cls) Utility to use Reflection to dump out the details of a class.
Will list all superclasses, interfaces, methods and fields.
Can be used, for example, in checking the methods adding by the
enhancement process. |
public static Collection | getClassFilesForDirectory(File dir, boolean normal_classes, boolean inner_classes) Method to return the class files below the specified directory. |
public static String | getClassNameForClass(Class cls) Utility to return the class name without the package name for a class. |
public static String | getClassNameForFileURL(URL fileURL) Utility to find the class name of a class given the absolute file name of its class file. |
public static String[] | getClassNamesForJarFile(String jarFileName) Convenience accessor for the names of all class files in the jar file with the specified name. |
public static String[] | getClassNamesForJarFile(URL jarFileURL) Convenience accessor for the names of all class files in the jar file with the specified URL. |
public static String | getClassnameForFilename(String filename, String rootfilename) Utility to get the Class name given the file name and the file name of
the root of the package structure. |
public static String | getCollectionElementType(Field field) Convenience method to extract the element type of a collection when using JDK1.5 generics given the
input field. |
public static String | getCollectionElementType(Class type, Type genericType) Convenience method to extract the element type of a collection when using JDK1.5 generics given the
input field. |
public static String | getCollectionElementType(Method method) Convenience method to extract the element type of a collection when using JDK1.5 generics, given
the input method (getter). |
public static Constructor | getConstructorWithArguments(Class cls, Class[] types) Convenience method to return the constructor of the passed class that accepts the supplied
argument types. |
public static Field | getFieldForClass(Class cls, String fieldName) Obtain a field from a class or superclasses using reflection. |
public static String | getFieldNameForJavaBeanGetter(String methodName) |
public static String | getFieldNameForJavaBeanSetter(String methodName) |
public static String | getJavaBeanGetterName(String fieldName, boolean isBoolean) |
public static String | getJavaBeanSetterName(String fieldName) |
public static String | getJavaLangClassForType(String type) Convenience method to return the passed type as a java.lang type wherever possible.
The passed type will be stripped of any package name and will be checked if it is
a known java.lang class. |
public static String | getMapKeyType(Field field) Convenience method to extract the key type of a map when using JDK1.5 generics given the
input field. |
public static String | getMapKeyType(Class type, Type genericType) Convenience method to extract the key type of a map when using JDK1.5 generics given the
input field. |
public static String | getMapKeyType(Method method) Convenience method to extract the key type of a map when using JDK1.5 generics given the
input method. |
public static String | getMapValueType(Field field) |
public static String | getMapValueType(Class type, Type genericType) |
public static String | getMapValueType(Method method) Convenience method to extract the value type of a map when using JDK1.5 generics given the
input method. |
public static Method | getMethodForClass(Class cls, String methodName, Class[] argtypes) |
public static Method | getMethodWithArgument(Class cls, String methodName, Class argType) Obtain a method from a class or superclasses using reflection. |
public static int | getModifiersForFieldOfClass(ClassLoaderResolver clr, String className, String fieldName) Convenience accessor for the modifiers of a field in a class. |
public static String[] | getPackageJdoFilesForJarFile(String jarFileName) Convenience accessor for the names of all "package.jdo" files in the jar file with the specified name. |
public static String[] | getPackageJdoFilesForJarFile(URL jarFileURL) Convenience accessor for the names of all "package.jdo" files in the jar file with the specified URL. |
public static String | getPackageNameForClass(Class cls) Utility to return the package name for a class. |
public static Class | getPrimitiveTypeForType(Class type) Method to return the primitive equivalent of the specified type (if any). |
public static Collection | getSuperclasses(Class the_class) Method to return the superclasses for a class. |
public static Collection | getSuperinterfaces(Class the_class) Method to return the superinterfaces for a class. |
public static String[] | getUnsupportedClassNames(TypeManager typeMgr, String[] classNames) Convenience method to filter out any supported classes from a list. |
public static Class | getWrapperTypeForPrimitiveType(Class type) Convenience method to return the object wrapper type for a primitive type. |
public static String | getWrapperTypeNameForPrimitiveTypeName(String typeName) Convenience method to return the object wrapper type for a primitive type name. |
public static boolean | hasDefaultConstructor(Class the_class) Method to check for a default constructor on a class.
Particular relevance for JDO is the requirement for a default
constructor on all Persistence-Capable classes. |
public static boolean | isInnerClass(String class_name) Method to check whether a classname is for an inner class. |
public static boolean | isPrimitiveArrayType(String typeName) Convenience method to return if the passed type (name) is a primitive array type. |
public static boolean | isPrimitiveType(String typeName) Convenience method to return if the passed type (name) is a primitive type. |
public static boolean | isPrimitiveWrapperType(String typeName) Convenience method to return if the passed type (name) is a primitive wrapper type. |
public static Object | newInstance(Class type, Class[] parameterTypes, Object[] parameters) Accessor for a new instance of an object. |
public static boolean | typesAreCompatible(Class cls1, String clsName2, ClassLoaderResolver clr) Convenience method to return if two types are compatible. |
public static boolean | typesAreCompatible(Class cls1, Class cls2) Convenience method to return if two types are compatible. |