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 | Class and Description |
|---|---|
static class |
BeanMetaDataImpl.BeanMetaDataBuilder<T> |
| Constructor and Description |
|---|
BeanMetaDataImpl(Class<T> beanClass,
List<Class<?>> defaultGroupSequence,
DefaultGroupSequenceProvider<? super T> defaultGroupSequenceProvider,
Set<ConstraintMetaData> constraintMetaDataSet,
ValidationOrderGenerator validationOrderGenerator)
Creates a new
BeanMetaDataImpl |
| Modifier and Type | Method and Description |
|---|---|
boolean |
defaultGroupSequenceIsRedefined() |
Class<T> |
getBeanClass() |
BeanDescriptor |
getBeanDescriptor() |
Set<Cascadable> |
getCascadables()
Returns the cascaded elements of this validatable, e.g.
|
List<Class<? super T>> |
getClassHierarchy() |
List<Class<?>> |
getDefaultGroupSequence(T beanState)
Get the composition of the default group sequence.
|
Iterator<Sequence> |
getDefaultValidationSequence(T beanState)
Returns a
ValidationOrder representing the default
validation group sequence as configured through @GroupSequence/@DefaultGroupSequenceProvider. |
Set<MetaConstraint<?>> |
getDirectMetaConstraints() |
Set<MetaConstraint<?>> |
getMetaConstraints() |
ExecutableMetaData |
getMetaDataFor(ExecutableElement executable)
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.
|
boolean |
hasConstraints()
Returns
true if the bean class for this bean meta data has any constraints at all, false otherwise. |
String |
toString() |
public BeanMetaDataImpl(Class<T> beanClass, List<Class<?>> defaultGroupSequence, DefaultGroupSequenceProvider<? super T> defaultGroupSequenceProvider, Set<ConstraintMetaData> constraintMetaDataSet, ValidationOrderGenerator validationOrderGenerator)
BeanMetaDataImplbeanClass - The Java type represented by this meta data object.defaultGroupSequence - The default group sequence.defaultGroupSequenceProvider - The default group sequence provider if set.constraintMetaDataSet - All constraint meta data relating to the represented type.public Class<T> getBeanClass()
getBeanClass in interface BeanMetaData<T>public boolean hasConstraints()
BeanMetaDatatrue if the bean class for this bean meta data has any constraints at all, false otherwise.hasConstraints in interface BeanMetaData<T>true if the bean class for this bean meta data has any constraints at all, false otherwise.public BeanDescriptor getBeanDescriptor()
getBeanDescriptor in interface BeanMetaData<T>ElementDescriptor describing the bean this meta data applies for.public Set<Cascadable> getCascadables()
Validatable@Valid.getCascadables in interface Validatablepublic PropertyMetaData getMetaDataFor(String propertyName)
BeanMetaDatagetMetaDataFor in interface BeanMetaData<T>propertyName - The property name.null if no property with the given name exists.public Set<MetaConstraint<?>> 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<MetaConstraint<?>> 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 ExecutableMetaData getMetaDataFor(ExecutableElement executable)
BeanMetaDatagetMetaDataFor in interface BeanMetaData<T>executable - The method of interest.public List<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 Iterator<Sequence> getDefaultValidationSequence(T beanState)
BeanMetaDataValidationOrder representing the default
validation group sequence as configured through @GroupSequence/@DefaultGroupSequenceProvider. If
this bean type does not re-declare the default validation group sequence ValidationOrder.DEFAULT_SEQUENCE
will be returned.getDefaultValidationSequence in interface BeanMetaData<T>public boolean defaultGroupSequenceIsRedefined()
defaultGroupSequenceIsRedefined in interface BeanMetaData<T>true if the entity redefines the default group sequence, false otherwise.public List<Class<? super T>> getClassHierarchy()
getClassHierarchy in interface BeanMetaData<T>Copyright © 2018 JBoss by Red Hat. All rights reserved.