com.avaje.ebean.validation.factory
Interface Validator

All Known Implementing Classes:
AssertFalseValidatorFactory.AssertFalseValidator, AssertTrueValidatorFactory.AssertTrueValidator, EmailValidatorFactory.EmailValidator, LengthValidatorFactory.LengthValidator, NoAttributesValidator, NotNullValidatorFactory.NotNullValidator

public interface Validator

Executes validation on a bean.

This can be assigned to a bean property or the bean itself.


Method Summary
 Object[] getAttributes()
          Return attribute values of the validator for use in building a error message (such as the actual min and max for Length).
 String getKey()
          Return a String key used to identify the validator.
 boolean isValid(Object value)
          Return true if the value is valid.
 

Method Detail

getKey

String getKey()
Return a String key used to identify the validator.

This is used to identify the type of validation error and look up a localised error message.


getAttributes

Object[] getAttributes()
Return attribute values of the validator for use in building a error message (such as the actual min and max for Length). This should return an empty array if there are no attributes (such as for NotNull).


isValid

boolean isValid(Object value)
Return true if the value is valid.

Parameters:
value - the property value being tested.


Copyright © 2010. All Rights Reserved.