Top Description Inners Methods
org.hibernate.validator.internal.metadata.raw

public Interface ConstrainedElement

extends Iterable<MetaConstraint<?>>
Known Direct Implementers
org.hibernate.validator.internal.metadata.raw.AbstractConstrainedElement
Imports
java.util.Set, jakarta.validation.Valid, jakarta.validation.groups.ConvertGroup, org.hibernate.validator.internal.metadata.aggregated.CascadingMetaDataBuilder, org.hibernate.validator.internal.metadata.core.MetaConstraint

Represents a (potentially) constrained Java element such as a type, field or method. Such an element has a set of org.hibernate.validator.internal.metadata.core.MetaConstraints and can be marked for a cascaded validation. Furthermore each constrained element has a configuration source which determines its origin.

The hierarchy of constrained elements resembles the physical structure of the represented Java types. In particular it doesn't provide the notion of properties and it doesn't aggregate meta data for overridden elements in an inheritance hierarchy.

Identity of implementations is based on the element location and constraint source. That means that for instance in a set there can be two configurations for one and the same Java field created by two different configuration sources (e.g. via annotation and XML) but not two configurations for the same field originating from one configuration source.

Implementations are strictly read-only.

Author
Gunnar Morling

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Method Summary

Modifier and TypeMethod and Description
public CascadingMetaDataBuilder
getCascadingMetaDataBuilder()

Returns the cascading metadata (e.g. Valid and ConvertGroup) for the element and the potential container elements.

public Set<MetaConstraint<?>>

Returns:

A set with this constrained element's constraints. May be empty, but never null.
getConstraints
()

Returns a set containing the constraints specified for this constrained element.

public ConstrainedElement.ConstrainedElementKind

Returns:

The kind of this constrained element.
getKind
()

Returns the kind of this constrained element.

public ConfigurationSource
getSource()

Returns the configuration source contributing this constrained element.

public Set<MetaConstraint<?>>
getTypeArgumentConstraints()

Returns the type argument constraints of this element, if any.

public boolean

Returns:

True, if this element is constrained, false otherwise.
isConstrained
()

Whether this element is constrained or not.

Inherited from java.lang.Iterable:
forEachiteratorspliterator

Method Detail

getCascadingMetaDataBuilderback to summary
public CascadingMetaDataBuilder getCascadingMetaDataBuilder()

Returns the cascading metadata (e.g. Valid and ConvertGroup) for the element and the potential container elements.

getConstraintsback to summary
public Set<MetaConstraint<?>> getConstraints()

Returns a set containing the constraints specified for this constrained element.

Returns:Set<MetaConstraint<?>>

A set with this constrained element's constraints. May be empty, but never null.

getKindback to summary
public ConstrainedElement.ConstrainedElementKind getKind()

Returns the kind of this constrained element.

Returns:ConstrainedElement.ConstrainedElementKind

The kind of this constrained element.

getSourceback to summary
public ConfigurationSource getSource()

Returns the configuration source contributing this constrained element.

getTypeArgumentConstraintsback to summary
public Set<MetaConstraint<?>> getTypeArgumentConstraints()

Returns the type argument constraints of this element, if any.

isConstrainedback to summary
public boolean isConstrained()

Whether this element is constrained or not. This is the case, if this element has at least one constraint or a cascaded validation shall be performed for it.

Returns:boolean

True, if this element is constrained, false otherwise.

org.hibernate.validator.internal.metadata.raw back to summary

public final Enum ConstrainedElement.ConstrainedElementKind

extends Enum<ConstrainedElement.ConstrainedElementKind>
Class Inheritance

The kind of a ConstrainedElement. Can be used to determine an element's type when traversing over a collection of constrained elements.
Author
Gunnar Morling

Field Summary

Modifier and TypeField and Description
public static final ConstrainedElement.ConstrainedElementKind
public static final ConstrainedElement.ConstrainedElementKind
public static final ConstrainedElement.ConstrainedElementKind
public static final ConstrainedElement.ConstrainedElementKind
public static final ConstrainedElement.ConstrainedElementKind
public static final ConstrainedElement.ConstrainedElementKind

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public boolean
public boolean
public static ConstrainedElement.ConstrainedElementKind
public static ConstrainedElement.ConstrainedElementKind[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CONSTRUCTORback to summary
public static final ConstrainedElement.ConstrainedElementKind CONSTRUCTOR
FIELDback to summary
public static final ConstrainedElement.ConstrainedElementKind FIELD
GETTERback to summary
public static final ConstrainedElement.ConstrainedElementKind GETTER
METHODback to summary
public static final ConstrainedElement.ConstrainedElementKind METHOD
PARAMETERback to summary
public static final ConstrainedElement.ConstrainedElementKind PARAMETER
TYPEback to summary
public static final ConstrainedElement.ConstrainedElementKind TYPE

Constructor Detail

ConstrainedElementKindback to summary
private ConstrainedElementKind()

Method Detail

isExecutableback to summary
public boolean isExecutable()
isMethodback to summary
public boolean isMethod()
valueOfback to summary
public static ConstrainedElement.ConstrainedElementKind valueOf(String name)
valuesback to summary
public static ConstrainedElement.ConstrainedElementKind[] values()