public final class BeanMetaDataImpl<T> extends Object implements BeanMetaData<T>
Validator
interface can
instantiate an instance of this class and delegate the metadata extraction to it.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_PARAMETER_NAME_PREFIX
Used as prefix for parameter names, if no explicit names are given.
|
Constructor and Description |
---|
BeanMetaDataImpl(Class<T> beanClass,
ConstraintHelper constraintHelper,
BeanMetaDataCache beanMetaDataCache)
Constructor used for creating the bean meta data using annotations only
|
BeanMetaDataImpl(Class<T> beanClass,
ConstraintHelper constraintHelper,
List<Class<?>> defaultGroupSequence,
Class<? extends DefaultGroupSequenceProvider<?>> defaultGroupSequenceProvider,
Map<Class<?>,List<BeanMetaConstraint<?>>> constraints,
Set<AggregatedMethodMetaData> methodMetaDatas,
Set<Member> cascadedMembers,
AnnotationIgnores annotationIgnores,
BeanMetaDataCache beanMetaDataCache)
Constructor used when creating a bean meta data instance via the xml or programmatic API.
|
public static final String DEFAULT_PARAMETER_NAME_PREFIX
public BeanMetaDataImpl(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 instancespublic BeanMetaDataImpl(Class<T> beanClass, ConstraintHelper constraintHelper, List<Class<?>> defaultGroupSequence, Class<? extends DefaultGroupSequenceProvider<?>> defaultGroupSequenceProvider, Map<Class<?>,List<BeanMetaConstraint<?>>> constraints, Set<AggregatedMethodMetaData> methodMetaDatas, Set<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 instancespublic Class<T> getBeanClass()
getBeanClass
in interface BeanMetaData<T>
public 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 Set<Member> getCascadedMembers()
getCascadedMembers
in interface BeanMetaData<T>
public Map<Class<?>,List<BeanMetaConstraint<?>>> getMetaConstraintsAsMap()
public 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 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(Method method)
BeanMetaData
getMetaDataFor
in interface BeanMetaData<T>
method
- The method of interest.public Set<AggregatedMethodMetaData> getAllMethodMetaData()
BeanMetaData
getAllMethodMetaData
in interface BeanMetaData<T>
public PropertyDescriptor getPropertyDescriptor(String property)
BeanMetaData
PropertyDescriptor
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(String name)
isPropertyPresent
in interface BeanMetaData<T>
name
- The name of the propertypublic List<Class<?>> getDefaultGroupSequence(T beanState)
BeanMetaData
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.
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 Set<PropertyDescriptor> getConstrainedProperties()
getConstrainedProperties
in interface BeanMetaData<T>
public List<Class<?>> getClassHierarchy()
getClassHierarchy
in interface BeanMetaData<T>
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.