Package org.openbravo.base.validation
Class StringPropertyValidator
- java.lang.Object
-
- org.openbravo.base.validation.BasePropertyValidator
-
- org.openbravo.base.validation.StringPropertyValidator
-
- All Implemented Interfaces:
PropertyValidator
public class StringPropertyValidator extends BasePropertyValidator
Validates string properties (e.g. the max field length of a string).- Author:
- mtaal
-
-
Constructor Summary
Constructors Constructor Description StringPropertyValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getFieldLength()
void
initialize()
void
setFieldLength(int fieldLength)
String
validate(Object value)
Validate the value against constraints implemented in the validator.-
Methods inherited from class org.openbravo.base.validation.BasePropertyValidator
getProperty, setProperty
-
-
-
-
Method Detail
-
getFieldLength
public int getFieldLength()
-
setFieldLength
public void setFieldLength(int fieldLength)
-
initialize
public void initialize()
-
validate
public String validate(Object value)
Description copied from interface:PropertyValidator
Validate the value against constraints implemented in the validator. If the validation fails a message is returned. If validation passes then null is returned.- Specified by:
validate
in interfacePropertyValidator
- Specified by:
validate
in classBasePropertyValidator
- Parameters:
value
- the value to check- Returns:
- null if validation passes, otherwise a validation message is returned
- See Also:
PropertyValidator.validate(Object)
-
-