com.softwareag.centrasite.appl.framework.validation.impl
Class Validator

java.lang.Object
  extended by com.softwareag.centrasite.appl.framework.validation.impl.Validator

public class Validator
extends java.lang.Object

The validator is used to validate a control containers constraints.


Nested Class Summary
static class Validator.ErrorInfo
          The validator is collecting instances of this data bean, which holds a single validation constraints information.
static interface Validator.ValidationController
          Interface of a ValidatableContainer, or a Validatable, which would like to control the context, befor it is validated.
 
Constructor Summary
Validator()
          Creates a new validator.
Validator(boolean pCheckingReadOnly, boolean pValidating)
          Creates a new validator with the given settings.
 
Method Summary
protected  java.lang.String getSourceName(Constraint.Context pContext, java.lang.Object pSource)
          Calculates the given source objects name.
static Validatable getValidatable(Constraint.Context pContext)
          Reads the Validatable from the given Constraint.Context.
static ValidatableContainer getValidatableContainer(Constraint.Context pContext)
          Reads the ValidatableContainer from the given Constraint.Context.
 ValidatableFactory getValidatableFactory()
           
protected  void init(java.util.List<Validator.ErrorInfo> pResult)
          Called to initialize the validator.
 boolean isCheckingReadOnly()
           
 boolean isValidating()
           
 void setCheckingReadOnly(boolean checkingReadOnly)
           
 void setValidatable(Validatable pValidatable)
          Sets the Validatable, which is currently being checked, in the given Constraint.Context.
 void setValidatableContainer(ValidatableContainer pValidatableContainer)
          Sets the ValidatableContainer, which is currently being checked, in the given Constraint.Context.
 void setValidating(boolean validating)
           
 java.util.List<Validator.ErrorInfo> validate(java.util.Collection<?> pBeans)
          Performs the validation and returns the result.
 java.util.List<Validator.ErrorInfo> validate(java.util.Collection<?> pBeans, ValidationDefaults pValidationDefaults)
          Performs the validation and returns the result using the provided validation defaults.
protected  void validate(java.util.Collection<Validatable> pValidatables)
          Called to validate the given container of constraints.
 java.util.List<Validator.ErrorInfo> validate(Constraint.Context pContext, java.util.Collection<Validatable> pValidatables)
          Performs the validation and returns the result.
protected  void validate(Validatable pValidatable)
          Called to validate the given Validatable.
protected  void validate(ValidatableContainer pValidatableContainer)
          Called to validate the given ValidatableContainer.
protected  void validateContainers(java.util.Collection<ValidatableContainer> pValidatableContainers)
          Called to validate the given container of validatables.
 java.util.List<Validator.ErrorInfo> validateContainers(Constraint.Context pContext, java.util.Collection<ValidatableContainer> pValidatableContainers)
          Performs the validation and returns the result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Validator

public Validator()
Creates a new validator.


Validator

public Validator(boolean pCheckingReadOnly,
                 boolean pValidating)
Creates a new validator with the given settings.

Method Detail

isCheckingReadOnly

public boolean isCheckingReadOnly()
Returns:
the checkingReadOnly

setCheckingReadOnly

public void setCheckingReadOnly(boolean checkingReadOnly)
Parameters:
checkingReadOnly - the checkingReadOnly to set

isValidating

public boolean isValidating()
Returns:
the validating

setValidating

public void setValidating(boolean validating)
Parameters:
validating - the validating to set

getValidatable

public static final Validatable getValidatable(Constraint.Context pContext)
Reads the Validatable from the given Constraint.Context. The Validator is setting the validatable in the context upon the invocation of validate(Validatable).


getValidatableContainer

public static final ValidatableContainer getValidatableContainer(Constraint.Context pContext)
Reads the ValidatableContainer from the given Constraint.Context. The Validator is setting the validatable in the context upon the invocation of validate(ValidatableContainer).


validate

public java.util.List<Validator.ErrorInfo> validate(Constraint.Context pContext,
                                                    java.util.Collection<Validatable> pValidatables)
                                             throws com.softwareag.centrasite.appl.framework.CSAppFrameworkException
Performs the validation and returns the result.

Throws:
com.softwareag.centrasite.appl.framework.CSAppFrameworkException

validate

public java.util.List<Validator.ErrorInfo> validate(java.util.Collection<?> pBeans)
                                             throws com.softwareag.centrasite.appl.framework.CSAppFrameworkException
Performs the validation and returns the result.

Throws:
com.softwareag.centrasite.appl.framework.CSAppFrameworkException

validate

public java.util.List<Validator.ErrorInfo> validate(java.util.Collection<?> pBeans,
                                                    ValidationDefaults pValidationDefaults)
                                             throws com.softwareag.centrasite.appl.framework.CSAppFrameworkException
Performs the validation and returns the result using the provided validation defaults.

Throws:
com.softwareag.centrasite.appl.framework.CSAppFrameworkException

getValidatableFactory

public ValidatableFactory getValidatableFactory()

validateContainers

public java.util.List<Validator.ErrorInfo> validateContainers(Constraint.Context pContext,
                                                              java.util.Collection<ValidatableContainer> pValidatableContainers)
                                                       throws com.softwareag.centrasite.appl.framework.CSAppFrameworkException
Performs the validation and returns the result.

Throws:
com.softwareag.centrasite.appl.framework.CSAppFrameworkException

getSourceName

protected java.lang.String getSourceName(Constraint.Context pContext,
                                         java.lang.Object pSource)
Calculates the given source objects name.


init

protected void init(java.util.List<Validator.ErrorInfo> pResult)
Called to initialize the validator.


validate

protected void validate(java.util.Collection<Validatable> pValidatables)
                 throws com.softwareag.centrasite.appl.framework.CSAppFrameworkException
Called to validate the given container of constraints.

Throws:
com.softwareag.centrasite.appl.framework.CSAppFrameworkException

validateContainers

protected void validateContainers(java.util.Collection<ValidatableContainer> pValidatableContainers)
                           throws com.softwareag.centrasite.appl.framework.CSAppFrameworkException
Called to validate the given container of validatables.

Throws:
com.softwareag.centrasite.appl.framework.CSAppFrameworkException

validate

protected void validate(ValidatableContainer pValidatableContainer)
                 throws com.softwareag.centrasite.appl.framework.CSAppFrameworkException
Called to validate the given ValidatableContainer.

Throws:
com.softwareag.centrasite.appl.framework.CSAppFrameworkException

validate

protected void validate(Validatable pValidatable)
                 throws com.softwareag.centrasite.appl.framework.CSAppFrameworkException
Called to validate the given Validatable.

Throws:
com.softwareag.centrasite.appl.framework.CSAppFrameworkException

setValidatable

public final void setValidatable(Validatable pValidatable)
Sets the Validatable, which is currently being checked, in the given Constraint.Context.


setValidatableContainer

public final void setValidatableContainer(ValidatableContainer pValidatableContainer)
Sets the ValidatableContainer, which is currently being checked, in the given Constraint.Context.