public interface FormatterFactory extends ConfigurableComponent
Formatter
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.Class<?> targetType,
java.lang.Class<? extends Formatter<?>> formatterClass)
Adds a formatter to the set of registered formatters, overriding an existing formatter if one
was already registered for the type.
|
Formatter<?> |
getFormatter(java.lang.Class<?> clazz,
java.util.Locale locale,
java.lang.String formatType,
java.lang.String formatPattern)
Returns a configured formatter that meets the criteria specified.
|
init
Formatter<?> getFormatter(java.lang.Class<?> clazz, java.util.Locale locale, java.lang.String formatType, java.lang.String formatPattern)
clazz
- the type of object being formattedlocale
- the Locale into which the object should be formattedformatType
- the manner in which the object should be formatted (allows nulls)formatPattern
- the named format, or format pattern to be applied (allows nulls)void add(java.lang.Class<?> targetType, java.lang.Class<? extends Formatter<?>> formatterClass)
UnsupportedOperationException
.targetType
- the type for which the formatter will handle formattingformatterClass
- the implementation class that will handle the formattingjava.lang.UnsupportedOperationException
- if the implementation does not support adding
formatters at runtime? Copyright 2005-2006, Stripes Development Team.