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 an iterator over the default validation group sequence as configured through
@GroupSequence/@DefaultGroupSequenceProvider. |
Set<MetaConstraint<?>> |
getDirectMetaConstraints() |
Set<MetaConstraint<?>> |
getMetaConstraints() |
Optional<ExecutableMetaData> |
getMetaDataFor(Executable executable)
Returns the constraint-related metadata for the given executable of the
class represented by this bean metadata.
|
PropertyMetaData |
getMetaDataFor(String propertyName)
Returns constraint-related meta data for the given property of this bean.
|
boolean |
hasCascadables()
Returns
true if this validatable has at least one cascadable element, false otherwise. |
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 boolean hasCascadables()
Validatabletrue if this validatable has at least one cascadable element, false otherwise.hasCascadables in interface Validatablepublic PropertyMetaData getMetaDataFor(String propertyName)
BeanMetaDatagetMetaDataFor in interface BeanMetaData<T>propertyName - The property name.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 Optional<ExecutableMetaData> getMetaDataFor(Executable executable)
BeanMetaDatagetMetaDataFor in interface BeanMetaData<T>executable - The executable 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)
BeanMetaData@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 © 2019 JBoss by Red Hat. All rights reserved.