|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.validator.metadata.BeanMetaDataImpl<T>
public final class BeanMetaDataImpl<T>
This class encapsulates all meta data needed for validation. Implementations of Validator interface can
instantiate an instance of this class and delegate the metadata extraction to it.
| Field Summary | |
|---|---|
static java.lang.String |
DEFAULT_PARAMETER_NAME_PREFIX
Used as prefix for parameter names, if no explicit names are given. |
| Constructor Summary | |
|---|---|
BeanMetaDataImpl(java.lang.Class<T> beanClass,
ConstraintHelper constraintHelper,
BeanMetaDataCache beanMetaDataCache)
Constructor used for creating the bean meta data using annotations only |
|
BeanMetaDataImpl(java.lang.Class<T> beanClass,
ConstraintHelper constraintHelper,
java.util.List<java.lang.Class<?>> defaultGroupSequence,
java.lang.Class<? extends DefaultGroupSequenceProvider<?>> defaultGroupSequenceProvider,
java.util.Map<java.lang.Class<?>,java.util.List<BeanMetaConstraint<?>>> constraints,
java.util.Set<AggregatedMethodMetaData> methodMetaDatas,
java.util.Set<java.lang.reflect.Member> cascadedMembers,
AnnotationIgnores annotationIgnores,
BeanMetaDataCache beanMetaDataCache)
Constructor used when creating a bean meta data instance via the xml or programmatic API. |
|
| Method Summary | |
|---|---|
boolean |
defaultGroupSequenceIsRedefined()
|
java.util.Set<AggregatedMethodMetaData> |
getAllMethodMetaData()
Returns the constraint-related meta data for all the methods of the type represented by this bean meta data. |
java.lang.Class<T> |
getBeanClass()
|
javax.validation.metadata.BeanDescriptor |
getBeanDescriptor()
|
java.util.Set<java.lang.reflect.Member> |
getCascadedMembers()
|
java.util.List<java.lang.Class<?>> |
getClassHierarchy()
|
java.util.Set<javax.validation.metadata.PropertyDescriptor> |
getConstrainedProperties()
|
java.util.List<java.lang.Class<?>> |
getDefaultGroupSequence(T beanState)
Get the composition of the default group sequence. |
java.util.Set<BeanMetaConstraint<?>> |
getDirectMetaConstraints()
|
java.util.Set<BeanMetaConstraint<?>> |
getMetaConstraints()
|
java.util.Map<java.lang.Class<?>,java.util.List<BeanMetaConstraint<?>>> |
getMetaConstraintsAsMap()
|
AggregatedMethodMetaData |
getMetaDataFor(java.lang.reflect.Method method)
Returns the constraint-related meta data for the given method of the class represented by this bean meta data. |
javax.validation.metadata.PropertyDescriptor |
getPropertyDescriptor(java.lang.String property)
Return PropertyDescriptor for the given property. |
TypeDescriptor |
getTypeDescriptor()
|
boolean |
isPropertyPresent(java.lang.String name)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DEFAULT_PARAMETER_NAME_PREFIX
| Constructor Detail |
|---|
public BeanMetaDataImpl(java.lang.Class<T> beanClass,
ConstraintHelper constraintHelper,
BeanMetaDataCache beanMetaDataCache)
beanClass - The bean type for which to create the meta dataconstraintHelper - constraint helperbeanMetaDataCache - the cache of already configured meta data instances
public BeanMetaDataImpl(java.lang.Class<T> beanClass,
ConstraintHelper constraintHelper,
java.util.List<java.lang.Class<?>> defaultGroupSequence,
java.lang.Class<? extends DefaultGroupSequenceProvider<?>> defaultGroupSequenceProvider,
java.util.Map<java.lang.Class<?>,java.util.List<BeanMetaConstraint<?>>> constraints,
java.util.Set<AggregatedMethodMetaData> methodMetaDatas,
java.util.Set<java.lang.reflect.Member> cascadedMembers,
AnnotationIgnores annotationIgnores,
BeanMetaDataCache beanMetaDataCache)
beanClass - The bean type for which to create the meta dataconstraintHelper - constraint helperdefaultGroupSequence - programmatic/xml configured default group sequence (overrides annotations)defaultGroupSequenceProvider - programmatic configured default group sequence provider class (overrides annotations)constraints - programmatic/xml configured constraintsmethodMetaDatas - programmatic configured method constraintscascadedMembers - programmatic/xml configured cascaded membersannotationIgnores - in xml configured ignores for annotationsbeanMetaDataCache - the cache of already configured meta data instances| Method Detail |
|---|
public java.lang.Class<T> getBeanClass()
getBeanClass in interface BeanMetaData<T>public javax.validation.metadata.BeanDescriptor getBeanDescriptor()
getBeanDescriptor in interface BeanMetaData<T>ElementDescriptor describing the bean this meta data applies for.public TypeDescriptor getTypeDescriptor()
getTypeDescriptor in interface BeanMetaData<T>TypeDescriptor describing the bean this meta data applies for.public java.util.Set<java.lang.reflect.Member> getCascadedMembers()
getCascadedMembers in interface BeanMetaData<T>public java.util.Map<java.lang.Class<?>,java.util.List<BeanMetaConstraint<?>>> getMetaConstraintsAsMap()
public java.util.Set<BeanMetaConstraint<?>> getMetaConstraints()
getMetaConstraints in interface BeanMetaData<T>MetaConstraint instances encapsulating the information of all the constraints
defined on the bean. This collection includes constraints from super classes as wellpublic java.util.Set<BeanMetaConstraint<?>> getDirectMetaConstraints()
getDirectMetaConstraints in interface BeanMetaData<T>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 classespublic AggregatedMethodMetaData getMetaDataFor(java.lang.reflect.Method method)
BeanMetaData
getMetaDataFor in interface BeanMetaData<T>method - The method of interest.
public java.util.Set<AggregatedMethodMetaData> getAllMethodMetaData()
BeanMetaData
getAllMethodMetaData in interface BeanMetaData<T>public javax.validation.metadata.PropertyDescriptor getPropertyDescriptor(java.lang.String property)
BeanMetaDataPropertyDescriptor for the given property.
getPropertyDescriptor in interface BeanMetaData<T>property - the property for which to retrieve the descriptor.
PropertyDescriptor for the given property or null in case the
property does not have a descriptor.public boolean isPropertyPresent(java.lang.String name)
isPropertyPresent in interface BeanMetaData<T>name - The name of the property
public java.util.List<java.lang.Class<?>> getDefaultGroupSequence(T beanState)
BeanMetaDataIf 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.
getDefaultGroupSequence in interface BeanMetaData<T>beanState - the bean state.
public boolean defaultGroupSequenceIsRedefined()
defaultGroupSequenceIsRedefined in interface BeanMetaData<T>true if the entity redefines the default group sequence, false otherwise.public java.util.Set<javax.validation.metadata.PropertyDescriptor> getConstrainedProperties()
getConstrainedProperties in interface BeanMetaData<T>public java.util.List<java.lang.Class<?>> getClassHierarchy()
getClassHierarchy in interface BeanMetaData<T>public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||