public class Types
extends java.lang.Object
Modifier and Type | Class | Description |
---|---|---|
(package private) static class |
Types.TypeInfo |
Information about a specific Java type.
|
Modifier and Type | Field | Description |
---|---|---|
(package private) static Types.TypeInfo[] |
_typeInfos |
List of all the simple types supported by Castor.
|
Constructor | Description |
---|---|
Types() |
Modifier and Type | Method | Description |
---|---|---|
static void |
addConvertibleType(java.lang.Class<?> type) |
|
static void |
addEnumType(java.lang.Class<?> type) |
|
static java.lang.Object |
getDefault(java.lang.Class<?> type) |
Returns the default value for this Java type (e.g.
|
static boolean |
isCloneable(java.lang.Class<?> type) |
Returns true if the Java type implements the
Cloneable
interface. |
static boolean |
isConstructable(java.lang.Class<?> type) |
Returns true if the objects of this class are constructable.
|
static boolean |
isConstructable(java.lang.Class<?> type,
boolean allowAbstractOrInterface) |
Returns true if the objects of this class are constructable.
|
static boolean |
isConvertibleType(java.lang.Class<?> type) |
|
static boolean |
isEnumType(java.lang.Class<?> type) |
|
static boolean |
isImmutable(java.lang.Class<?> type) |
Returns true if the Java type is immutable.
|
static boolean |
isPrimitiveType(java.lang.Class<?> type) |
Returns true if the Java type is represented as a primitive type.
|
static boolean |
isSerializable(java.lang.Class<?> type) |
Returns true if the Java type implements the
Serializable
interface. |
static boolean |
isSimpleType(java.lang.Class<?> type) |
Returns true if the Java type is represented as a simple type.
|
static java.lang.Object |
newInstance(java.lang.Class<?> type) |
Constructs a new object from the given class.
|
static java.lang.Object |
newInstance(java.lang.Class<?> type,
java.lang.Object[] args) |
Constructs a new object from the given class.
|
static java.lang.Class<?> |
typeFromName(java.lang.ClassLoader loader,
java.lang.String typeName) |
Returns the class name based on the supplied type name.
|
static java.lang.Class<?> |
typeFromPrimitive(java.lang.Class<?> type) |
Maps from a primitive Java type to a Java class.
|
static Types.TypeInfo[] _typeInfos
public static java.lang.Class<?> typeFromName(java.lang.ClassLoader loader, java.lang.String typeName) throws java.lang.ClassNotFoundException
loader
- The class loader to use, may be nulltypeName
- The type namejava.lang.ClassNotFoundException
- The specified class could not be foundpublic static java.lang.Object getDefault(java.lang.Class<?> type)
type
- The Java typepublic static java.lang.Class<?> typeFromPrimitive(java.lang.Class<?> type)
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
type
- The Java type (primitive or not)public static boolean isSimpleType(java.lang.Class<?> type)
type
- The Java typepublic static boolean isPrimitiveType(java.lang.Class<?> type)
type
- The Java typepublic static void addEnumType(java.lang.Class<?> type)
public static boolean isEnumType(java.lang.Class<?> type)
public static void addConvertibleType(java.lang.Class<?> type)
public static boolean isConvertibleType(java.lang.Class<?> type)
public static java.lang.Object newInstance(java.lang.Class<?> type) throws java.lang.IllegalStateException
type
- The class type of the object instance to be constructed.java.lang.IllegalStateException
- The Java object cannot be constructedpublic static java.lang.Object newInstance(java.lang.Class<?> type, java.lang.Object[] args) throws java.lang.IllegalStateException
type
- The class type of the object instance to be constructed.args
- Arguments to be supplied to constructor call.java.lang.IllegalStateException
- The Java object cannot be constructedpublic static boolean isConstructable(java.lang.Class<?> type)
type
- The Java typepublic static boolean isConstructable(java.lang.Class<?> type, boolean allowAbstractOrInterface)
allowAbstractOrInterface
- True to indicate that abstract classes of interfaces are allowed.type
- The Java typepublic static boolean isSerializable(java.lang.Class<?> type)
Serializable
interface.type
- The Java typepublic static boolean isImmutable(java.lang.Class<?> type)
type
- The Java typepublic static boolean isCloneable(java.lang.Class<?> type)
Cloneable
interface.type
- The Java typeIntalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com