Top Description Fields Constructors Methods
org.springframework.beans.propertyeditors

public Class ClassArrayEditor

extends PropertyEditorSupport
Class Inheritance
Imports
java.beans.PropertyEditorSupport, java.util.StringJoiner, org.springframework.lang.Nullable, org.springframework.util.ClassUtils, .ObjectUtils, .StringUtils

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.

Authors
Rob Harrop, Juergen Hoeller
Since
2.0

Field Summary

Modifier and TypeField and Description
private final ClassLoader

Constructor Summary

AccessConstructor and Description
public
ClassArrayEditor()

Create a default ClassEditor, using the thread context ClassLoader.

public
ClassArrayEditor(ClassLoader
the ClassLoader to use (or pass null for the thread context ClassLoader)
classLoader
)

Create a default ClassArrayEditor, using the given ClassLoader.

Method Summary

Modifier and TypeMethod and Description
public String
getAsText()

Overrides java.beans.PropertyEditorSupport.getAsText.

Implements java.beans.PropertyEditor.getAsText.

Gets the property value as a string suitable for presentation to a human to edit.

public void
setAsText(String
The string to be parsed.
text
)

Overrides java.beans.PropertyEditorSupport.setAsText.

Implements java.beans.PropertyEditor.setAsText.

Sets the property value by parsing a given String.

Inherited from java.beans.PropertyEditorSupport:
addPropertyChangeListenerfirePropertyChangegetCustomEditorgetJavaInitializationStringgetSourcegetTagsgetValueisPaintablepaintValueremovePropertyChangeListenersetSourcesetValuesupportsCustomEditor

Field Detail

classLoaderback to summary
private final ClassLoader classLoader
Annotations
@Nullable

Constructor Detail

ClassArrayEditorback to summary
public ClassArrayEditor()

Create a default ClassEditor, using the thread context ClassLoader.

ClassArrayEditorback to summary
public ClassArrayEditor(ClassLoader classLoader)

Create a default ClassArrayEditor, using the given ClassLoader.

Parameters
classLoader:ClassLoader

the ClassLoader to use (or pass null for the thread context ClassLoader)

Method Detail

getAsTextback to summary
public String getAsText()

Overrides java.beans.PropertyEditorSupport.getAsText.

Implements java.beans.PropertyEditor.getAsText.

Doc from java.beans.PropertyEditorSupport.getAsText.

Gets the property value as a string suitable for presentation to a human to edit.

Returns:String

The property value as a string suitable for presentation to a human to edit.

Returns null if the value can't be expressed as a string.

If a non-null value is returned, then the PropertyEditor should be prepared to parse that string back in setAsText().

Annotations
@Override
setAsTextback to summary
public void setAsText(String text) throws IllegalArgumentException

Overrides java.beans.PropertyEditorSupport.setAsText.

Implements java.beans.PropertyEditor.setAsText.

Doc from java.beans.PropertyEditorSupport.setAsText.

Sets the property value by parsing a given String. May raise java.lang.IllegalArgumentException if either the String is badly formatted or if this kind of property can't be expressed as text.

Parameters
text:String

The string to be parsed.

Annotations
@Override