org.hibernate.validator.cfg
Class ConstraintDef<A extends Annotation>

java.lang.Object
  extended by org.hibernate.validator.cfg.ConstraintDef<A>
Direct Known Subclasses:
AssertFalseDef, AssertTrueDef, ConstraintDefWrapper, CreditCardNumberDef, DecimalMaxDef, DecimalMinDef, DigitsDef, EmailDef, FutureDef, GenericConstraintDef, LengthDef, MaxDef, MinDef, NotBlankDef, NotEmptyDef, NotNullDef, NullDef, PastDef, PatternDef, RangeDef, ScriptAssertDef, SizeDef, URLDef

public abstract class ConstraintDef<A extends Annotation>
extends Object

Author:
Hardy Ferentschik

Field Summary
protected  Class<?> beanType
           
protected  Class<A> constraintType
           
protected  ElementType elementType
           
protected  ConstraintMapping mapping
           
protected  Map<String,Object> parameters
           
protected  String property
           
 
Constructor Summary
  ConstraintDef(Class<?> beanType, Class<A> constraintType, String property, ElementType elementType, ConstraintMapping mapping)
           
protected ConstraintDef(Class<?> beanType, Class<A> constraintType, String property, ElementType elementType, Map<String,Object> parameters, ConstraintMapping mapping)
           
 
Method Summary
protected  ConstraintDef addParameter(String key, Object value)
           
<A extends Annotation,T extends ConstraintDef<A>>
T
constraint(Class<T> definition)
           
 ConstraintDef groups(Class<?>... groups)
           
 ConstraintDef message(String message)
           
 ConstraintDef payload(Class<? extends Payload>... payload)
           
 ConstraintsForType property(String property, ElementType type)
           
 String toString()
           
 ConstraintsForType type(Class<?> type)
           
 ConstraintsForType valid(String property, ElementType type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

constraintType

protected Class<A extends Annotation> constraintType

parameters

protected final Map<String,Object> parameters

beanType

protected final Class<?> beanType

elementType

protected final ElementType elementType

property

protected final String property

mapping

protected final ConstraintMapping mapping
Constructor Detail

ConstraintDef

public ConstraintDef(Class<?> beanType,
                     Class<A> constraintType,
                     String property,
                     ElementType elementType,
                     ConstraintMapping mapping)

ConstraintDef

protected ConstraintDef(Class<?> beanType,
                        Class<A> constraintType,
                        String property,
                        ElementType elementType,
                        Map<String,Object> parameters,
                        ConstraintMapping mapping)
Method Detail

addParameter

protected ConstraintDef addParameter(String key,
                                     Object value)

message

public ConstraintDef message(String message)

groups

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

payload

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

constraint

public <A extends Annotation,T extends ConstraintDef<A>> T constraint(Class<T> definition)

property

public ConstraintsForType property(String property,
                                   ElementType type)

type

public ConstraintsForType type(Class<?> type)

valid

public ConstraintsForType valid(String property,
                                ElementType type)

toString

public String toString()
Overrides:
toString in class Object


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