public class JavaTypes extends Object
Modifier and Type | Field and Description |
---|---|
static int |
ARRAY |
static int |
BIGDECIMAL |
static int |
BIGINTEGER |
static int |
BOOLEAN |
static int |
BOOLEAN_OBJ |
static int |
BYTE |
static int |
BYTE_OBJ |
static int |
CALENDAR |
static int |
CHAR |
static int |
CHAR_OBJ |
static int |
COLLECTION |
static int |
DATE |
static int |
DOUBLE |
static int |
DOUBLE_OBJ |
static int |
ENUM |
static int |
FLOAT |
static int |
FLOAT_OBJ |
static int |
INPUT_READER |
static int |
INPUT_STREAM |
static int |
INT |
static int |
INT_OBJ |
static int |
LOCALE |
static int |
LONG |
static int |
LONG_OBJ |
static int |
MAP |
static int |
NUMBER |
static int |
OBJECT |
static int |
OID |
static int |
PC |
static int |
PC_UNTYPED |
static int |
SHORT |
static int |
SHORT_OBJ |
static int |
STRING |
Constructor and Description |
---|
JavaTypes() |
Modifier and Type | Method and Description |
---|---|
static Class<?> |
classForName(String name,
ClassMetaData context)
Check the given name against the same set of standard packages used
when parsing metadata.
|
static Class<?> |
classForName(String name,
ClassMetaData context,
ClassLoader loader)
Check the given name against the same set of standard packages used
when parsing metadata.
|
static Class<?> |
classForName(String name,
ClassMetaData context,
ClassLoader loader,
boolean mustExist)
Check the given name against the same set of standard packages used
when parsing metadata.
|
static Class<?> |
classForName(String name,
ValueMetaData context)
Check the given name against the same set of standard packages used
when parsing metadata.
|
static Class<?> |
classForName(String name,
ValueMetaData context,
ClassLoader loader)
Check the given name against the same set of standard packages used
when parsing metadata.
|
static Class<?> |
classForName(String name,
ValueMetaData context,
ClassLoader loader,
boolean mustExist)
Try to load a class using the provided loader.
|
static Object |
convert(Object val,
int typeCode)
Convert the given object to the given type if possible.
|
static int |
getTypeCode(Class<?> type)
Return the field metadata type code for the given class.
|
static boolean |
isPrimitiveDefault(Object o,
int typeCode)
Determine whether or not the provided Object value is the default for the provided typeCode.
|
static boolean |
maybePC(FieldMetaData field)
Return true if the (possibly unresolved) field or its elements might be
persistence capable objects.
|
static boolean |
maybePC(ValueMetaData val)
Return true if the (possibly unresolved) value might be a first class
object.
|
static Object |
toArray(Collection<?> coll,
Class<?> elem)
Helper method to return the given collection as an array.
|
static <T> List<T> |
toList(Object val,
Class<T> elem,
boolean mutable)
Helper method to return the given array value as a collection.
|
public static final int BOOLEAN
public static final int BYTE
public static final int CHAR
public static final int DOUBLE
public static final int FLOAT
public static final int INT
public static final int LONG
public static final int SHORT
public static final int OBJECT
public static final int STRING
public static final int NUMBER
public static final int ARRAY
public static final int COLLECTION
public static final int MAP
public static final int DATE
public static final int PC
public static final int BOOLEAN_OBJ
public static final int BYTE_OBJ
public static final int CHAR_OBJ
public static final int DOUBLE_OBJ
public static final int FLOAT_OBJ
public static final int INT_OBJ
public static final int LONG_OBJ
public static final int SHORT_OBJ
public static final int BIGDECIMAL
public static final int BIGINTEGER
public static final int LOCALE
public static final int PC_UNTYPED
public static final int CALENDAR
public static final int OID
public static final int INPUT_STREAM
public static final int INPUT_READER
public static final int ENUM
public static int getTypeCode(Class<?> type)
public static Class<?> classForName(String name, ClassMetaData context)
public static Class<?> classForName(String name, ClassMetaData context, ClassLoader loader)
public static Class<?> classForName(String name, ClassMetaData context, ClassLoader loader, boolean mustExist)
mustExist
- Whether the supplied loader must be able to load the class. If true no attempt to use a
different classloader will be made. If false the ClassResolver from the configuration will be used.public static Class<?> classForName(String name, ValueMetaData context)
public static Class<?> classForName(String name, ValueMetaData context, ClassLoader loader)
public static Class<?> classForName(String name, ValueMetaData context, ClassLoader loader, boolean mustExist)
name
- Name of the class to load.loader
- ClassLoader to use. If null, the configuration's ClassResolver will be used.mustExist
- Whether the supplied loader must be able to load the class. If true no attempt to use a
different classloader will be made. If false the ClassResolver from the configuration will be used.public static Object convert(Object val, int typeCode)
Number
. If no known conversion or the value is null,
returns the original value.public static boolean maybePC(FieldMetaData field)
public static boolean maybePC(ValueMetaData val)
public static <T> List<T> toList(Object val, Class<T> elem, boolean mutable)
public static Object toArray(Collection<?> coll, Class<?> elem)
public static boolean isPrimitiveDefault(Object o, int typeCode)
Copyright © 2006–2018 Apache Software Foundation. All rights reserved.