net.sf.oval.constraint
Class AssertValidCheck

java.lang.Object
  extended by net.sf.oval.AbstractCheck
      extended by net.sf.oval.configuration.annotation.AbstractAnnotationCheck<AssertValid>
          extended by net.sf.oval.constraint.AssertValidCheck
All Implemented Interfaces:
Serializable, Check, AnnotationCheck<AssertValid>

public class AssertValidCheck
extends AbstractAnnotationCheck<AssertValid>

Author:
Sebastian Thomschke
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sf.oval.AbstractCheck
errorCode, message, profiles, severity
 
Constructor Summary
AssertValidCheck()
           
 
Method Summary
 void configure(AssertValid constraintAnnotation)
          Configures the check based on the given constraint annotation.
 boolean isRequireValidElements()
           
 boolean isSatisfied(Object validatedObject, Object valueToValidate, OValContext context, Validator validator)
          This method is not used.
 void setRequireValidElements(boolean requireValidElements)
          Specifies if all the elements of a collection must be valid.
 
Methods inherited from class net.sf.oval.AbstractCheck
createMessageVariables, getErrorCode, getMessage, getMessageVariables, getProfiles, getSeverity, requireMessageVariablesRecreation, setErrorCode, setMessage, setProfiles, setSeverity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.oval.Check
getErrorCode, getMessage, getMessageVariables, getProfiles, getSeverity, setErrorCode, setMessage, setProfiles, setSeverity
 

Constructor Detail

AssertValidCheck

public AssertValidCheck()
Method Detail

configure

public void configure(AssertValid constraintAnnotation)
Configures the check based on the given constraint annotation.

Specified by:
configure in interface AnnotationCheck<AssertValid>
Overrides:
configure in class AbstractAnnotationCheck<AssertValid>
Parameters:
constraintAnnotation - the constraint annotation to use for configuration

isRequireValidElements

public boolean isRequireValidElements()
Returns:
true if all elements of a collection must be valid

isSatisfied

public boolean isSatisfied(Object validatedObject,
                           Object valueToValidate,
                           OValContext context,
                           Validator validator)
                    throws UnsupportedOperationException
This method is not used.
The validation of this special constraint is directly performed by the Validator class

Parameters:
validatedObject - the object/bean to validate the value against, for static fields or methods this is the class
valueToValidate - the value to validate, may be null when validating pre conditions for static methods
context - the validation context (e.g. a field, a constructor parameter or a method parameter)
validator - the calling validator
Returns:
true if the value satisfies the checked constraint
Throws:
UnsupportedOperationException - always thrown if this method is invoked

setRequireValidElements

public void setRequireValidElements(boolean requireValidElements)
Specifies if all the elements of a collection must be valid.



Copyright © 2008 The OVal Development Team. All Rights Reserved.