|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.acorn.util.converter.Classes
public abstract class Classes
Converts between object classes.
| Field Summary | |
|---|---|
static String |
ANY_DOMAIN
The domain wildcard. |
static String |
MBEAN_SUFFIX
The MBean interface suffix. |
| Constructor Summary | |
|---|---|
Classes()
|
|
| Method Summary | |
|---|---|
static Object |
getPropertyValue(Object bean,
String field)
Gets the value of the specified property. |
static boolean |
isDateType(String className,
boolean arrayp)
Checks whether the specified class type is a date, i.e. |
static void |
setPropertyValue(Object bean,
String field,
Object value)
Sets the value of the specified property. |
static String |
toBaseName(String name)
Converts a localized name to its base name. |
static Class |
toClass(String type)
Converts a class or primitive type to the corresponding class by applying the default class loader. |
static Class |
toClass(String type,
ClassLoader loader)
Converts a class or primitive type to the corresponding class by applying the specified class loader. |
static Class[] |
toClassHierarchy(Class clazz)
Converts the specified class to a class hierarchy of its implemented interfaces and extended superclasses. |
static String |
toExtension(File file,
String def)
Converts a file to its extension. |
static String |
toExtension(String path,
String def)
Converts a path to its extension. |
static Locale |
toLocale(String str)
Converts a string to a locale. |
static String |
toLocalizedName(String name,
Locale locale)
Converts a base name to a localized name. |
static String |
toLocalizedPath(String path,
Locale locale)
Converts a base path to a localized path. |
static Class |
toMBean(Class clazz)
Converts a class into its MBean interface. |
static Locale |
toNamedLocale(String name)
Converts a localized name to its corresponding locale. |
static String |
toPackageName(String uri,
String domain)
Converts an URI path to a package name. |
static Object[] |
toParameters(Object params,
Object sign)
Converts parameters into the corresponding parameter array. |
static PropertyDescriptor |
toPropertyDescriptor(Class clazz,
String field)
Converts a field of a class into the corresponding property descriptor. |
static String |
toSignature(Object param)
Converts a parameter into the corresponding signature. |
static String[] |
toSignature(Object params,
Object sign)
Converts parameters into the corresponding signature array. |
static String |
toString(Locale locale)
Converts a locale to a string. |
static String[] |
toTypeHierarchy(String className)
Converts the named class to a type hierarchy of its implemented interfaces and extended superclasses. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String ANY_DOMAIN
public static final String MBEAN_SUFFIX
| Constructor Detail |
|---|
public Classes()
| Method Detail |
|---|
public static Class toClass(String type)
throws ClassNotFoundException
type - the type to convert.
ClassNotFoundException - if not found.
public static Class toClass(String type,
ClassLoader loader)
throws ClassNotFoundException
type - the type to convert.loader - the class loader to apply.
ClassNotFoundException - if not found.public static Class[] toClassHierarchy(Class clazz)
clazz - the class to convert.
public static String[] toTypeHierarchy(String className)
className - the named class to convert.
public static boolean isDateType(String className,
boolean arrayp)
className - the class type to check.arrayp - true if an array type is accepted.
public static String toString(Locale locale)
locale - the locale.
public static Locale toLocale(String str)
Note that the conversion is case insensitive.
str - the locale string.
public static Locale toNamedLocale(String name)
name - the localized name.
public static String toBaseName(String name)
name - the localized name.
public static String toLocalizedName(String name,
Locale locale)
name - the base name.locale - the locale.
public static String toLocalizedPath(String path,
Locale locale)
path - the base name.locale - the locale.
public static String toPackageName(String uri,
String domain)
uri - the URI path to convert.domain - the default domain to replace '*'.
public static String toExtension(String path,
String def)
path - the path.def - the default.
public static String toExtension(File file,
String def)
file - the file.def - the default.
public static Class toMBean(Class clazz)
clazz - the class to convert.
public static String toSignature(Object param)
param - a parameter to convert.
public static String[] toSignature(Object params,
Object sign)
params - parameters to convert.sign - an optional signature.
public static Object[] toParameters(Object params,
Object sign)
params - parameters to convert.sign - an optional signature.
public static PropertyDescriptor toPropertyDescriptor(Class clazz,
String field)
clazz - the class.field - the field.
public static Object getPropertyValue(Object bean,
String field)
throws IllegalAccessException,
InvocationTargetException
bean - the bean.field - the field.
IllegalAccessException - if inaccessible.
InvocationTargetException - if failed.
IllegalArgumentException - if not available.
public static void setPropertyValue(Object bean,
String field,
Object value)
throws IllegalAccessException,
InvocationTargetException
bean - the bean.field - the field.value - the value.
IllegalAccessException - if inaccessible.
InvocationTargetException - if failed.
IllegalArgumentException - if not available.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||