org.hibernate.validator.cfg
Class ConstraintDef<C extends ConstraintDef<C,A>,A extends Annotation>
java.lang.Object
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.
- Author:
- Hardy Ferentschik, Gunnar Morling
constraintType
protected final Class<A extends Annotation> constraintType
- The constraint annotation type of this definition.
parameters
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.
ConstraintDef
protected ConstraintDef(Class<A> constraintType)
ConstraintDef
protected ConstraintDef(ConstraintDef<?,A> original)
addParameter
protected C addParameter(String key,
Object value)
message
public C message(String message)
groups
public C groups(Class<?>... groups)
payload
public C payload(Class<? extends Payload>... payload)
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2007-2011 Red Hat Middleware, LLC. All Rights Reserved