Top Description Methods
org.hibernate.validator.cfg.context

public Interface ContainerElementTarget

Known Direct Subinterfaces
org.hibernate.validator.cfg.context.ParameterConstraintMappingContext, org.hibernate.validator.cfg.context.PropertyConstraintMappingContext, org.hibernate.validator.cfg.context.ReturnValueConstraintMappingContext, org.hibernate.validator.cfg.context.ContainerElementConstraintMappingContext
Annotations
@Incubating
Imports
jakarta.validation.ValidationException, org.hibernate.validator.Incubating

Facet of a constraint mapping creational context which allows to select a type argument or the component type of the (return) type of the current property, parameter or method as target for the next operations.
Author
Gunnar Morling
Since
6.0

Method Summary

Modifier and TypeMethod and Description
public ContainerElementConstraintMappingContext

Returns:

A creational context representing the single type argument or the component type of the current element's type.
containerElementType
()

Selects the single type argument of the current element's generic type as the target for the next operations.

public ContainerElementConstraintMappingContext

Returns:

A creational context representing the specified type argument.
containerElementType
(int
The index of the type argument to configure. Pass 0 when navigating into an array type.
index
,
int...
the nested index(es) in case the container element to configure is a generic type within another generic type, e.g. List<Map<String, String>>, a multi-dimensional array or a combination of (nested) parameterized and array types.
nestedIndexes
)

Selects the single type argument of the current element's generic type as the target for the next operations.

Method Detail

containerElementTypeback to summary
public ContainerElementConstraintMappingContext containerElementType()

Selects the single type argument of the current element's generic type as the target for the next operations. Selects the component type if the current element is of an array type.

Returns:ContainerElementConstraintMappingContext

A creational context representing the single type argument or the component type of the current element's type.

Exceptions
ValidationException:
If the given element (property, return value or parameter) is not of a generic type nor of an array type or is a generic type but has more than one type argument.
containerElementTypeback to summary
public ContainerElementConstraintMappingContext containerElementType(int index, int... nestedIndexes)

Selects the single type argument of the current element's generic type as the target for the next operations. Selects the component type if the current element is of an array type.

Parameters
index:int

The index of the type argument to configure. Pass 0 when navigating into an array type.

nestedIndexes:int[]

the nested index(es) in case the container element to configure is a generic type within another generic type, e.g. List<Map<String, String>>, a multi-dimensional array or a combination of (nested) parameterized and array types.

Returns:ContainerElementConstraintMappingContext

A creational context representing the specified type argument.

Exceptions
ValidationException:
If the given element (property, return value or parameter) is not of a generic type nor of an array type or is a generic type but has no type argument with the given index.