JBoss Common Beans 1.1.0.Final-redhat-1

org.jboss.common.beans.property
Class GenericArrayPropertyEditor<T>

java.lang.Object
  extended by java.beans.PropertyEditorSupport
      extended by org.jboss.common.beans.property.PropertyEditorSupport<T>
          extended by org.jboss.common.beans.property.GenericArrayPropertyEditor<T>
All Implemented Interfaces:
PropertyEditor
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 in PropertyEditorManager. It is created at runtime in following condition:

Author:
baranowb

Constructor Summary
GenericArrayPropertyEditor(Class<T> initType)
           
 
Method Summary
protected  String encode(String[] v)
           
 String getAsText()
          Gets the property value as text.
protected  Class<?> getCellType()
           
protected  ArrayTokenizer getTokenizer()
           
 void setAsText(String text)
          Set the property value by parsing a given String.
protected  String[] tokenize(String text)
           
 
Methods inherited from class org.jboss.common.beans.property.PropertyEditorSupport
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, getType, getValue, removePropertyChangeListener, removePropertyChangeListener, setValue
 
Methods inherited from class java.beans.PropertyEditorSupport
firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, isPaintable, paintValue, setSource, supportsCustomEditor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericArrayPropertyEditor

public GenericArrayPropertyEditor(Class<T> initType)
Parameters:
type -
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Description copied from interface: PropertyEditor
Set 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:
setAsText in interface PropertyEditor
Specified by:
setAsText in class PropertyEditorSupport<T>
Parameters:
text - The string to be parsed.
Throws:
IllegalArgumentException

getAsText

public String getAsText()
Description copied from interface: PropertyEditor
Gets the property value as text.

Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport<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 String[] tokenize(String text)

encode

protected String encode(String[] v)

getCellType

protected Class<?> getCellType()

getTokenizer

protected ArrayTokenizer getTokenizer()

JBoss Common Beans 1.1.0.Final-redhat-1

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.