|
BeanIO 1.2.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.beanio.util.TypeUtil
public class TypeUtil
Utility class for working with Java types supported by BeanIO.
| Field Summary | |
|---|---|
static Class<? extends Collection<Object>> |
ARRAY_TYPE
Class type used to indicate a Java array |
static String |
DATE_ALIAS
Alias for the java.util.Date class that includes only date information |
static String |
DATETIME_ALIAS
Alias for a java.util.Date that includes both date and time information. |
static String |
TIME_ALIAS
Alias for a java.util.Date that only includes only time information |
| Method Summary | |
|---|---|
static boolean |
isAliasOnly(String alias)
Returns true if the type alias is not used to register a type handler for its associated class. |
static boolean |
isAssignable(Class<?> to,
Class<?> from)
Returns true if to.isAssignableFrom(from) after converting primitive values of to to its object counterpart. |
static Class<?> |
loadClass(String name)
Loads a named class. |
static Class<? extends Collection<Object>> |
toCollectionType(String type)
Returns the collection Class object for a collection class name or type alias. |
static Class<?> |
toType(String type)
Returns the Class object for a class name or type alias. |
static Class<?> |
toWrapperClass(Class<?> type)
Converts primitive types to their wrapper counterparts. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DATETIME_ALIAS
public static final String DATE_ALIAS
public static final String TIME_ALIAS
public static final Class<? extends Collection<Object>> ARRAY_TYPE
| Method Detail |
|---|
public static boolean isAssignable(Class<?> to,
Class<?> from)
to - the class or primitive to test assignability tofrom - the class to test assignability from
public static Class<?> toWrapperClass(Class<?> type)
type - the class type to convert
public static Class<?> toType(String type)
| Alias | Class or Primitive |
|---|---|
| string | java.lang.String |
| boolean | java.lang.Boolean |
| byte | java.lang.Byte |
| int | java.lang.Integer |
| integer | java.lang.Integer |
| short | java.lang.Short< |
| char | java.lang.Character |
| character | java.lang.Character |
| long | java.lang.Long |
| float | java.lang.Float |
| double | java.lang.Double |
| bigdecimal | java.math.BigDecimal |
| decimal | java.math.BigDecimal |
| biginteger | java.math.BigInteger |
| date | java.util.Date |
| time | java.util.Date |
| datetime | java.util.Date |
type - the fully qualified class name or type alias
public static boolean isAliasOnly(String alias)
alias - the type alias to check
public static Class<? extends Collection<Object>> toCollectionType(String type)
| Alias | Class or Primitive |
|---|---|
| array | Java Array |
| list | java.util.ArrayList |
| set | java.util.HashSet |
type - the fully qualified class name or type alias of the collection
ARRAY_TYPE for array,
or null if the type name is invalid
public static Class<?> loadClass(String name)
throws ClassNotFoundException
name - the name of the class to load
ClassNotFoundException - if the class failed to load
|
BeanIO 1.2.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||