public class TaggedPropertyEditor
extends java.beans.PropertyEditorSupport
A PropertyEditor implementation that wraps an existing PropertyEditor but adds the ability to map text values to/from a set of allowed tag values.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION |
Constructor and Description |
---|
TaggedPropertyEditor(java.lang.String[] pTags)
Construct a TaggedPropertyEditor that edits Strings
accepts a given set of tags that *are* the underlying property values.
|
TaggedPropertyEditor(java.lang.String[] pTags,
java.lang.Object pTagValues)
Construct a TaggedPropertyEditor that maps between the given set
of tags and underlying property values, assuming that there is
already a non-tagged editor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAsText() |
java.lang.String[] |
getTags()
If the property value must be one of a set of known tagged values,
then this method should return an array of the tags.
|
void |
setAsText(java.lang.String text)
Set the property value by parsing a given String.
|
void |
setTags(java.lang.String[] pTags)
Sets tags
|
void |
setTagValues(java.lang.Object pTagValues)
Sets tag values
|
public TaggedPropertyEditor(java.lang.String[] pTags, java.lang.Object pTagValues)
public TaggedPropertyEditor(java.lang.String[] pTags)
public void setTags(java.lang.String[] pTags)
pTagValues
- public void setTagValues(java.lang.Object pTagValues)
pTagValues
- public java.lang.String getAsText()
getAsText
in interface java.beans.PropertyEditor
getAsText
in class java.beans.PropertyEditorSupport
Returns null if the value can't be expressed as an editable string.
If a non-null value is returned, then the PropertyEditor should be prepared to parse that string back in setAsText().
public void setAsText(java.lang.String text) throws java.lang.IllegalArgumentException
setAsText
in interface java.beans.PropertyEditor
setAsText
in class java.beans.PropertyEditorSupport
text
- The string to be parsed.java.lang.IllegalArgumentException
public java.lang.String[] getTags()
getTags
in interface java.beans.PropertyEditor
getTags
in class java.beans.PropertyEditorSupport