Top Description Methods
org.hibernate.validator.internal.metadata.aggregated

public Interface BeanMetaData<T>

extends Validatable
Known Direct Implementers
org.hibernate.validator.internal.metadata.aggregated.BeanMetaDataImpl, org.hibernate.validator.internal.metadata.PredefinedScopeBeanMetaDataManager.UninitializedBeanMetaData
Imports
java.lang.reflect.Executable, java.util.Iterator, .List, .Optional, .Set, jakarta.validation.metadata.BeanDescriptor, org.hibernate.validator.internal.engine.groups.Sequence, org.hibernate.validator.internal.metadata.core.MetaConstraint, org.hibernate.validator.internal.metadata.facets.Validatable

Interface defining the meta data about the constraints defined in a given bean.
Authors
Hardy Ferentschik, Gunnar Morling, Guillaume Smet

Method Summary

Modifier and TypeMethod and Description
public Class<T>

Returns:

the class of the bean.
getBeanClass
()

public BeanDescriptor

Returns:

an instance of ElementDescriptor describing the bean this meta data applies for.
getBeanDescriptor
()

public List<Class<? super T>>

Returns:

Returns a list of classes representing the class hierarchy for the entity. The list start with the element itself and goes up the hierarchy chain. Interfaces are not included.
getClassHierarchy
()

public List<Class<?>>

Returns:

a list of classes representing the default group sequence.
getDefaultGroupSequence
(T
the bean state.
beanState
)

Get the composition of the default group sequence.

public Iterator<Sequence>
getDefaultValidationSequence(T beanState)

Returns an iterator over the default validation group sequence as configured through @GroupSequence/@DefaultGroupSequenceProvider.

public Set<MetaConstraint<?>>

Returns:

A set of 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 classes
getDirectMetaConstraints
()

public Set<MetaConstraint<?>>

Returns:

A set of MetaConstraint instances encapsulating the information of all the constraints defined on the bean. This collection includes constraints from super classes as well
getMetaConstraints
()

public PropertyMetaData

Returns:

Constraint-related meta data.
getMetaDataFor
(String
The property name.
propertyName
)

Returns constraint-related meta data for the given property of this bean.

public Optional<ExecutableMetaData>

Returns:

An optional either containing an aggregated view on the constraint related metadata from the given method and all the methods from super-types which it overrides or implements or being empty if the method is not constrained at all.
getMetaDataFor
(Executable
The executable of interest.
executable
)

Returns the constraint-related metadata for the given executable of the class represented by this bean metadata.

public boolean

Returns:

true if the bean class for this bean meta data has any constraints at all, false otherwise.
hasConstraints
()

Returns true if the bean class for this bean meta data has any constraints at all, false otherwise.

public boolean

Returns:

true if the entity redefines the default group sequence, false otherwise.
isDefaultGroupSequenceRedefined
()

Inherited from org.hibernate.validator.internal.metadata.facets.Validatable:
getCascadableshasCascadables

Method Detail

getBeanClassback to summary
public Class<T> getBeanClass()
Returns:Class<T>

the class of the bean.

getBeanDescriptorback to summary
public BeanDescriptor getBeanDescriptor()
Returns:BeanDescriptor

an instance of ElementDescriptor describing the bean this meta data applies for.

getClassHierarchyback to summary
public List<Class<? super T>> getClassHierarchy()
Returns:List<Class<? super T>>

Returns a list of classes representing the class hierarchy for the entity. The list start with the element itself and goes up the hierarchy chain. Interfaces are not included.

getDefaultGroupSequenceback to summary
public List<Class<?>> getDefaultGroupSequence(T beanState)

Get the composition of the default group sequence.

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.

Parameters
beanState:T

the bean state.

Returns:List<Class<?>>

a list of classes representing the default group sequence.

getDefaultValidationSequenceback to summary
public Iterator<Sequence> getDefaultValidationSequence(T beanState)

Returns an iterator over the default validation group sequence as configured through @GroupSequence/@DefaultGroupSequenceProvider. If this bean type does not re-declare the default validation group sequence, org.hibernate.validator.internal.engine.groups.ValidationOrder#DEFAULT_SEQUENCE will be returned.

getDirectMetaConstraintsback to summary
public Set<MetaConstraint<?>> getDirectMetaConstraints()
Returns:Set<MetaConstraint<?>>

A set of 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 classes

getMetaConstraintsback to summary
public Set<MetaConstraint<?>> getMetaConstraints()
Returns:Set<MetaConstraint<?>>

A set of MetaConstraint instances encapsulating the information of all the constraints defined on the bean. This collection includes constraints from super classes as well

getMetaDataForback to summary
public PropertyMetaData getMetaDataFor(String propertyName)

Returns constraint-related meta data for the given property of this bean.

Parameters
propertyName:String

The property name.

Returns:PropertyMetaData

Constraint-related meta data.

Exceptions
IllegalArgumentException:
In case no property with the given name exists.
getMetaDataForback to summary
public Optional<ExecutableMetaData> getMetaDataFor(Executable executable) throws IllegalArgumentException

Returns the constraint-related metadata for the given executable of the class represented by this bean metadata.

Parameters
executable:Executable

The executable of interest.

Returns:Optional<ExecutableMetaData>

An optional either containing an aggregated view on the constraint related metadata from the given method and all the methods from super-types which it overrides or implements or being empty if the method is not constrained at all.

Exceptions
IllegalArgumentException:
In case the method cannot be found in the bean.
hasConstraintsback to summary
public boolean hasConstraints()

Returns true if the bean class for this bean meta data has any constraints at all, false otherwise.

Returns:boolean

true if the bean class for this bean meta data has any constraints at all, false otherwise.

isDefaultGroupSequenceRedefinedback to summary
public boolean isDefaultGroupSequenceRedefined()
Returns:boolean

true if the entity redefines the default group sequence, false otherwise.