org.enhydra.zeus.util
Class ClassUtils

java.lang.Object
  |
  +--org.enhydra.zeus.util.ClassUtils

public class ClassUtils
extends java.lang.Object

ClassUtils is a Zeus utility class that provides methods that deal with the various classes and types that may be used in data binding. Specifically, this will deal with the String Java types that Generators deal with, and relate them to Java Class objects.

Version:
1.0
Author:
Brett McLaughlin

Constructor Summary
ClassUtils()
           
 
Method Summary
static java.lang.String getCollectionImplClass(java.lang.String collectionClass)
           For a supplied Collection class, this will return an implementation of that class.
static java.lang.Object getParameter(java.lang.String value, java.lang.Class paramType)
           This will take the String value supplied and convert it to an Object of the type specified in paramType.
static boolean isCollectionClass(java.lang.String javaType)
           This will determine if the supplied Java type (in String form) is one of the Java Collection classes.
 
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

isCollectionClass

public static boolean isCollectionClass(java.lang.String javaType)

This will determine if the supplied Java type (in String form) is one of the Java Collection classes.

Parameters:
javaType - the String name of the Java type to check for.
Returns:
boolean - whether the class is a Java Collection.

getCollectionImplClass

public static java.lang.String getCollectionImplClass(java.lang.String collectionClass)

For a supplied Collection class, this will return an implementation of that class. For example, specifying java.util.List to this method would return java.util.LinkedList, which is a concrete class. If the supplied class is already a concrete class, it is returned unchanged.

Parameters:
collectionClass - String name of collection class/interface
Returns:
String - fully qualified concrete class to use.

getParameter

public static java.lang.Object getParameter(java.lang.String value,
                                            java.lang.Class paramType)

This will take the String value supplied and convert it to an Object of the type specified in paramType.

Parameters:
value - String value to convert.
paramType - Class with type to convert to.
Returns:
Object - value in correct type.


Copyright © 2001 Enhydra. All Rights Reserved.