Class ConstraintDef<C extends ConstraintDef<C,A>,A extends Annotation>

  extended by org.hibernate.validator.cfg.ConstraintDef<C,A>
Type Parameters:
C - The type of a concrete sub type. Following to the "self referencing generic type" pattern each sub type has to be parametrized with itself.
A - The constraint annotation type represented by a concrete sub type.
Direct Known Subclasses:
AssertFalseDef, AssertTrueDef, CreditCardNumberDef, DecimalMaxDef, DecimalMinDef, DigitsDef, EmailDef, FutureDef, GenericConstraintDef, LengthDef, MaxDef, MinDef, NotBlankDef, NotEmptyDef, NotNullDef, NullDef, PastDef, PatternDef, RangeDef, ScriptAssertDef, SizeDef, URLDef

public abstract class ConstraintDef<C extends ConstraintDef<C,A>,A extends Annotation>
extends Object

Base class for all constraint definition types. Each sub type represents a single constraint annotation type and allows to add this constraint to a bean class in a programmatic type-safe way with help of the ConstraintMapping API.

Hardy Ferentschik, Gunnar Morling

Field Summary
protected  Class<A> constraintType
          The constraint annotation type of this definition.
protected  Map<String,Object> parameters
          A map with the annotation parameters of this definition.
Constructor Summary
protected ConstraintDef(Class<A> constraintType)
protected ConstraintDef(ConstraintDef<?,A> original)
Method Summary
protected  C addParameter(String key, Object value)
 C groups(Class<?>... groups)
 C message(String message)
 C payload(Class<? extends Payload>... payload)
 String toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail


protected final Class<A extends Annotation> constraintType
The constraint annotation type of this definition.


protected final Map<String,Object> parameters
A map with the annotation parameters of this definition. Keys are property names of this definition's annotation type, values are annotation parameter values of the appropriate types.

Constructor Detail


protected ConstraintDef(Class<A> constraintType)


protected ConstraintDef(ConstraintDef<?,A> original)
Method Detail


protected C addParameter(String key,
                         Object value)


public C message(String message)


public C groups(Class<?>... groups)


public C payload(Class<? extends Payload>... payload)


public String toString()
toString in class Object

Copyright © 2007-2011 Red Hat Middleware, LLC. All Rights Reserved