|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectwicket.util.convert.converters.AbstractConverter
wicket.util.convert.converters.StringConverter
public class StringConverter
Converts objects to Strings. Since the formatting of Strings may vary depending on the type of object being converted, you can register ITypeConverters for each kind of formatting you want to support. For example, the default StringConverter class registers a set of converters which convert from various types to String, including DateToStringConverter, which converts from Objects of type Date to Strings.
| Constructor Summary | |
|---|---|
StringConverter()
Construct. |
|
| Method Summary | |
|---|---|
void |
clear()
Removes all registered string converters. |
java.lang.Object |
convert(java.lang.Object value,
java.util.Locale locale)
Converts the given value |
ITypeConverter |
get(java.lang.Class c)
Gets the type converter that is registered for class c. |
ITypeConverter |
getDefaultConverter()
Gets the converter that is to be used when no registered converter is found. |
protected java.lang.Class |
getTargetType()
|
ITypeConverter |
remove(java.lang.Class c)
Removes the type converter currently registered for class c. |
ITypeConverter |
set(java.lang.Class c,
ITypeConverter converter)
Registers a converter for use with class c. |
void |
setDefaultConverter(ITypeConverter defaultConverter)
Sets the converter that is to be used when no registered converter is found. |
| Methods inherited from class wicket.util.convert.converters.AbstractConverter |
|---|
newConversionException, parse |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StringConverter()
| Method Detail |
|---|
public void clear()
public java.lang.Object convert(java.lang.Object value,
java.util.Locale locale)
ITypeConverter
value - The value to convert
ITypeConverter.convert(java.lang.Object,java.util.Locale)public ITypeConverter get(java.lang.Class c)
c - The class to get the type converter for
public final ITypeConverter getDefaultConverter()
public ITypeConverter remove(java.lang.Class c)
c - The class for which the converter registration should be
removed
public ITypeConverter set(java.lang.Class c,
ITypeConverter converter)
converter - The converter to addc - The class for which the converter should be used
public final void setDefaultConverter(ITypeConverter defaultConverter)
defaultConverter - The converter that is to be used when no registered converter
is foundprotected java.lang.Class getTargetType()
getTargetType in class AbstractConverterAbstractConverter.getTargetType()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||