org.springframework.beans.propertyeditors

Class ClassArrayEditor

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


    public class ClassArrayEditor
    extends java.beans.PropertyEditorSupport
    Property editor for an array of Classes, to enable the direct population of a Class[] property without having to use a String class name property as bridge.

    Also supports "java.lang.String[]"-style array class names, in contrast to the standard Class.forName(String) method.

    Since:
    2.0
    Author:
    Rob Harrop, Juergen Hoeller
    • Constructor Summary

      Constructors 
      Constructor and Description
      ClassArrayEditor()
      Create a default ClassEditor, using the thread context ClassLoader.
      ClassArrayEditor(java.lang.ClassLoader classLoader)
      Create a default ClassArrayEditor, using the given ClassLoader.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String getAsText() 
      void setAsText(java.lang.String text) 
      • Methods inherited from class java.beans.PropertyEditorSupport

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

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

      • ClassArrayEditor

        public ClassArrayEditor()
        Create a default ClassEditor, using the thread context ClassLoader.
      • ClassArrayEditor

        public ClassArrayEditor(@Nullable
                                java.lang.ClassLoader classLoader)
        Create a default ClassArrayEditor, using the given ClassLoader.
        Parameters:
        classLoader - the ClassLoader to use (or pass null for the thread context ClassLoader)
    • Method Detail

      • setAsText

        public void setAsText(java.lang.String text)
                       throws java.lang.IllegalArgumentException
        Specified by:
        setAsText in interface java.beans.PropertyEditor
        Overrides:
        setAsText in class java.beans.PropertyEditorSupport
        Throws:
        java.lang.IllegalArgumentException
      • getAsText

        public java.lang.String getAsText()
        Specified by:
        getAsText in interface java.beans.PropertyEditor
        Overrides:
        getAsText in class java.beans.PropertyEditorSupport