Top Description Fields Constructors Methods
org.springframework.web.multipart.support

public Class StringMultipartFileEditor

extends PropertyEditorSupport
Class Inheritance
Imports
java.beans.PropertyEditorSupport, java.io.IOException, org.springframework.lang.Nullable, org.springframework.web.multipart.MultipartFile

Custom java.beans.PropertyEditor for converting MultipartFiles to Strings.

Allows one to specify the charset to use.

Author
Juergen Hoeller
Since
13.10.2003

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
public
StringMultipartFileEditor()

Create a new StringMultipartFileEditor, using the default charset.

public
StringMultipartFileEditor(String
valid charset name
charsetName
)

Create a new StringMultipartFileEditor, using the given charset.

Method Summary

Modifier and TypeMethod and Description
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.
public void
setValue(Object
The new target object to be edited. Note that this object should not be modified by the PropertyEditor, rather the PropertyEditor should create a new object to hold any modified value.
value
)

Overrides java.beans.PropertyEditorSupport.setValue.

Implements java.beans.PropertyEditor.setValue.

Set (or change) the object that is to be edited.
Inherited from java.beans.PropertyEditorSupport:
addPropertyChangeListenerfirePropertyChangegetAsTextgetCustomEditorgetJavaInitializationStringgetSourcegetTagsgetValueisPaintablepaintValueremovePropertyChangeListenersetSourcesupportsCustomEditor

Field Detail

charsetNameback to summary
private final String charsetName
Annotations
@Nullable

Constructor Detail

StringMultipartFileEditorback to summary
public StringMultipartFileEditor()

Create a new StringMultipartFileEditor, using the default charset.

StringMultipartFileEditorback to summary
public StringMultipartFileEditor(String charsetName)

Create a new StringMultipartFileEditor, using the given charset.

Parameters
charsetName:String

valid charset name

See Also
java.lang.String#String(byte[], String)

Method Detail

setAsTextback to summary
public void setAsText(String text)

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
setValueback to summary
public void setValue(Object value)

Overrides java.beans.PropertyEditorSupport.setValue.

Implements java.beans.PropertyEditor.setValue.

Doc from java.beans.PropertyEditorSupport.setValue.

Set (or change) the object that is to be edited.

Parameters
value:Object

The new target object to be edited. Note that this object should not be modified by the PropertyEditor, rather the PropertyEditor should create a new object to hold any modified value.

Annotations
@Override