org.hibernate.validation.metadata
Class MetaConstraint<T,A extends java.lang.annotation.Annotation>

java.lang.Object
  extended by org.hibernate.validation.metadata.MetaConstraint<T,A>

public class MetaConstraint<T,A extends java.lang.annotation.Annotation>
extends java.lang.Object

Instances of this class abstract the constraint type (class, method or field constraint) and give access to meta data about the constraint. This allows a unified handling of constraints in the validator imlpementation.

Author:
Hardy Ferentschik

Constructor Summary
MetaConstraint(java.lang.Class<T> beanClass, javax.validation.metadata.ConstraintDescriptor<A> constraintDescriptor)
           
MetaConstraint(java.lang.reflect.Member member, java.lang.Class<T> beanClass, javax.validation.metadata.ConstraintDescriptor<A> constraintDescriptor)
           
 
Method Summary
 java.lang.Class<T> getBeanClass()
           
 ConstraintTree getConstraintTree()
           
 javax.validation.metadata.ConstraintDescriptor getDescriptor()
           
 java.lang.annotation.ElementType getElementType()
           
 java.util.Set<java.lang.Class<?>> getGroupList()
           
 java.lang.String getPropertyName()
           
 java.lang.Object getValue(java.lang.Object o)
           
 java.lang.String toString()
           
<T,U,V> boolean
validateConstraint(GlobalExecutionContext<T> executionContext, LocalExecutionContext<U,V> localExecutionContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MetaConstraint

public MetaConstraint(java.lang.Class<T> beanClass,
                      javax.validation.metadata.ConstraintDescriptor<A> constraintDescriptor)

MetaConstraint

public MetaConstraint(java.lang.reflect.Member member,
                      java.lang.Class<T> beanClass,
                      javax.validation.metadata.ConstraintDescriptor<A> constraintDescriptor)
Method Detail

getGroupList

public java.util.Set<java.lang.Class<?>> getGroupList()
Returns:
Returns the list of groups this constraint is part of. This might include the default group even when it is not explicitly specified, but part of the redefined default group list of the hosting bean.

getDescriptor

public javax.validation.metadata.ConstraintDescriptor getDescriptor()

getBeanClass

public java.lang.Class<T> getBeanClass()

getPropertyName

public java.lang.String getPropertyName()

getElementType

public java.lang.annotation.ElementType getElementType()

getConstraintTree

public ConstraintTree getConstraintTree()

validateConstraint

public <T,U,V> boolean validateConstraint(GlobalExecutionContext<T> executionContext,
                                          LocalExecutionContext<U,V> localExecutionContext)

getValue

public java.lang.Object getValue(java.lang.Object o)
Parameters:
o - the object from which to retrieve the value.
Returns:
Returns the value for this constraint from the specified object. Depending on the type either the value itself is returned of method or field access is used to access the value.

toString

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


Copyright © 2007-2009. All Rights Reserved.