org.exolab.castor.mapping.loader
public class Types extends Object
Version: $Revision: 5959 $ $Date: 2006-04-25 15:08:23 -0600 (Tue, 25 Apr 2006) $
Nested Class Summary | |
---|---|
static class | Types.TypeInfo
Information about a specific Java type. |
Field Summary | |
---|---|
static Types.TypeInfo[] | _typeInfos
List of all the simple types supported by Castor. |
Method Summary | |
---|---|
static void | addEnumType(Class type) |
static Object | getDefault(Class type)
Returns the default value for this Java type (e.g. |
static boolean | isCloneable(Class type)
Returns true if the Java type implements the Cloneable
interface.
|
static boolean | isConstructable(Class type)
Returns true if the objects of this class are constructable.
|
static boolean | isConstructable(Class type, boolean allowAbstractOrInterface)
Returns true if the objects of this class are constructable.
|
static boolean | isEnumType(Class type) |
static boolean | isImmutable(Class type)
Returns true if the Java type is immutable. |
static boolean | isPrimitiveType(Class type)
Returns true if the Java type is represented as a primitive type. |
static boolean | isSerializable(Class type)
Returns true if the Java type implements the Serializable
interface.
|
static boolean | isSimpleType(Class type)
Returns true if the Java type is represented as a simple type.
|
static Object | newInstance(Class type)
Constructs a new object from the given class. |
static Object | newInstance(Class type, Object[] args)
Constructs a new object from the given class. |
static Class | typeFromName(ClassLoader loader, String typeName)
Returns the class name based on the supplied type name. |
static Class | typeFromPrimitive(Class type)
Maps from a primitive Java type to a Java class. |
Parameters: type The Java type
Returns: The default value or null
Parameters: type The Java type
Returns: True if declared as cloneable
Parameters: type The Java type
Returns: True if constructable
Parameters: allowAbstractOrInterface True to indicate that abstract classes of interfaces are allowed. type The Java type
Returns: True if constructable
Parameters: type The Java type
Returns: True if immutable type
Parameters: type The Java type
Returns: True if a primitive type
Parameters: type The Java type
Returns: True if declared as serializable
Parameters: type The Java type
Returns: True if a simple type
Parameters: type The class type of the object instance to be constructed.
Returns: An instance of the class type specified.
Throws: IllegalStateException The Java object cannot be constructed
Parameters: type The class type of the object instance to be constructed. args Arguments to be supplied to constructor call.
Returns: An instance of the class type specified.
Throws: IllegalStateException The Java object cannot be constructed
Parameters: loader The class loader to use, may be null typeName The type name
Returns: The type class
Throws: ClassNotFoundException The specified class could not be found
From To -------------- --------------- Boolean.TYPE Boolean.class Byte.TYPE Byte.class Character.TYPE Character.class Short.TYPE Short.class Integer.TYPE Integer.class Long.TYPE Long.class Float.TYPE Float.class Double.TYPE Double.class
Parameters: type The Java type (primitive or not)
Returns: A comparable non-primitive Java type