public class FormattersManager extends Object
Object values to String and vice versa.| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_DATE_FORMAT |
static String |
DEFAULT_NUMBER_FORMAT |
| Constructor and Description |
|---|
FormattersManager() |
| Modifier and Type | Method and Description |
|---|---|
static String |
format(Object value)
Returns String presentation of the given object.
|
static IFormatter |
getFormatter(Class<?> clazz) |
static IFormatter |
getFormatter(Class<?> clazz,
Object value) |
static IFormatter |
getFormatter(Class<?> clazz,
Object value,
String format)
The method used for getting the appropriate formatter for the income class.
|
static IFormatter |
getFormatter(Class<?> clazz,
String format) |
public static String DEFAULT_DATE_FORMAT
public static String DEFAULT_NUMBER_FORMAT
public static String format(Object value)
value - an object to formatgetFormatter(Object)public static IFormatter getFormatter(Class<?> clazz, Object value, String format)
DefaultFormatter as default.NumberFormatter for numeric types.DateFormatter for Date type.BooleanFormatter for Boolean type.EnumFormatter for Enum types.ArrayFormatter for array types, also supports primitive arrays.DefaultFormatter for String type.clazz - formatter will be returned for this Class.format - format for number, date formatters. If null default format will be used
DEFAULT_NUMBER_FORMAT and DEFAULT_DATE_FORMAT accordingly.public static IFormatter getFormatter(Class<?> clazz, Object value)
public static IFormatter getFormatter(Class<?> clazz, String format)
public static IFormatter getFormatter(Class<?> clazz)
Copyright © 2004–2019 OpenL Tablets. All rights reserved.