Package org.jboss.common.beans.property
Class GenericArrayPropertyEditor<T>
- java.lang.Object
-
- java.beans.PropertyEditorSupport
-
- org.jboss.common.beans.property.PropertyEditorSupport<T>
-
- org.jboss.common.beans.property.GenericArrayPropertyEditor<T>
-
- All Implemented Interfaces:
java.beans.PropertyEditor,PropertyEditor<T>
- Direct Known Subclasses:
BooleanArrayEditor,ByteArrayEditor,CharacterArrayEditor,ClassArrayEditor,DoubleArrayEditor,FloatArrayEditor,InetAddressArrayEditor,IntegerArrayEditor,LongArrayEditor,ShortArrayEditor,StringArrayEditor
public class GenericArrayPropertyEditor<T> extends PropertyEditorSupport<T>
Generic array support editor. Depending on type of array it performs all required operations to transform from/to text. It requires array cell property editor to be present - ProperyEditorManager.findEditor(arrayClass.getComponentType()) != null
This class is not registered as property editor inPropertyEditorManager. It is created at runtime in following condition:- Any of
PropertyEditorsfetch methods is passed array type for which there is no editor -
PropertyEditorsorPropertyEditorManagercan access editor forClass.getComponentType().
-
-
Constructor Summary
Constructors Constructor Description GenericArrayPropertyEditor(java.lang.Class<T> initType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Stringencode(java.lang.String[] v)java.lang.StringgetAsText()Gets the property value as text.protected java.lang.Class<?>getCellType()protected ArrayTokenizergetTokenizer()voidsetAsText(java.lang.String text)Set the property value by parsing a given String.protected java.lang.String[]tokenize(java.lang.String text)-
Methods inherited from class org.jboss.common.beans.property.PropertyEditorSupport
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, getType, getValue, removePropertyChangeListener, removePropertyChangeListener, setValue
-
-
-
-
Constructor Detail
-
GenericArrayPropertyEditor
public GenericArrayPropertyEditor(java.lang.Class<T> initType)
- Parameters:
type-
-
-
Method Detail
-
setAsText
public void setAsText(java.lang.String text) throws java.lang.IllegalArgumentExceptionDescription copied from interface:PropertyEditorSet 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.- Specified by:
setAsTextin interfacejava.beans.PropertyEditor- Specified by:
setAsTextin interfacePropertyEditor<T>- Specified by:
setAsTextin classPropertyEditorSupport<T>- Parameters:
text- The string to be parsed.- Throws:
java.lang.IllegalArgumentException
-
getAsText
public java.lang.String getAsText()
Description copied from interface:PropertyEditorGets the property value as text.- Specified by:
getAsTextin interfacejava.beans.PropertyEditor- Specified by:
getAsTextin interfacePropertyEditor<T>- Overrides:
getAsTextin classPropertyEditorSupport<T>- Returns:
- The property value as a human editable string.
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().
-
tokenize
protected java.lang.String[] tokenize(java.lang.String text)
-
encode
protected java.lang.String encode(java.lang.String[] v)
-
getCellType
protected java.lang.Class<?> getCellType()
-
getTokenizer
protected ArrayTokenizer getTokenizer()
-
-