Class ClassEditor
- java.lang.Object
- java.beans.PropertyEditorSupport
- org.springframework.beans.propertyeditors.ClassEditor
- All Implemented Interfaces:
PropertyEditor
public class ClassEditor extends PropertyEditorSupport
Property editor forjava.lang.Class
, to enable the direct population of aClass
property without recourse to 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:
- 13.05.2003
- Author:
- Juergen Hoeller, Rick Evans
- See Also:
Class.forName(java.lang.String)
,ClassUtils.forName(String, ClassLoader)
Constructor Summary
Constructors Constructor Description ClassEditor()
Create a default ClassEditor, using the thread context ClassLoader.ClassEditor(ClassLoader classLoader)
Create a default ClassEditor, using the given ClassLoader.
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
ClassEditor
public ClassEditor()
Create a default ClassEditor, using the thread context ClassLoader.
ClassEditor
public ClassEditor(ClassLoader classLoader)
Create a default ClassEditor, using the given ClassLoader.- Parameters:
classLoader
- the ClassLoader to use (ornull
for the thread context ClassLoader)
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