Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.util.validator
Class DigitCountValidator

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

public class DigitCountValidator
extends AbstractValidator

Validator for digit counts. As in (http://www.w3.org/TR/xmlschema-2/#rf-totalDigits and http://www.w3.org/TR/xmlschema-2/#rf-fractionDigits)

Author:
Kai Schwierczek

Nested Class Summary
static class DigitCountValidator.Type
          Type specifies what DigitCountValidator should check.
 
Constructor Summary
DigitCountValidator(DigitCountValidator.Type type, int length)
          Construct a validator that checks the digit count of the input to match the given type and value.
 
Method Summary
 String getDescription()
          Returns a human readable representation of this Validator.
 String validate(Object value)
          Checks whether the given value is valid.
 
Methods inherited from class eu.esdihumboldt.util.validator.AbstractValidator
getObjectAs, isAlwaysTrue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DigitCountValidator

public DigitCountValidator(DigitCountValidator.Type type,
                           int length)
Construct a validator that checks the digit count of the input to match the given type and value.

Parameters:
type - the digits to check for
length - the length to check for
Method Detail

validate

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

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.

Returns:
a human readable representation of this Validator
See Also:
Validator.getDescription()

Humboldt Alignment Editor 2.5.0

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