|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.bval.jsr303.ConstraintValidation<T>
public class ConstraintValidation<T extends Annotation>
Description: Adapter between Constraint (JSR303) and Validation (Core)
this instance is immutable!
Constructor Summary | |
---|---|
ConstraintValidation(Class<? extends ConstraintValidator<T,?>>[] validatorClasses,
ConstraintValidator<T,?> validator,
T annotation,
Class<?> owner,
AccessStrategy access,
boolean reportFromComposite)
Create a new ConstraintValidation instance. |
Method Summary | ||
---|---|---|
void |
addComposed(ConstraintValidation<?> aConstraintValidation)
Add a composing constraint. |
|
ConstraintDescriptor<T> |
asSerializableDescriptor()
Return a Serializable ConstraintDescriptor capturing a
snapshot of current state. |
|
AccessStrategy |
getAccess()
Get the AccessStrategy used by this ConstraintValidation . |
|
T |
getAnnotation()
|
|
Map<String,Object> |
getAttributes()
|
|
Set<ConstraintDescriptor<?>> |
getComposingConstraints()
|
|
(package private) Set<ConstraintValidation<?>> |
getComposingValidations()
Get the composing ConstraintValidation objects. |
|
List<Class<? extends ConstraintValidator<T,?>>> |
getConstraintValidatorClasses()
|
|
Set<Class<?>> |
getGroups()
|
|
String |
getMessageTemplate()
Get the message template used by this constraint. |
|
Class<?> |
getOwner()
Get the owning class of this ConstraintValidation . |
|
Set<Class<? extends Payload>> |
getPayload()
|
|
ConstraintValidator<T,?> |
getValidator()
Get the ConstraintValidator invoked by this
ConstraintValidation . |
|
void |
initialize()
Initialize the validator (if not null ) with the stored
annotation. |
|
protected boolean |
isMemberOf(Class<?> reqGroup)
Learn whether this ConstraintValidation belongs to the specified
group. |
|
boolean |
isReportAsSingleViolation()
|
|
void |
setAnnotation(T annotation)
Override the Annotation set at construction. |
|
(package private) void |
setGroups(Set<Class<?>> groups)
Set the applicable validation groups. |
|
(package private) void |
setPayload(Set<Class<? extends Payload>> payload)
Set the payload. |
|
String |
toString()
|
|
void |
validate(GroupValidationContext<?> context)
Validate a GroupValidationContext . |
|
|
validate(ValidationContext<L> context)
Perform a single validation routine. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ConstraintValidation(Class<? extends ConstraintValidator<T,?>>[] validatorClasses, ConstraintValidator<T,?> validator, T annotation, Class<?> owner, AccessStrategy access, boolean reportFromComposite)
validatorClasses
- validator
- - the constraint validatorannotation
- - the annotation of the constraintowner
- - the type where the annotated element is placed (class,
interface, annotation type)access
- - how to access the valuereportFromComposite
- Method Detail |
---|
public ConstraintDescriptor<T> asSerializableDescriptor()
Serializable
ConstraintDescriptor
capturing a
snapshot of current state.
ConstraintDescriptor
void setGroups(Set<Class<?>> groups)
groups
- void setPayload(Set<Class<? extends Payload>> payload)
payload
- public boolean isReportAsSingleViolation()
isReportAsSingleViolation
in interface ConstraintDescriptor<T extends Annotation>
public void addComposed(ConstraintValidation<?> aConstraintValidation)
aConstraintValidation
- to addpublic <L extends ValidationListener> void validate(ValidationContext<L> context)
validate
in interface Validation
context
- - to access the property, value, constraintspublic void validate(GroupValidationContext<?> context)
GroupValidationContext
.
context
- rootpublic void initialize()
null
) with the stored
annotation.
public String toString()
toString
in class Object
public String getMessageTemplate()
public ConstraintValidator<T,?> getValidator()
ConstraintValidator
invoked by this
ConstraintValidation
.
protected boolean isMemberOf(Class<?> reqGroup)
ConstraintValidation
belongs to the specified
group.
reqGroup
-
public Class<?> getOwner()
ConstraintValidation
.
public T getAnnotation()
getAnnotation
in interface ConstraintDescriptor<T extends Annotation>
public AccessStrategy getAccess()
AccessStrategy
used by this ConstraintValidation
.
AccessStrategy
public void setAnnotation(T annotation)
annotation
- public Map<String,Object> getAttributes()
getAttributes
in interface ConstraintDescriptor<T extends Annotation>
public Set<ConstraintDescriptor<?>> getComposingConstraints()
getComposingConstraints
in interface ConstraintDescriptor<T extends Annotation>
Set<ConstraintValidation<?>> getComposingValidations()
ConstraintValidation
objects. This is
effectively an implementation-specific analogue to
getComposingConstraints()
.
Set
of ConstraintValidation
public Set<Class<?>> getGroups()
getGroups
in interface ConstraintDescriptor<T extends Annotation>
public Set<Class<? extends Payload>> getPayload()
getPayload
in interface ConstraintDescriptor<T extends Annotation>
public List<Class<? extends ConstraintValidator<T,?>>> getConstraintValidatorClasses()
getConstraintValidatorClasses
in interface ConstraintDescriptor<T extends Annotation>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |