org.apache.xbean.propertyeditor
Interface Converter

All Superinterfaces:
PropertyEditor
All Known Implementing Classes:
AbstractCollectionConverter, AbstractConverter, AbstractMapConverter, ArrayConverter, ArrayListEditor, BigDecimalEditor, BigIntegerEditor, BooleanEditor, ByteEditor, CharacterEditor, ClassEditor, CommonsLoggingConverter, DateEditor, DoubleEditor, EnumConverter, FileEditor, FloatEditor, GenericCollectionConverter, GenericMapConverter, HashMapEditor, HashtableEditor, IdentityHashMapEditor, Inet4AddressEditor, Inet6AddressEditor, InetAddressEditor, IntegerEditor, JndiConverter, LinkedHashMapEditor, LinkedHashSetEditor, LinkedListEditor, ListEditor, Log4jConverter, LoggerConverter, LongEditor, MapEditor, ObjectNameEditor, PatternConverter, PropertiesEditor, SetEditor, ShortEditor, SortedMapEditor, SortedSetEditor, StringEditor, TreeMapEditor, TreeSetEditor, URIEditor, URLEditor, VectorEditor, WeakHashMapEditor

public interface Converter
extends PropertyEditor

Version:
$Rev: 6680 $ $Date: 2005-12-24T04:38:27.427468Z $

Method Summary
 Class getType()
          Gets the the type of object supported by this converter.
 Object toObject(String text)
          Converts the supplied text in to an instance of the editor type.
 String toString(Object value)
          Converts the supplied object to text.
 
Methods inherited from interface java.beans.PropertyEditor
addPropertyChangeListener, getAsText, getCustomEditor, getJavaInitializationString, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setAsText, setValue, supportsCustomEditor
 

Method Detail

getType

Class getType()
Gets the the type of object supported by this converter.

Returns:

toString

String toString(Object value)
                throws PropertyEditorException
Converts the supplied object to text. If value is null, null will be returned. If value is not an instance of the this converter's type, a PropertyEditorException will be thrown.

Parameters:
value - an instance of the editor type
Returns:
the text equivalent of the value
Throws:
PropertyEditorException - if an error occurs while converting the value to a String (this is very rare)

toObject

Object toObject(String text)
                throws PropertyEditorException
Converts the supplied text in to an instance of the editor type. If text is null, null will be returned.

Parameters:
text - the text to convert
Returns:
an instance of the editor type
Throws:
PropertyEditorException - if an error occurs while converting the text to an object


Copyright © 2005-2009 The Apache Software Foundation. All Rights Reserved.