org.hibernate.validator.internal.metadata.descriptor
Class ConstraintDescriptorImpl<T extends Annotation>

java.lang.Object
  extended by org.hibernate.validator.internal.metadata.descriptor.ConstraintDescriptorImpl<T>
All Implemented Interfaces:
Serializable, ConstraintDescriptor<T>

public class ConstraintDescriptorImpl<T extends Annotation>
extends Object
implements ConstraintDescriptor<T>, Serializable

Describes a single constraint (including it's composing constraints).

Author:
Emmanuel Bernard, Hardy Ferentschik, Federico Mancini, Dag Hovland
See Also:
Serialized Form

Nested Class Summary
static class ConstraintDescriptorImpl.ConstraintType
          The type of a constraint.
 
Constructor Summary
ConstraintDescriptorImpl(Member member, T annotation, ConstraintHelper constraintHelper, ElementType type, ConstraintOrigin definedOn)
           
ConstraintDescriptorImpl(T annotation, ConstraintHelper constraintHelper, Class<?> implicitGroup, ElementType type, ConstraintOrigin definedOn, Member member)
           
 
Method Summary
 boolean equals(Object o)
           
 T getAnnotation()
           
 Class<T> getAnnotationType()
           
 Map<String,Object> getAttributes()
           
 Set<ConstraintDescriptorImpl<?>> getComposingConstraintImpls()
           
 Set<ConstraintDescriptor<?>> getComposingConstraints()
           
 CompositionType getCompositionType()
           
 ConstraintDescriptorImpl.ConstraintType getConstraintType()
           
 List<Class<? extends ConstraintValidator<T,?>>> getConstraintValidatorClasses()
           
 ConstraintOrigin getDefinedOn()
           
 ElementType getElementType()
           
 Set<Class<?>> getGroups()
           
 List<Class<? extends ConstraintValidator<T,?>>> getMatchingConstraintValidatorClasses()
          Returns those validators registered with this constraint which apply to the given constraint type (either generic or cross-parameter).
 String getMessageTemplate()
           
 Set<Class<? extends Payload>> getPayload()
           
 ConstraintTarget getValidationAppliesTo()
           
 int hashCode()
           
 boolean isReportAsSingleViolation()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstraintDescriptorImpl

public ConstraintDescriptorImpl(T annotation,
                                ConstraintHelper constraintHelper,
                                Class<?> implicitGroup,
                                ElementType type,
                                ConstraintOrigin definedOn,
                                Member member)

ConstraintDescriptorImpl

public ConstraintDescriptorImpl(Member member,
                                T annotation,
                                ConstraintHelper constraintHelper,
                                ElementType type,
                                ConstraintOrigin definedOn)
Method Detail

getAnnotation

public T getAnnotation()
Specified by:
getAnnotation in interface ConstraintDescriptor<T extends Annotation>

getAnnotationType

public Class<T> getAnnotationType()

getMessageTemplate

public String getMessageTemplate()
Specified by:
getMessageTemplate in interface ConstraintDescriptor<T extends Annotation>

getGroups

public Set<Class<?>> getGroups()
Specified by:
getGroups in interface ConstraintDescriptor<T extends Annotation>

getPayload

public Set<Class<? extends Payload>> getPayload()
Specified by:
getPayload in interface ConstraintDescriptor<T extends Annotation>

getValidationAppliesTo

public ConstraintTarget getValidationAppliesTo()
Specified by:
getValidationAppliesTo in interface ConstraintDescriptor<T extends Annotation>

getConstraintValidatorClasses

public List<Class<? extends ConstraintValidator<T,?>>> getConstraintValidatorClasses()
Specified by:
getConstraintValidatorClasses in interface ConstraintDescriptor<T extends Annotation>

getMatchingConstraintValidatorClasses

public List<Class<? extends ConstraintValidator<T,?>>> getMatchingConstraintValidatorClasses()
Returns those validators registered with this constraint which apply to the given constraint type (either generic or cross-parameter).

Returns:
The validators applying to type of this constraint.

getAttributes

public Map<String,Object> getAttributes()
Specified by:
getAttributes in interface ConstraintDescriptor<T extends Annotation>

getComposingConstraints

public Set<ConstraintDescriptor<?>> getComposingConstraints()
Specified by:
getComposingConstraints in interface ConstraintDescriptor<T extends Annotation>

getComposingConstraintImpls

public Set<ConstraintDescriptorImpl<?>> getComposingConstraintImpls()

isReportAsSingleViolation

public boolean isReportAsSingleViolation()
Specified by:
isReportAsSingleViolation in interface ConstraintDescriptor<T extends Annotation>

getElementType

public ElementType getElementType()

getDefinedOn

public ConstraintOrigin getDefinedOn()

getConstraintType

public ConstraintDescriptorImpl.ConstraintType getConstraintType()

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

getCompositionType

public CompositionType getCompositionType()
Returns:
the compositionType


Copyright © 2007-2013 Red Hat, Inc. All Rights Reserved