javax.validation.metadata
Interface ConstraintDescriptor<T extends java.lang.annotation.Annotation>


public interface ConstraintDescriptor<T extends java.lang.annotation.Annotation>

Describes a single constraint and its composing constraints. T is the constraint's annotation type.

Author:
Emmanuel Bernard, Hardy Ferentschik

Method Summary
 T getAnnotation()
          Returns the annotation describing the constraint declaration.
 java.util.Map<java.lang.String,java.lang.Object> getAttributes()
          Returns a map containing the annotation attribute names as keys and the annotation attribute values as value.
 java.util.Set<ConstraintDescriptor<?>> getComposingConstraints()
          Return a set of composing ConstraintDescriptors where each descriptor describes a composing constraint.
 java.util.List<java.lang.Class<? extends ConstraintValidator<T,?>>> getConstraintValidatorClasses()
          List of the constraint validation implementation classes.
 java.util.Set<java.lang.Class<?>> getGroups()
          The set of groups the constraint is applied on.
 java.util.Set<java.lang.Class<? extends Payload>> getPayload()
          The set of payload the constraint hosts.
 boolean isReportAsSingleViolation()
           
 

Method Detail

getAnnotation

T getAnnotation()
Returns the annotation describing the constraint declaration. If a composing constraint, attribute values are reflecting the overridden attributes of the composing constraint

Returns:
The annotation for this constraint.

getGroups

java.util.Set<java.lang.Class<?>> getGroups()
The set of groups the constraint is applied on. If the constraint declares no group, a set with only the Default group is returned.

Returns:
The groups the constraint is applied on.

getPayload

java.util.Set<java.lang.Class<? extends Payload>> getPayload()
The set of payload the constraint hosts.

Returns:
payload classes hosted on the constraint or an empty set if none.

getConstraintValidatorClasses

java.util.List<java.lang.Class<? extends ConstraintValidator<T,?>>> getConstraintValidatorClasses()
List of the constraint validation implementation classes.

Returns:
list of the constraint validation implementation classes.

getAttributes

java.util.Map<java.lang.String,java.lang.Object> getAttributes()
Returns a map containing the annotation attribute names as keys and the annotation attribute values as value. If this constraint is used as part of a composed constraint, attribute values are reflecting the overridden attribute of the composing constraint.

Returns:
a map containing the annotation attribute names as keys and the annotation attribute values as value.

getComposingConstraints

java.util.Set<ConstraintDescriptor<?>> getComposingConstraints()
Return a set of composing ConstraintDescriptors where each descriptor describes a composing constraint. ConstraintDescriptor instances of composing constraints reflect overridden attribute values in getAttributes() and getAnnotation().

Returns:
a set of ConstraintDescriptor objects or an empty set in case there are no composing constraints.

isReportAsSingleViolation

boolean isReportAsSingleViolation()
Returns:
true if the constraint is annotated with @ReportAsSingleViolation


Submit a bug or feature

Copyright © 2009-2011, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.

Generated on 10-February-2011 12:41

Scripting on this page tracks web page traffic, but does not change the content in any way.