Top Description Inners Fields Constructors Methods
org.hibernate.validator.internal.metadata.descriptor

public abstract Class ElementDescriptorImpl

extends Object
implements ElementDescriptor, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, jakarta.validation.metadata.ElementDescriptor
Known Direct Subclasses
org.hibernate.validator.internal.metadata.descriptor.ExecutableDescriptorImpl, org.hibernate.validator.internal.metadata.descriptor.ParameterDescriptorImpl, org.hibernate.validator.internal.metadata.descriptor.PropertyDescriptorImpl, org.hibernate.validator.internal.metadata.descriptor.ReturnValueDescriptorImpl, org.hibernate.validator.internal.metadata.descriptor.BeanDescriptorImpl, org.hibernate.validator.internal.metadata.descriptor.ClassDescriptorImpl, org.hibernate.validator.internal.metadata.descriptor.ContainerElementTypeDescriptorImpl, org.hibernate.validator.internal.metadata.descriptor.CrossParameterDescriptorImpl
Static Imports
org.hibernate.validator.internal.util.CollectionHelper.newArrayList

Describes a validated element (class, field or property).
Authors
Emmanuel Bernard, Hardy Ferentschik, Gunnar Morling

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private final Set<ConstraintDescriptorImpl<?>>
private final List<Class<?>>
private final boolean
private final Class<?>
type

The type of the element

Constructor Summary

AccessConstructor and Description
public
ElementDescriptorImpl(Type type, Set<ConstraintDescriptorImpl<?>> constraintDescriptors, boolean defaultGroupSequenceRedefined, List<Class<?>> defaultGroupSequence)

Method Summary

Modifier and TypeMethod and Description
public final ElementDescriptor.ConstraintFinder
findConstraints()

Implements jakarta.validation.metadata.ElementDescriptor.findConstraints.

Finds constraints and potentially restricts them to certain criteria.
public final Set<ConstraintDescriptor<?>>
getConstraintDescriptors()

Implements jakarta.validation.metadata.ElementDescriptor.getConstraintDescriptors.

Returns all constraint descriptors for this element in the class hierarchy or an empty Set if none are present.
public final Class<?>
public final boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

constraintDescriptorsback to summary
private final Set<ConstraintDescriptorImpl<?>> constraintDescriptors
Annotations
@Immutable
defaultGroupSequenceback to summary
private final List<Class<?>> defaultGroupSequence
Annotations
@Immutable
defaultGroupSequenceRedefinedback to summary
private final boolean defaultGroupSequenceRedefined
typeback to summary
private final Class<?> type

The type of the element

Constructor Detail

ElementDescriptorImplback to summary
public ElementDescriptorImpl(Type type, Set<ConstraintDescriptorImpl<?>> constraintDescriptors, boolean defaultGroupSequenceRedefined, List<Class<?>> defaultGroupSequence)

Method Detail

findConstraintsback to summary
public final ElementDescriptor.ConstraintFinder findConstraints()

Implements jakarta.validation.metadata.ElementDescriptor.findConstraints.

Doc from jakarta.validation.metadata.ElementDescriptor.findConstraints.

Finds constraints and potentially restricts them to certain criteria.

Returns:ElementDescriptor.ConstraintFinder

ConstraintFinder object

Annotations
@Override
getConstraintDescriptorsback to summary
public final Set<ConstraintDescriptor<?>> getConstraintDescriptors()

Implements jakarta.validation.metadata.ElementDescriptor.getConstraintDescriptors.

Doc from jakarta.validation.metadata.ElementDescriptor.getConstraintDescriptors.

Returns all constraint descriptors for this element in the class hierarchy or an empty Set if none are present.

Returns:Set<ConstraintDescriptor<?>>

Set of constraint descriptors for this element

Annotations
@Override
getElementClassback to summary
public final Class<?> getElementClass()

Implements jakarta.validation.metadata.ElementDescriptor.getElementClass.

Returns:Class<?>

Doc from jakarta.validation.metadata.ElementDescriptor.getElementClass.

the statically defined returned type

Annotations
@Override
hasConstraintsback to summary
public final boolean hasConstraints()

Implements jakarta.validation.metadata.ElementDescriptor.hasConstraints.

Returns:boolean

Doc from jakarta.validation.metadata.ElementDescriptor.hasConstraints.

returns true if at least one constraint declaration is present for this element in the class hierarchy, false otherwise

Annotations
@Override
org.hibernate.validator.internal.metadata.descriptor back to summary

private Class ElementDescriptorImpl.ConstraintFinderImpl

extends Object
implements ConstraintFinder
Class Inheritance
  • java.lang.Object
  • org.hibernate.validator.internal.metadata.descriptor.ElementDescriptorImpl.ConstraintFinderImpl
All Implemented Interfaces
jakarta.validation.metadata.ElementDescriptor.ConstraintFinder

Field Summary

Modifier and TypeField and Description
private final EnumSet<ConstraintOrigin>
private final EnumSet<ElementType>
private List<Class<?>>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
addMatchingDescriptorsForGroup(Class<?> group, Set<ConstraintDescriptor<?>> matchingDescriptors)

