org.ocltf.utils
Class ClassUtils

java.lang.Object
  extended byorg.apache.commons.lang.ClassUtils
      extended byorg.ocltf.utils.ClassUtils

public class ClassUtils
extends org.apache.commons.lang.ClassUtils

Contains utilities for dealing with classes.

Author:
Chad Brandon

Field Summary
 
Fields inherited from class org.apache.commons.lang.ClassUtils
INNER_CLASS_SEPARATOR, INNER_CLASS_SEPARATOR_CHAR, PACKAGE_SEPARATOR, PACKAGE_SEPARATOR_CHAR
 
Constructor Summary
ClassUtils()
           
 
Method Summary
protected static java.lang.Class getPrimitiveClass(java.lang.String name, java.lang.ClassLoader loader)
          Returns the type class name for a Java primitive.
protected static boolean isPrimitiveType(java.lang.String name)
          Checks if a given type name is a Java primitive type.
static java.lang.Class loadClass(java.lang.String className)
          Loads and returns the class having the className.
 
Methods inherited from class org.apache.commons.lang.ClassUtils
convertClassesToClassNames, convertClassNamesToClasses, getAllInterfaces, getAllSuperclasses, getPackageName, getPackageName, getPackageName, getShortClassName, getShortClassName, getShortClassName, isAssignable, isAssignable, isInnerClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassUtils

public ClassUtils()
Method Detail

loadClass

public static java.lang.Class loadClass(java.lang.String className)
                                 throws java.lang.ClassNotFoundException,
                                        java.lang.NoSuchFieldException,
                                        java.lang.IllegalAccessException
Loads and returns the class having the className. Will load but normal classes and the classes representing primatives.

Parameters:
className -
Returns:
Class
Throws:
java.lang.ClassNotFoundException - if the class can not be found
java.lang.NoSuchFieldException - if the className is a primative and its corresponding type field can not be retrieved.
java.lang.IllegalAccessException - if the className is a primative and its corresponding type field is illegal accessed.

getPrimitiveClass

protected static java.lang.Class getPrimitiveClass(java.lang.String name,
                                                   java.lang.ClassLoader loader)
                                            throws java.lang.NoSuchFieldException,
                                                   java.lang.IllegalAccessException,
                                                   java.lang.ClassNotFoundException

Returns the type class name for a Java primitive.

Parameters:
name - a String with the name of the type
loader - the loader to use.
Returns:
a String with the name of the corresponding java.lang wrapper class if name is a Java primitive type; false if not
Throws:
java.lang.NoSuchFieldException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException

isPrimitiveType

protected static boolean isPrimitiveType(java.lang.String name)

Checks if a given type name is a Java primitive type.

Parameters:
name - a String with the name of the type
Returns:
true if name is a Java primitive type; false if not


Copyright © 2003-2004 Chad Brandon. All Rights Reserved.