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

All Known Implementing Classes:
BeanMetaDataImpl

public interface BeanMetaData<T>

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

Author:
Hardy Ferentschik

Method Summary
 boolean defaultGroupSequenceIsRedefined()
           
 Class<T> getBeanClass()
           
 BeanDescriptor getBeanDescriptor()
           
 List<Member> getCascadedMembers()
           
 Set<PropertyDescriptor> getConstrainedProperties()
           
 List<Class<?>> getDefaultGroupSequence()
           
 List<MetaConstraint<T,? extends Annotation>> getMetaConstraintsAsList()
           
 Map<Class<?>,List<MetaConstraint<T,? extends Annotation>>> getMetaConstraintsAsMap()
           
 PropertyDescriptor getPropertyDescriptor(String property)
          Return PropertyDescriptor for the given property.
 boolean isPropertyPresent(String name)
          return true if the property exists on the object even if the property does not host any constraint nor is cascaded
 

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.

getCascadedMembers

List<Member> getCascadedMembers()
Returns:
A list of all cascaded methods and fields (methods/fields annotated with @Valid).

getDefaultGroupSequence

List<Class<?>> getDefaultGroupSequence()
Returns:
A map mapping defined group sequences to a list of groups.

defaultGroupSequenceIsRedefined

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

getMetaConstraintsAsMap

Map<Class<?>,List<MetaConstraint<T,? extends Annotation>>> getMetaConstraintsAsMap()
Returns:
A map of MetaConstraint instances encapsulating the information of all the constraints defined on the bean mapped to the class in which the constraints is defined.

getMetaConstraintsAsList

List<MetaConstraint<T,? extends Annotation>> getMetaConstraintsAsList()
Returns:
A list of MetaConstraint instances encapsulating the information of all the constraints defined on the bean.

getPropertyDescriptor

PropertyDescriptor getPropertyDescriptor(String property)
Return PropertyDescriptor for the given property.

Parameters:
property - the property for which to retrieve the descriptor.
Returns:
Returns the PropertyDescriptor for the given property or null in case the property does not have a descriptor.

isPropertyPresent

boolean isPropertyPresent(String name)
return true if the property exists on the object even if the property does not host any constraint nor is cascaded


getConstrainedProperties

Set<PropertyDescriptor> getConstrainedProperties()
Returns:
the property descriptors having at least one constraint defined or which are marked as cascaded (@Valid).


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