com.acsinet_solutions.util.validator
Class AbstractValidator

java.lang.Object
  extended by com.acsinet_solutions.util.validator.AbstractValidator
All Implemented Interfaces:
Validator

public abstract class AbstractValidator
extends java.lang.Object
implements Validator

A base for generic validators. Provides a basic framework for the definition o validator objects

Author:
Santiago Arriaga - santiago.arriaga@acsinet-solutions.com

Constructor Summary
AbstractValidator()
           
 
Method Summary
 void performInsertValidations(ValidationIssueBuilder builder, java.lang.Object obj)
          By default this method calls validate() generic method, but this implementation is overridable if separate insert and update validations are needed.
 void performUpdateValidations(ValidationIssueBuilder builder, java.lang.Object obj)
          By default this method calls validate() generic method, but this implementation is overridable if separate insert and update validations are needed.
 void validate(ValidationIssueBuilder builder, java.lang.Object obj)
          Generic validate method.
 void validateInsert(java.lang.Object obj)
          This method creates a ValidationIssueBuilder and calls the performInsertValidations() method.
 void validateUpdate(java.lang.Object obj)
          This method creates a ValidationIssueBuilder and calls the performUpdateValidations() method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractValidator

public AbstractValidator()
Method Detail

validateInsert

public final void validateInsert(java.lang.Object obj)
                          throws ValidationException,
                                 SystemException
This method creates a ValidationIssueBuilder and calls the performInsertValidations() method. This method is not overridable. If during validation any issue is added to the issue builder, a ValidationException is thrown, with the given issues.

Specified by:
validateInsert in interface Validator
Throws:
ValidationException
SystemException

validateUpdate

public final void validateUpdate(java.lang.Object obj)
                          throws ValidationException,
                                 SystemException
This method creates a ValidationIssueBuilder and calls the performUpdateValidations() method. This method is not overridable. If during validation any issue is added to the issue builder, a ValidationException is thrown, with the given issues.

Specified by:
validateUpdate in interface Validator
Throws:
ValidationException
SystemException

performInsertValidations

public void performInsertValidations(ValidationIssueBuilder builder,
                                     java.lang.Object obj)
                              throws SystemException
By default this method calls validate() generic method, but this implementation is overridable if separate insert and update validations are needed.

Specified by:
performInsertValidations in interface Validator
Throws:
SystemException

performUpdateValidations

public void performUpdateValidations(ValidationIssueBuilder builder,
                                     java.lang.Object obj)
                              throws SystemException
By default this method calls validate() generic method, but this implementation is overridable if separate insert and update validations are needed.

Specified by:
performUpdateValidations in interface Validator
Throws:
SystemException

validate

public void validate(ValidationIssueBuilder builder,
                     java.lang.Object obj)
              throws SystemException
Generic validate method. For simple or generic validation behavior, override this method.

Specified by:
validate in interface Validator
Throws:
SystemException