|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpl.edu.agh.cast.data.model.property.validator.PropertyValidator
public abstract class PropertyValidator
Class responsible for validating type of property. Each validator is associated with a specified
PropertyType
.
Constructor Summary | |
---|---|
PropertyValidator()
|
Method Summary | |
---|---|
protected abstract boolean |
checkFormat(String value)
|
protected abstract Object |
convert(String value)
|
Object |
convertFromStringFormat(String value)
Converts from string representation of property type to its object representation (e.g. |
String |
convertToStringFormat(Object value)
Returns a string representation of the value. |
abstract Class<?> |
getTypeClass()
Gets class associated with specific property type. |
boolean |
isValidClass(Object value)
Checks if object is valid type for specific property type. |
boolean |
isValidStringFormat(String value)
Checks if string representation can be converted to object type (e.g. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertyValidator()
Method Detail |
---|
protected abstract boolean checkFormat(String value)
protected abstract Object convert(String value)
public abstract Class<?> getTypeClass()
public boolean isValidStringFormat(String value)
String
has valid
Date
format).
value
- the value to format
true
if can be converted; false
otherwisepublic Object convertFromStringFormat(String value)
String
->
Date
).
value
- the string value to convert from
public String convertToStringFormat(Object value)
convertFromStringFormat(String)
.
value
- the object to convert
public boolean isValidClass(Object value)
value
- the value to check
true
if class is valid; false
otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |