nl.knowlogy.validation.validators
Class CustomPropertyValidator

java.lang.Object
  extended by nl.knowlogy.validation.validators.BasePropertyValidator
      extended by nl.knowlogy.validation.validators.CustomPropertyValidator
All Implemented Interfaces:
PropertyValidation

public class CustomPropertyValidator
extends BasePropertyValidator

Author:
Robert Hofstra, Knowlogy

Field Summary
 
Fields inherited from class nl.knowlogy.validation.validators.BasePropertyValidator
logger
 
Constructor Summary
CustomPropertyValidator(ClassValidator classValidator, String propertyName)
           
CustomPropertyValidator(ClassValidator classValidator, String propertyName, String customValidatorName)
           
CustomPropertyValidator(ClassValidator classValidator, String propertyName, String customValidatorName, String errorCode)
           
 
Method Summary
 void doValidatePropertyValue(Object toValidate, Object propertyValue, Messages errors)
          Validates the property value of object obj.
 String getCustomValidatorName()
           
 String getDefaultErrorCode()
           
 void setCustomValidator(CustomValidator customValidator)
           
 void setCustomValidatorName(String customValidatorName)
           
 String toString()
           
 
Methods inherited from class nl.knowlogy.validation.validators.BasePropertyValidator
getErrorCode, getPropertyName, setErrorCode, setPropertyName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CustomPropertyValidator

public CustomPropertyValidator(ClassValidator classValidator,
                               String propertyName)

CustomPropertyValidator

public CustomPropertyValidator(ClassValidator classValidator,
                               String propertyName,
                               String customValidatorName)

CustomPropertyValidator

public CustomPropertyValidator(ClassValidator classValidator,
                               String propertyName,
                               String customValidatorName,
                               String errorCode)
Method Detail

getCustomValidatorName

public String getCustomValidatorName()
Returns:
Returns the customValidatorName.

setCustomValidatorName

public void setCustomValidatorName(String customValidatorName)
Parameters:
customValidatorName - The customValidatorName to set.

setCustomValidator

public void setCustomValidator(CustomValidator customValidator)

getDefaultErrorCode

public String getDefaultErrorCode()
Specified by:
getDefaultErrorCode in class BasePropertyValidator

doValidatePropertyValue

public void doValidatePropertyValue(Object toValidate,
                                    Object propertyValue,
                                    Messages errors)
Description copied from interface: PropertyValidation
Validates the property value of object obj. In case of any validation errors, an they are added to the errors object.

errors - errors object to which any validation errors are added.

toString

public String toString()
Overrides:
toString in class BasePropertyValidator


Copyright © 2007. All Rights Reserved.