org.sonatype.gshell.util.converter.collections
Class MapConverterSupport
java.lang.Object
java.beans.PropertyEditorSupport
org.sonatype.gshell.util.converter.ConverterSupport
org.sonatype.gshell.util.converter.collections.MapConverterSupport
- All Implemented Interfaces:
- PropertyEditor, Converter
- Direct Known Subclasses:
- GenericMapConverter, HashMapConverter, IdentityHashMapConverter, LinkedHashMapConverter, MapConverter, PropertiesConverter, SortedMapConverter, TreeMapConverter, WeakHashMapConverter
public abstract class MapConverterSupport
- extends ConverterSupport
Support for Map converters.
- Since:
- 2.0
| 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 |
MapConverterSupport
public MapConverterSupport(Class type)
MapConverterSupport
protected MapConverterSupport(Class type,
PropertyEditor keyEditor,
PropertyEditor valueEditor)
convertToObject
protected final Object convertToObject(String text)
throws Exception
- Treats the text value of this property as an input stream that
is converted into a Property bundle.
- Specified by:
convertToObject in class ConverterSupport
- Parameters:
text - The text to convertToObject
- Returns:
- a Properties object
- Throws:
ConversionException - An error occurred creating the Properties object.
Exception - Conversion failed
createMap
protected abstract Map createMap(Map map)
throws Exception
- Throws:
Exception
convertToString
protected final String convertToString(Object value)
- Description copied from class:
ConverterSupport
- 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:
convertToString in class ConverterSupport
- Parameters:
value - an instance of the editor type
- Returns:
- the text equivalent of the value
Copyright © 2008-2011 Sonatype. All Rights Reserved.