|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Convert an object into a String and back again.
This interface represents a general interface for converting objects into a well-defined textual representation, and for converting that textual representation back into an object instance.
When implementing your own StringConverter, you should extend the DefaultStringConverter class, as this
handles errors and default values automatically.
The Source Code of this Java class is available under a BSD-style license.
StringConverterSupport,
DefaultStringConverter| Method Summary | |
Object |
makeDefaultObject()
Create a default instance of the object. |
String |
makeDefaultString()
Create a default textual representation. |
Object |
makeObject(String pValue,
boolean pUseDefault)
Create an object from a textual representation. |
String |
makeString(Object pValue,
boolean pUseDefault)
Create a textual representation of an object. |
| Method Detail |
public Object makeObject(String pValue,
boolean pUseDefault)
If the String is invalid,
then if the pUseDefault argument is true,
return the default object, as returned by makeDefaultObject(),
otherwise throw an Exception.
pValue - textual representation of the objectpUseDefault - use the default value in case of errorpublic Object makeDefaultObject()
public String makeString(Object pValue,
boolean pUseDefault)
If the object is invalid,
then if the pUseDefault argument is true,
return the default text, as returned by makeDefaultString(),
otherwise throw an Exception.
pValue - object to convertpUseDefault - use the default value in case of errorpublic String makeDefaultString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||