org.codehaus.enunciate.contract.validation
Class ValidatorChain

java.lang.Object
  extended by org.codehaus.enunciate.contract.validation.ValidatorChain
All Implemented Interfaces:
Validator

public class ValidatorChain
extends java.lang.Object
implements Validator

Chains a set of validators.

Author:
Ryan Heaton

Constructor Summary
ValidatorChain()
           
 
Method Summary
 void addValidator(java.lang.String label, Validator validator)
          Adds a validator.
 java.util.List<Validator> getValidators()
          Deprecated. Use the getValidatorsByLabel() method.
 java.util.Map<java.lang.String,Validator> getValidatorsByLabel()
          Get a map of labels-to-validators.
 ValidationResult validate(EnunciateFreemarkerModel model)
          Validate the model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidatorChain

public ValidatorChain()
Method Detail

getValidators

public java.util.List<Validator> getValidators()
Deprecated. Use the getValidatorsByLabel() method.

The list of validators in the chain.

Returns:
The list of validators in the chain.

getValidatorsByLabel

public java.util.Map<java.lang.String,Validator> getValidatorsByLabel()
Get a map of labels-to-validators.

Returns:
The map of validators-to-labels.

addValidator

public void addValidator(java.lang.String label,
                         Validator validator)
Adds a validator.

Parameters:
label - The label of the validator.
validator - The validator.

validate

public ValidationResult validate(EnunciateFreemarkerModel model)
Description copied from interface: Validator
Validate the model.

Specified by:
validate in interface Validator
Parameters:
model - The model to validate.
Returns:
The validation result.