org.hibernate.validator.cfg
Class ConstraintDef<A extends java.lang.annotation.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 java.lang.annotation.Annotation>
extends java.lang.Object

Author:
Hardy Ferentschik

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

Field Detail

constraintType

protected java.lang.Class<A extends java.lang.annotation.Annotation> constraintType

parameters

protected final java.util.Map<java.lang.String,java.lang.Object> parameters

beanType

protected final java.lang.Class<?> beanType

elementType

protected final java.lang.annotation.ElementType elementType

property

protected final java.lang.String property

mapping

protected final ConstraintMapping mapping
Constructor Detail

ConstraintDef

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

ConstraintDef

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

addParameter

protected ConstraintDef addParameter(java.lang.String key,
                                     java.lang.Object value)

message

public ConstraintDef message(java.lang.String message)

groups

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

payload

public ConstraintDef payload(java.lang.Class<? extends javax.validation.Payload>... payload)

constraint

public <A extends java.lang.annotation.Annotation,T extends ConstraintDef<A>> T constraint(java.lang.Class<T> definition)

property

public ConstraintsForType property(java.lang.String property,
                                   java.lang.annotation.ElementType type)

type

public ConstraintsForType type(java.lang.Class<?> type)

valid

public ConstraintsForType valid(java.lang.String property,
                                java.lang.annotation.ElementType type)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2011 Oracle Corporation. All Rights Reserved.