org.hibernate.validator.internal.metadata.aggregated
Interface BeanMetaData<T>

All Superinterfaces:
Validatable
All Known Implementing Classes:
BeanMetaDataImpl

public interface BeanMetaData<T>
extends Validatable

Interface defining the meta data about the constraints defined in a given bean.

Author:
Hardy Ferentschik, Gunnar Morling

Method Summary
 boolean defaultGroupSequenceIsRedefined()
           
 Class<T> getBeanClass()
           
 BeanDescriptor getBeanDescriptor()
           
 List<Class<? super T>> getClassHierarchy()
           
 List<Class<?>> getDefaultGroupSequence(T beanState)
          Get the composition of the default group sequence.
 Set<MetaConstraint<?>> getDirectMetaConstraints()
           
 Set<MetaConstraint<?>> getMetaConstraints()
           
 ExecutableMetaData getMetaDataFor(ExecutableElement method)
          Returns the constraint-related meta data for the given method of the class represented by this bean meta data.
 PropertyMetaData getMetaDataFor(String propertyName)
          Returns constraint-related meta data for the given property of this bean.
 
Methods inherited from interface org.hibernate.validator.internal.metadata.facets.Validatable
getCascadables
 

Method Detail

getBeanClass

Class<T> getBeanClass()
Returns:
the class of the bean.

getBeanDescriptor

BeanDescriptor getBeanDescriptor()
Returns:
an instance of ElementDescriptor describing the bean this meta data applies for.

getMetaDataFor

PropertyMetaData getMetaDataFor(String propertyName)
Returns constraint-related meta data for the given property of this bean.

Parameters:
propertyName - The property name.
Returns:
Constraint-related meta data or null if no property with the given name exists.

getDefaultGroupSequence

List<Class<?>> getDefaultGroupSequence(T beanState)
Get the composition of the default group sequence.

If the bean state is given in parameter and the bean metadata has a default group sequence provider then the dynamic default group sequence composition is returned. In the other cases the default group sequence redefinition specified by BV is used.

Parameters:
beanState - the bean state.
Returns:
a list of classes representing the default group sequence.

defaultGroupSequenceIsRedefined

boolean defaultGroupSequenceIsRedefined()
Returns:
true if the entity redefines the default group sequence, false otherwise.

getMetaConstraints

Set<MetaConstraint<?>> getMetaConstraints()
Returns:
A set of MetaConstraint instances encapsulating the information of all the constraints defined on the bean. This collection includes constraints from super classes as well

getDirectMetaConstraints

Set<MetaConstraint<?>> getDirectMetaConstraints()
Returns:
A set of MetaConstraint instances encapsulating the information of all the constraints defined on the bean directly (including constraints defined on implemented interfaces). It does not contain constraints from super classes or interfaces implemented by super classes

getMetaDataFor

ExecutableMetaData getMetaDataFor(ExecutableElement method)
                                  throws ConstraintDeclarationException
Returns the constraint-related meta data for the given method of the class represented by this bean meta data.

Parameters:
method - The method of interest.
Returns:
An aggregated view on the constraint related meta data from the given method all the methods from super-types which it overrides or implements.
Throws:
ConstraintDeclarationException - In case any of the rules for the declaration of method constraints described in the Bean Validation specification is violated.

getClassHierarchy

List<Class<? super T>> getClassHierarchy()
Returns:
Returns a list of classes representing the class hierarchy for the entity. The list start with the element itself and goes up the hierarchy chain. Interfaces are not included.


Copyright © 2007-2013 Red Hat, Inc. All Rights Reserved