org.springframework.beans.propertyeditors

Class PropertiesEditor

  • java.lang.Object
    • java.beans.PropertyEditorSupport
      • org.springframework.beans.propertyeditors.PropertiesEditor
  • All Implemented Interfaces:
    java.beans.PropertyEditor


    public class PropertiesEditor
    extends java.beans.PropertyEditorSupport
    Custom PropertyEditor for Properties objects.

    Handles conversion from content String to Properties object. Also handles Map to Properties conversion, for populating a Properties object via XML "map" entries.

    The required format is defined in the standard Properties documentation. Each property must be on a new line.

    Author:
    Rod Johnson, Juergen Hoeller
    See Also:
    Properties.load(java.io.Reader)
    • Constructor Summary

      Constructors 
      Constructor and Description
      PropertiesEditor() 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void setAsText(java.lang.String text)
      Convert String into Properties, considering it as properties content.
      void setValue(java.lang.Object value)
      Take Properties as-is; convert Map into Properties.
      • Methods inherited from class java.beans.PropertyEditorSupport

        addPropertyChangeListener, firePropertyChange, getAsText, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, supportsCustomEditor
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PropertiesEditor

        public PropertiesEditor()
    • Method Detail

      • setAsText

        public void setAsText(@Nullable
                              java.lang.String text)
                       throws java.lang.IllegalArgumentException
        Convert String into Properties, considering it as properties content.
        Specified by:
        setAsText in interface java.beans.PropertyEditor
        Overrides:
        setAsText in class java.beans.PropertyEditorSupport
        Parameters:
        text - the text to be so converted
        Throws:
        java.lang.IllegalArgumentException
      • setValue

        public void setValue(java.lang.Object value)
        Take Properties as-is; convert Map into Properties.
        Specified by:
        setValue in interface java.beans.PropertyEditor
        Overrides:
        setValue in class java.beans.PropertyEditorSupport