com.ca.jcs.validator.meta
Class EnumValueValidator

java.lang.Object
  extended by com.ca.jcs.validator.meta.EnumValueValidator
All Implemented Interfaces:
AttributeValidator

public class EnumValueValidator
extends Object
implements AttributeValidator

Validate that all of an attribute's values are valid against an enum defined in metadata. This class is the odd one out in this package, as it needs access to the DataModelProperty in its constructor but is only a humble AttributeValidator.


Constructor Summary
EnumValueValidator(DataModelValue val)
           
 
Method Summary
 ErrorMessages validate(Attribute attr)
          Validate the provided value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumValueValidator

public EnumValueValidator(DataModelValue val)
Method Detail

validate

public ErrorMessages validate(Attribute attr)
Description copied from interface: AttributeValidator
Validate the provided value.

Specified by:
validate in interface AttributeValidator
Parameters:
attr - Attribute whose values are to be validated.
Returns:
Null if all value have desired format, and otherwise one or more error messages where only their msgFormatId field needs to be set.


Created 2011-07-14 13:27 EST