|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.beans.PropertyEditorSupport org.apache.xbean.propertyeditor.AbstractConverter
public abstract class AbstractConverter
A base class for converters. This class handles all converter methods, and redirects all conversion requests to toStringImpl and toObjectImpl. These methods can assume that the supplied value or text is never null, and that type checking has been applied to the value.
Constructor Summary | |
---|---|
protected |
AbstractConverter(Class type)
Creates an abstract converter for the specified type. |
Method Summary | |
---|---|
String |
getAsText()
|
Class |
getType()
Gets the the type of object supported by this converter. |
Object |
getValue()
|
void |
setAsText(String text)
|
void |
setValue(Object value)
|
Object |
toObject(String text)
Converts the supplied text in to an instance of the editor type. |
protected abstract Object |
toObjectImpl(String text)
Converts the supplied text in to an instance of the editor type. |
String |
toString(Object value)
Converts the supplied object to text. |
protected String |
toStringImpl(Object value)
Converts the supplied object to text. |
Methods inherited from class java.beans.PropertyEditorSupport |
---|
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, isPaintable, paintValue, removePropertyChangeListener, setSource, supportsCustomEditor |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.beans.PropertyEditor |
---|
addPropertyChangeListener, getCustomEditor, getJavaInitializationString, getTags, isPaintable, paintValue, removePropertyChangeListener, supportsCustomEditor |
Constructor Detail |
---|
protected AbstractConverter(Class type)
type
- type of the property editorMethod Detail |
---|
public final Class getType()
Converter
getType
in interface Converter
public final String getAsText()
getAsText
in interface PropertyEditor
getAsText
in class PropertyEditorSupport
public final void setAsText(String text)
setAsText
in interface PropertyEditor
setAsText
in class PropertyEditorSupport
public final Object getValue()
getValue
in interface PropertyEditor
getValue
in class PropertyEditorSupport
public final void setValue(Object value)
setValue
in interface PropertyEditor
setValue
in class PropertyEditorSupport
public final String toString(Object value)
Converter
toString
in interface Converter
value
- an instance of the editor type
public final Object toObject(String text)
Converter
toObject
in interface Converter
text
- the text to convert
protected String toStringImpl(Object value)
value
- an instance of the editor type
protected abstract Object toObjectImpl(String text)
text
- the text to convert
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |