Class ClassArrayEditor
- java.lang.Object
- java.beans.PropertyEditorSupport
- org.springframework.beans.propertyeditors.ClassArrayEditor
- All Implemented Interfaces:
PropertyEditor
public class ClassArrayEditor extends PropertyEditorSupport
Property editor for an array ofClasses
, to enable the direct population of aClass[]
property without having to use aString
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 Description ClassArrayEditor()
Create a defaultClassEditor
, using the thread contextClassLoader
.ClassArrayEditor(ClassLoader classLoader)
Create a defaultClassArrayEditor
, using the givenClassLoader
.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAsText()
void
setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Constructor Detail
ClassArrayEditor
public ClassArrayEditor()
Create a defaultClassEditor
, using the thread contextClassLoader
.
ClassArrayEditor
public ClassArrayEditor(ClassLoader classLoader)
Create a defaultClassArrayEditor
, using the givenClassLoader
.- Parameters:
classLoader
- theClassLoader
to use (or passnull
for the thread contextClassLoader
)
Method Detail
setAsText
public void setAsText(String text) throws IllegalArgumentException
- Specified by:
setAsText
in interfacePropertyEditor
- Overrides:
setAsText
in classPropertyEditorSupport
- Throws:
IllegalArgumentException
getAsText
public String getAsText()
- Specified by:
getAsText
in interfacePropertyEditor
- Overrides:
getAsText
in classPropertyEditorSupport