org.apache.xbean.propertyeditor
Class AbstractMapConverter

java.lang.Object
  extended by java.beans.PropertyEditorSupport
      extended by org.apache.xbean.propertyeditor.AbstractConverter
          extended by org.apache.xbean.propertyeditor.AbstractMapConverter
All Implemented Interfaces:
PropertyEditor, Converter
Direct Known Subclasses:
GenericMapConverter, HashMapEditor, HashtableEditor, IdentityHashMapEditor, LinkedHashMapEditor, MapEditor, PropertiesEditor, SortedMapEditor, TreeMapEditor, WeakHashMapEditor

public abstract class AbstractMapConverter
extends AbstractConverter

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

Constructor Summary
  AbstractMapConverter(Class type)
           
protected AbstractMapConverter(Class type, PropertyEditor keyEditor, PropertyEditor valueEditor)
           
 
Method Summary
protected abstract  Map createMap(Map map)
           
protected  Object toObjectImpl(String text)
          Treats the text value of this property as an input stream that is converted into a Property bundle.
protected  String toStringImpl(Object value)
          Converts the supplied object to text.
 
Methods inherited from class org.apache.xbean.propertyeditor.AbstractConverter
getAsText, getType, getValue, setAsText, setValue, toObject, toString
 
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

AbstractMapConverter

public AbstractMapConverter(Class type)

AbstractMapConverter

protected AbstractMapConverter(Class type,
                               PropertyEditor keyEditor,
                               PropertyEditor valueEditor)
Method Detail

toObjectImpl

protected final Object toObjectImpl(String text)
Treats the text value of this property as an input stream that is converted into a Property bundle.

Specified by:
toObjectImpl in class AbstractConverter
Parameters:
text - the text to convert
Returns:
a Properties object
Throws:
PropertyEditorException - An error occurred creating the Properties object.

createMap

protected abstract Map createMap(Map map)

toStringImpl

protected final String toStringImpl(Object value)
Description copied from class: AbstractConverter
Converts the supplied object to text. The supplied object will always be an instance of the editor type, and specifically will never be null or a String (unless this is the String editor).

Overrides:
toStringImpl in class AbstractConverter
Parameters:
value - an instance of the editor type
Returns:
the text equivalent of the value


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