Class MapEditor

  • All Implemented Interfaces:
    java.beans.PropertyEditor
    Direct Known Subclasses:
    PropertiesEditor

    public class MapEditor
    extends AbstractPropertyEditor
    A PropertyEditor which converts a String into a Collection and vice versa.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  MapEditor.TokenType  
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static java.util.regex.Pattern ELEMENT  
      private java.lang.Class<?> keyType  
      private static java.lang.String NO_KEY  
      private static java.lang.String NO_VALUE  
      private java.lang.Class<?> valueType  
    • Constructor Summary

      Constructors 
      Constructor Description
      MapEditor​(java.lang.Class<?> keyType, java.lang.Class<?> valueType)
      Creates a new DateEditor instance
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private java.beans.PropertyEditor getKeyEditor()  
      private java.beans.PropertyEditor getValueEditor()  
      protected java.util.Map<java.lang.Object,​java.lang.Object> newMap()  
      protected java.lang.String toText​(java.lang.Object value)
      Returns a String representation of the given value
      protected java.lang.Object toValue​(java.lang.String text)
      Returns an instance from a String representation of an object
      • 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
    • Field Detail

      • ELEMENT

        static final java.util.regex.Pattern ELEMENT
      • keyType

        private final java.lang.Class<?> keyType
      • valueType

        private final java.lang.Class<?> valueType
    • Constructor Detail

      • MapEditor

        public MapEditor​(java.lang.Class<?> keyType,
                         java.lang.Class<?> valueType)
        Creates a new DateEditor instance
        Parameters:
        keyType - The key type
        valueType - The value type
    • Method Detail

      • getKeyEditor

        private java.beans.PropertyEditor getKeyEditor()
      • getValueEditor

        private java.beans.PropertyEditor getValueEditor()
      • toText

        protected final java.lang.String toText​(java.lang.Object value)
        Description copied from class: AbstractPropertyEditor
        Returns a String representation of the given value
        Specified by:
        toText in class AbstractPropertyEditor
        Parameters:
        value - The value
        Returns:
        A String representation of the value
      • toValue

        protected final java.lang.Object toValue​(java.lang.String text)
        Description copied from class: AbstractPropertyEditor
        Returns an instance from a String representation of an object
        Specified by:
        toValue in class AbstractPropertyEditor
        Parameters:
        text - The String representation to convert
        Returns:
        A instance of an object
      • newMap

        protected java.util.Map<java.lang.Object,​java.lang.Object> newMap()