public class ConverterRegistry extends Object
| Modifier and Type | Field and Description |
|---|---|
static Comparator<Object> |
DEFAULT_COMPARATOR |
| Constructor and Description |
|---|
ConverterRegistry() |
| Modifier and Type | Method and Description |
|---|---|
static <X,T extends IConverter<X>> |
convertStringToValue(Class<T> clz,
Locale loc,
String in)
Convert a String value to some object, using the specified converter.
|
static <X,T extends IConverter<X>> |
convertStringToValue(Class<T> clz,
String in)
Convert a String value to some object, using the specified converter.
|
static <X> String |
convertToString(PropertyMetaModel<X> pmm,
X value)
Convert the value which is for a given property to a presentation string.
|
static <X> X |
convertURLStringToValue(Class<X> toType,
String svalue)
Convert the URL string passed to some object value.
|
static <X,T extends IConverter<X>> |
convertValueToString(Class<T> clz,
Locale loc,
X in)
Convert some object to a String value, using the specified converter.
|
static <X,T extends IConverter<X>> |
convertValueToString(Class<T> clz,
X in)
Convert some object to a String value, using the specified converter.
|
static <X> IConverter<X> |
findBestConverter(PropertyMetaModel<X> pmm)
Obtain the very best presentation converter we can find for the specified property.
|
static <X> IConverter<X> |
findConverter(Class<X> clz)
Finds the best converter to convert a value of the specified type to a string.
|
static <X> IConverter<X> |
findConverter(Class<X> clz,
PropertyMetaModel<X> pmm)
Finds the best converter to convert a value of the specified type (and the optionally specified metadata) to a string.
|
static <X> IConverter<X> |
findURLConverter(Class<X> totype)
Find an URL converter to convert to the given type.
|
static <T> Comparator<T> |
getComparator(Class<T> dataClass,
String property,
boolean descending) |
static Comparator<?> |
getComparator(ClassMetaModel cmm,
String property,
boolean descending) |
static <X> IConverter<X> |
getConverter(Class<X> clz,
PropertyMetaModel<X> pmm)
Gets the best converter to convert a value of the specified type (and the optionally specified metadata) to a string.
|
static <X,T extends IConverter<X>> |
getConverterInstance(Class<T> clz)
Get an instance of a given converter type.
|
static void |
register(IConverterFactory cf)
Registers the specified converter factory.
|
static <T> void |
registerComparator(Comparator<T> comp,
Class<?>... valueClass)
Register a comparator for a given type.
|
static <X> void |
registerURLConverter(Class<X> totype,
IConverter<X> c)
Register an URL converter for the specified class.
|
public static final Comparator<Object> DEFAULT_COMPARATOR
@Nonnull public static <X,T extends IConverter<X>> T getConverterInstance(@Nonnull Class<T> clz)
clz - public static <X,T extends IConverter<X>> X convertStringToValue(Class<T> clz, Locale loc, String in) throws Exception
clz - loc - in - Exceptionpublic static <X,T extends IConverter<X>> String convertValueToString(Class<T> clz, Locale loc, X in) throws Exception
clz - loc - in - Exceptionpublic static <X,T extends IConverter<X>> X convertStringToValue(Class<T> clz, String in) throws Exception
clz - in - Exception@Nonnull public static <X,T extends IConverter<X>> String convertValueToString(Class<T> clz, X in) throws Exception
clz - in - Exceptionpublic static <X> void registerURLConverter(Class<X> totype, IConverter<X> c)
totype - c - public static <X> IConverter<X> findURLConverter(Class<X> totype)
totype - public static <X> X convertURLStringToValue(Class<X> toType, String svalue) throws Exception
toType - svalue - Exceptionpublic static void register(IConverterFactory cf)
public static <X> IConverter<X> findConverter(Class<X> clz, PropertyMetaModel<X> pmm)
clz - The class type of the value to convertpmm - The metadata for the property, or null if unknown.public static <X> IConverter<X> findConverter(Class<X> clz)
clz - The class type of the value to convertpublic static <X> IConverter<X> getConverter(Class<X> clz, PropertyMetaModel<X> pmm)
clz - The class type of the value to convertpmm - The metadata for the property, or null if unknown.public static <X> String convertToString(PropertyMetaModel<X> pmm, X value)
X - pmm - value - public static <X> IConverter<X> findBestConverter(PropertyMetaModel<X> pmm)
pmm - public static <T> void registerComparator(@Nonnull Comparator<T> comp, Class<?>... valueClass)
valueClass - comp - public static <T> Comparator<T> getComparator(@Nonnull Class<T> dataClass, @Nonnull String property, boolean descending)
dataClass - property - descending - public static Comparator<?> getComparator(@Nonnull ClassMetaModel cmm, @Nonnull String property, boolean descending)
Copyright © 2017 etc.to. All rights reserved.