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

public Class PatternEditor

extends PropertyEditorSupport
Class Inheritance
Imports
java.beans.PropertyEditorSupport, java.util.regex.Pattern, org.springframework.lang.Nullable

Editor for java.util.regex.Pattern, to directly populate a Pattern property. Expects the same syntax as Pattern's compile method.
Author
Juergen Hoeller
Since
2.0.1
See Also
java.util.regex.Pattern, java.util.regex.Pattern#compile(String)

Field Summary

Modifier and TypeField and Description
private final int

Constructor Summary

AccessConstructor and Description
public
PatternEditor()

Create a new PatternEditor with default settings.

public
PatternEditor(int
the java.util.regex.Pattern flags to apply
flags
)

Create a new PatternEditor with the given settings.

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

flagsback to summary
private final int flags

Constructor Detail

PatternEditorback to summary
public PatternEditor()

Create a new PatternEditor with default settings.

PatternEditorback to summary
public PatternEditor(int flags)

Create a new PatternEditor with the given settings.

Parameters
flags:int

the java.util.regex.Pattern flags to apply

See Also
java.util.regex.Pattern#compile(String, int), java.util.regex.Pattern#CASE_INSENSITIVE, java.util.regex.Pattern#MULTILINE, java.util.regex.Pattern#DOTALL, java.util.regex.Pattern#UNICODE_CASE, java.util.regex.Pattern#CANON_EQ

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)

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