org.hibernate.validator.metadata
Class BeanMetaConstraint<A extends Annotation>

java.lang.Object
  extended by org.hibernate.validator.metadata.MetaConstraint<A>
      extended by org.hibernate.validator.metadata.BeanMetaConstraint<A>

public class BeanMetaConstraint<A extends Annotation>
extends MetaConstraint<A>

A MetaConstraint implementation that represents a field, property-level or class level constraint and allows the unified handling of these constraints.

Author:
Gunnar Morling

Field Summary
 
Fields inherited from class org.hibernate.validator.metadata.MetaConstraint
location
 
Constructor Summary
BeanMetaConstraint(ConstraintDescriptorImpl<A> constraintDescriptor, Class<?> beanClass, Member member)
          Creates a new BeanMetaConstraint.
 
Method Summary
 BeanConstraintLocation getLocation()
          Returns the location of this constraint.
 Object getValue(Object o)
           
 
Methods inherited from class org.hibernate.validator.metadata.MetaConstraint
equals, getDescriptor, getElementType, getGroupList, hashCode, toString, typeOfAnnotatedElement, validateConstraint
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BeanMetaConstraint

public BeanMetaConstraint(ConstraintDescriptorImpl<A> constraintDescriptor,
                          Class<?> beanClass,
                          Member member)
Creates a new BeanMetaConstraint.

Parameters:
constraintDescriptor - The descriptor for this constraint.
beanClass - The type hosting this constraint.
member - The field or getter method hosting this constraint if this is not a class-level constraint, otherwise null.
Method Detail

getLocation

public BeanConstraintLocation getLocation()
Returns the location of this constraint.

Overrides:
getLocation in class MetaConstraint<A extends Annotation>

getValue

public Object getValue(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.


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