|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.castor.mapping.loader.Types
public class Types
Type information. Can be used to map between short type names (such as 'int') and actual Java types (java.lang.Integer), to determine whether a type is simple (i.e. maps to a single XML attribute, SQL column, etc), as well as to create a new instance of a type.
Nested Class Summary | |
---|---|
(package private) static class |
Types.TypeInfo
Information about a specific Java type. |
Field Summary | |
---|---|
(package private) static Types.TypeInfo[] |
_typeInfos
List of all the simple types supported by Castor. |
Constructor Summary | |
---|---|
Types()
|
Method Summary | |
---|---|
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 java.lang.String |
getFullDatePattern(java.lang.String pattern)
Transforms short date format pattern into full format pattern for SimpleDateFormat (e.g., "YMD" to "yyyyMMdd"). |
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 |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static Types.TypeInfo[] _typeInfos
Constructor Detail |
---|
public Types()
Method Detail |
---|
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 name
java.lang.ClassNotFoundException
- The specified class could not be foundpublic static java.lang.Object getDefault(java.lang.Class type)
type
- The Java type
public 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 type
public static boolean isPrimitiveType(java.lang.Class type)
type
- The Java type
public static void addEnumType(java.lang.Class type)
public static boolean isEnumType(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 type
public static boolean isConstructable(java.lang.Class type, boolean allowAbstractOrInterface)
allowAbstractOrInterface
- True to indicate that abstract classes of interfaces are allowed.type
- The Java type
public static boolean isSerializable(java.lang.Class type)
Serializable
interface.
type
- The Java type
public static boolean isImmutable(java.lang.Class type)
type
- The Java type
public static boolean isCloneable(java.lang.Class type)
Cloneable
interface.
type
- The Java type
public static java.lang.String getFullDatePattern(java.lang.String pattern)
pattern
- The short pattern
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |