pl.edu.agh.cast.data.model.property.validator
Class TextArrayPropertyValidator

java.lang.Object
  extended by pl.edu.agh.cast.data.model.property.validator.PropertyValidator
      extended by pl.edu.agh.cast.data.model.property.validator.TextArrayPropertyValidator

public class TextArrayPropertyValidator
extends PropertyValidator

Class for validating array of text strings property types.

The string representation of the array is a semicolon-separated list. When converting from string, empty strings are ignored, and all strings (both input and output) are trimmed.

For example, the following string: "   asdf, asdf  ; foo  ;bar   ; ;  end of list,:&  " will be converted to the following array:

Author:
AGH CAST Team

Constructor Summary
TextArrayPropertyValidator()
           
 
Method Summary
protected  boolean checkFormat(String value)
          
protected  Object convert(String value)
          
 String convertToStringFormat(Object value)
          Returns a string representation of the value.
 Class<?> getTypeClass()
          Gets class associated with specific property type.
 
Methods inherited from class pl.edu.agh.cast.data.model.property.validator.PropertyValidator
convertFromStringFormat, isValidClass, isValidStringFormat
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextArrayPropertyValidator

public TextArrayPropertyValidator()
Method Detail

checkFormat

protected boolean checkFormat(String value)

Specified by:
checkFormat in class PropertyValidator
See Also:
PropertyValidator.checkFormat(java.lang.String)

convert

protected Object convert(String value)

Specified by:
convert in class PropertyValidator
See Also:
PropertyValidator.convert(java.lang.String)

getTypeClass

public Class<?> getTypeClass()
Gets class associated with specific property type.

Specified by:
getTypeClass in class PropertyValidator
Returns:
class associated with property type
See Also:
PropertyValidator.getTypeClass()

convertToStringFormat

public String convertToStringFormat(Object value)
Returns a string representation of the value. Should be symmetrical to PropertyValidator.convertFromStringFormat(String).

Overrides:
convertToStringFormat in class PropertyValidator
Parameters:
value - the object to convert
Returns:
string representation of the object
See Also:
AttributeValidator.convertToStringFormat(java.lang.Object)


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.