org.apache.myfaces.extensions.cdi.bv.api
Class ClassLevelValidator<A extends java.lang.annotation.Annotation,T>
java.lang.Object
org.apache.myfaces.extensions.cdi.bv.api.ClassLevelValidator<A,T>
- All Implemented Interfaces:
- java.io.Serializable, javax.validation.ConstraintValidator<A,T>
public abstract class ClassLevelValidator<A extends java.lang.annotation.Annotation,T>
- extends java.lang.Object
- implements javax.validation.ConstraintValidator<A,T>, java.io.Serializable
Required if 'invalidValue' should be used for violation messages for class-level validation.
- Author:
- Gerhard Petracek
- See Also:
- Serialized Form
Method Summary |
protected java.lang.String |
createMessage(java.io.Serializable invalidValue,
java.lang.String messageDescriptor)
|
protected abstract java.io.Serializable |
getInvalidValue()
|
protected java.lang.String |
getMessageDescriptor()
|
void |
initialize(A constraint)
|
boolean |
isValid(T instance,
javax.validation.ConstraintValidatorContext constraintValidatorContext)
|
protected abstract boolean |
isValidInstance(T t,
javax.validation.ConstraintValidatorContext constraintValidatorContext)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
constraint
protected A extends java.lang.annotation.Annotation constraint
ClassLevelValidator
public ClassLevelValidator()
initialize
public void initialize(A constraint)
-
- Specified by:
initialize
in interface javax.validation.ConstraintValidator<A extends java.lang.annotation.Annotation,T>
isValid
public boolean isValid(T instance,
javax.validation.ConstraintValidatorContext constraintValidatorContext)
-
- Specified by:
isValid
in interface javax.validation.ConstraintValidator<A extends java.lang.annotation.Annotation,T>
createMessage
protected java.lang.String createMessage(java.io.Serializable invalidValue,
java.lang.String messageDescriptor)
getMessageDescriptor
protected java.lang.String getMessageDescriptor()
isValidInstance
protected abstract boolean isValidInstance(T t,
javax.validation.ConstraintValidatorContext constraintValidatorContext)
getInvalidValue
protected abstract java.io.Serializable getInvalidValue()
Copyright © 2010-2011 The Apache Software Foundation. All Rights Reserved.