Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.util.validator
Class AndValidator

java.lang.Object
  extended by eu.esdihumboldt.util.validator.AndValidator
All Implemented Interfaces:
Validator

public class AndValidator
extends Object
implements Validator

Validator that only checks whether all of its known validators validate the given input.

Author:
Kai Schwierczek

Constructor Summary
AndValidator(Collection<Validator> validators)
          Constructs an AndValidator with the given validators.
 
Method Summary
 String getDescription()
          Returns a human readable representation of this Validator.
 boolean isAlwaysTrue()
          Returns true, if this Validator validates all values to true.
The result must not necessarily be correct.
 String validate(Object value)
          Checks whether the given value is valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AndValidator

public AndValidator(Collection<Validator> validators)
Constructs an AndValidator with the given validators.

Parameters:
validators - the validators.
Method Detail

validate

public String validate(Object value)
Description copied from interface: Validator
Checks whether the given value is valid.

Specified by:
validate in interface Validator
Parameters:
value - the value to check
Returns:
null, if the value is valid, otherwise the reason why it's invalid
See Also:
Validator.validate(Object)

getDescription

public String getDescription()
Description copied from interface: Validator
Returns a human readable representation of this Validator.

Specified by:
getDescription in interface Validator
Returns:
a human readable representation of this Validator
See Also:
Validator.getDescription()

isAlwaysTrue

public boolean isAlwaysTrue()
Description copied from interface: Validator
Returns true, if this Validator validates all values to true.
The result must not necessarily be correct. If the validator does not know its result for sure it must return false.

Specified by:
isAlwaysTrue in interface Validator
Returns:
true, iff the validator knows for sure, that it validates all values to true
See Also:
Validator.isAlwaysTrue()

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d