net.sf.oval.constraint
Class InstanceOfCheck

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

public class InstanceOfCheck
extends AbstractAnnotationCheck<InstanceOf>

Author:
Sebastian Thomschke
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sf.oval.AbstractCheck
errorCode, message, profiles, severity
 
Constructor Summary
InstanceOfCheck()
           
 
Method Summary
 void configure(InstanceOf constraintAnnotation)
          Configures the check based on the given constraint annotation.
 Map<String,String> createMessageVariables()
           
 Class<?>[] getTypes()
           
 boolean isSatisfied(Object validatedObject, Object valueToValidate, OValContext context, Validator validator)
          This method implements the validation logic
 void setTypes(Class<?>... types)
           
 
Methods inherited from class net.sf.oval.AbstractCheck
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

InstanceOfCheck

public InstanceOfCheck()
Method Detail

configure

public void configure(InstanceOf constraintAnnotation)
Description copied from class: AbstractAnnotationCheck
Configures the check based on the given constraint annotation.

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

getTypes

public Class<?>[] getTypes()
Returns:
the type

isSatisfied

public boolean isSatisfied(Object validatedObject,
                           Object valueToValidate,
                           OValContext context,
                           Validator validator)
Description copied from interface: Check
This method implements the validation logic

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

setTypes

public void setTypes(Class<?>... types)
Parameters:
types - the types to set

createMessageVariables

public Map<String,String> createMessageVariables()
Overrides:
createMessageVariables in class AbstractCheck


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