public ElementDescriptor.ConstraintFinder
declaredOn(ElementType...
targeted types
elementTypes
)

Implements jakarta.validation.metadata.ElementDescriptor.ConstraintFinder.declaredOn.

Restricts to the constraints hosted on the listed types for a given element.
private void
public Set<ConstraintDescriptor<?>>
getConstraintDescriptors()

Implements jakarta.validation.metadata.ElementDescriptor.ConstraintFinder.getConstraintDescriptors.

Retrieves the constraint descriptors following the defined restrictions and hosted on the element described by ElementDescriptor.
public boolean
hasConstraints()

Implements jakarta.validation.metadata.ElementDescriptor.ConstraintFinder.hasConstraints.

Returns true if at least one constraint declaration matching the restrictions is present on the element, false otherwise.
public ElementDescriptor.ConstraintFinder
lookingAt(Scope
expected scope
visibility
)

Implements jakarta.validation.metadata.ElementDescriptor.ConstraintFinder.lookingAt.

Restricts to the constraints matching the provided scope for this element.
public ElementDescriptor.ConstraintFinder
unorderedAndMatchingGroups(Class<?>...
groups targeted
classes
)

Implements jakarta.validation.metadata.ElementDescriptor.ConstraintFinder.unorderedAndMatchingGroups.

Restricts to the constraints matching a given set of groups for this element.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

definedInSetback to summary
private final EnumSet<ConstraintOrigin> definedInSet
elementTypesback to summary
private final EnumSet<ElementType> elementTypes
groupsback to summary
private List<Class<?>> groups

Constructor Detail

ConstraintFinderImplback to summary
pack-priv ConstraintFinderImpl()

Method Detail

addMatchingDescriptorsForGroupback to summary
private void addMatchingDescriptorsForGroup(Class<?> group, Set<ConstraintDescriptor<?>> matchingDescriptors)
declaredOnback to summary
public ElementDescriptor.ConstraintFinder declaredOn(ElementType... elementTypes)

Implements jakarta.validation.metadata.ElementDescriptor.ConstraintFinder.declaredOn.

Doc from jakarta.validation.metadata.ElementDescriptor.ConstraintFinder.declaredOn.

Restricts to the constraints hosted on the listed types for a given element.

Defaults to all possible types of the element.

Typically used to restrict to fields (FIELD) or getters (METHOD).

Parameters
elementTypes:ElementType[]

targeted types

Returns:ElementDescriptor.ConstraintFinder

this following the chaining method pattern

Annotations
@Override
findMatchingDescriptorsback to summary
private void findMatchingDescriptors(Set<ConstraintDescriptor<?>> matchingDescriptors)
getConstraintDescriptorsback to summary
public Set<ConstraintDescriptor<?>> getConstraintDescriptors()

Implements jakarta.validation.metadata.ElementDescriptor.ConstraintFinder.getConstraintDescriptors.

Doc from jakarta.validation.metadata.ElementDescriptor.ConstraintFinder.getConstraintDescriptors.

Retrieves the constraint descriptors following the defined restrictions and hosted on the element described by ElementDescriptor.

Returns:Set<ConstraintDescriptor<?>>

matching constraint descriptors

Annotations
@Override
hasConstraintsback to summary
public boolean hasConstraints()

Implements jakarta.validation.metadata.ElementDescriptor.ConstraintFinder.hasConstraints.

Doc from jakarta.validation.metadata.ElementDescriptor.ConstraintFinder.hasConstraints.

Returns true if at least one constraint declaration matching the restrictions is present on the element, false otherwise.

Returns:boolean

true if there is at least one constraint

Annotations
@Override
lookingAtback to summary
public ElementDescriptor.ConstraintFinder lookingAt(Scope visibility)

Implements jakarta.validation.metadata.ElementDescriptor.ConstraintFinder.lookingAt.

Doc from jakarta.validation.metadata.ElementDescriptor.ConstraintFinder.lookingAt.

Restricts to the constraints matching the provided scope for this element. Defaults to Scope#HIERARCHY

Parameters
visibility:Scope

expected scope

Returns:ElementDescriptor.ConstraintFinder

this following the chaining method pattern

Annotations
@Override
unorderedAndMatchingGroupsback to summary
public ElementDescriptor.ConstraintFinder unorderedAndMatchingGroups(Class<?>... classes)

Implements jakarta.validation.metadata.ElementDescriptor.ConstraintFinder.unorderedAndMatchingGroups.

Doc from jakarta.validation.metadata.ElementDescriptor.ConstraintFinder.unorderedAndMatchingGroups.

Restricts to the constraints matching a given set of groups for this element.

This method respects group conversion, group sequences and group inheritance (including class-level Default group overriding) but does not return ConstraintDescriptors in any particular order. Specifically, ordering of the group sequence is not respected.

Parameters
classes:Class<?>[]

groups targeted

Returns:ElementDescriptor.ConstraintFinder

this following the chaining method pattern

Annotations
@Override