Top Fields Constructors Methods
org.hibernate.validator.internal.cfg.context

public Class ContainerElementConstraintMappingContextImpl

extends CascadableConstraintMappingContextImplBase<ContainerElementConstraintMappingContext>
implements ContainerElementConstraintMappingContext
Class Inheritance
All Implemented Interfaces
org.hibernate.validator.cfg.context.ContainerElementConstraintMappingContext, org.hibernate.validator.cfg.context.Cascadable, org.hibernate.validator.cfg.context.ReturnValueTarget, org.hibernate.validator.cfg.context.ParameterTarget, org.hibernate.validator.cfg.context.ContainerElementTarget, org.hibernate.validator.cfg.context.MethodTarget, org.hibernate.validator.cfg.context.ConstructorTarget, org.hibernate.validator.cfg.context.PropertyTarget, org.hibernate.validator.cfg.context.ConstraintMappingTarget, org.hibernate.validator.cfg.context.ConstraintDefinitionTarget, org.hibernate.validator.cfg.context.TypeTarget, org.hibernate.validator.cfg.context.Constrainable
Imports
java.lang.annotation.Annotation, .ElementType, java.lang.invoke.MethodHandles, java.lang.reflect.ParameterizedType, .Type, .TypeVariable, java.util.Arrays, .HashMap, .HashSet, .Map, .Set, java.util.function.Function, java.util.stream.Collectors, .Stream, org.hibernate.validator.cfg.ConstraintDef, org.hibernate.validator.cfg.context.ConstructorConstraintMappingContext, .ContainerElementConstraintMappingContext, .ContainerElementTarget, .MethodConstraintMappingContext, .ParameterConstraintMappingContext, .ParameterTarget, .PropertyConstraintMappingContext, .ReturnValueConstraintMappingContext, .ReturnValueTarget, org.hibernate.validator.internal.engine.ConstraintCreationContext, org.hibernate.validator.internal.engine.valueextraction.ArrayElement, org.hibernate.validator.internal.metadata.aggregated.CascadingMetaDataBuilder, org.hibernate.validator.internal.metadata.core.MetaConstraint, .MetaConstraints, org.hibernate.validator.internal.metadata.descriptor.ConstraintDescriptorImpl, .ConstraintDescriptorImpl.ConstraintType, org.hibernate.validator.internal.metadata.location.ConstraintLocation, org.hibernate.validator.internal.util.ReflectionHelper, .StringHelper, .TypeHelper, org.hibernate.validator.internal.util.logging.Log, .LoggerFactory

Author
Gunnar Morling

Field Summary

Modifier and TypeField and Description
private final Type
private final Set<ConfiguredConstraint<?>>
private final int
index

The index of the type parameter configured through this context.

private static final Log
protected final Map<Integer, ContainerElementConstraintMappingContextImpl>
nestedContainerElementContexts

Contexts for configuring nested container elements, if any.

private final ContainerElementTarget
private final ConstraintLocation
private final TypeConstraintMappingContextImpl<?>
typeContext

Deprecated as a consequence of TypeConstraintMappingContextImpl being deprecated.
private final TypeVariable<?>
typeParameter

The type parameter configured through this context.

Inherited from org.hibernate.validator.internal.cfg.context.CascadableConstraintMappingContextImplBase:
groupConversionsisCascading

Constructor Summary

AccessConstructor and Description
pack-priv
ContainerElementConstraintMappingContextImpl(TypeConstraintMappingContextImpl<?> typeContext, ContainerElementTarget parentContainerElementTarget, ConstraintLocation parentLocation, int index)

Deprecated as a consequence of TypeConstraintMappingContextImpl being deprecated.

Method Summary

Modifier and TypeMethod and Description
private <A extends Annotation> MetaConstraint<A>
pack-priv Set<MetaConstraint<?>>
build(ConstraintCreationContext constraintCreationContext)

public ContainerElementConstraintMappingContext
constraint(ConstraintDef<?, ?>
The constraint to add.
definition
)

Implements org.hibernate.validator.cfg.context.Constrainable.constraint.

Adds a new constraint.
public ConstructorConstraintMappingContext
constructor(Class<?>...
The constructor parameter types.
parameterTypes
)

Implements org.hibernate.validator.cfg.context.ConstructorTarget.constructor.

Selects a constructor to which the next operations shall apply.
public ContainerElementConstraintMappingContext
containerElementType()

Implements org.hibernate.validator.cfg.context.ContainerElementTarget.containerElementType.

Selects the single type argument of the current element's generic type as the target for the next operations.
public ContainerElementConstraintMappingContext
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
)

Implements org.hibernate.validator.cfg.context.ContainerElementTarget.containerElementType.

Selects the single type argument of the current element's generic type as the target for the next operations.
public PropertyConstraintMappingContext
field(String
The field name that represents a property on which to apply the following constraints.
property
)

Implements org.hibernate.validator.cfg.context.PropertyTarget.field.

Deprecated as a consequence of PropertyConstraintMappingContext being deprecated.
Selects a field to which the next operations shall apply.
protected ConstraintDescriptorImpl.ConstraintType
getConstraintType()

Implements abstract org.hibernate.validator.internal.cfg.context.ConstraintMappingContextImplBase.getConstraintType.

Returns the type of constraints hosted on the element configured by this creational context.
pack-priv CascadingMetaDataBuilder
private Type
public PropertyConstraintMappingContext
getter(String
The getter property name (using the Java Bean notation, e.g. name to address getName()) that represents a property on which to apply the following constraints.
property
)

Implements org.hibernate.validator.cfg.context.PropertyTarget.getter.

Deprecated as a consequence of PropertyConstraintMappingContext being deprecated.
Selects a getter to which the next operations shall apply.
protected ContainerElementConstraintMappingContext
getThis()

Implements abstract org.hibernate.validator.internal.cfg.context.CascadableConstraintMappingContextImplBase.getThis.

Returns this object, narrowed down to the specific sub-type.
public MethodConstraintMappingContext
method(String
The method name.
name
,
Class<?>...
The method parameter types.
parameterTypes
)

Implements org.hibernate.validator.cfg.context.MethodTarget.method.

Selects a method to which the next operations shall apply.
pack-priv ContainerElementConstraintMappingContext
nestedContainerElement(int[] nestedIndexes)

public ParameterConstraintMappingContext
parameter(int
The parameter index.
index
)

Implements org.hibernate.validator.cfg.context.ParameterTarget.parameter.

Changes the parameter for which added constraints apply.
public PropertyConstraintMappingContext
property(String
The property on which to apply the following constraints (Java Bean notation).
property
,
ElementType
The access type (field/property).
elementType
)

Implements org.hibernate.validator.cfg.context.PropertyTarget.property.

Deprecated
Selects a property to which the next operations shall apply.
public ReturnValueConstraintMappingContext
returnValue()

Implements org.hibernate.validator.cfg.context.ReturnValueTarget.returnValue.

Selects the current method's return value as the target for the next operations.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from org.hibernate.validator.internal.cfg.context.CascadableConstraintMappingContextImplBase:
addGroupConversioncontainerElementcontainerElementconvertGroupgetCascadingMetaDataBuildergetTypeArgumentConstraintsisCascadingvalid

Field Detail

configuredTypeback to summary
private final Type configuredType

Hides org.hibernate.validator.internal.cfg.context.CascadableConstraintMappingContextImplBase.configuredType.

The type configured through this context. Either a ParameterizedType or an array type.

constraintsback to summary
private final Set<ConfiguredConstraint<?>> constraints

Hides org.hibernate.validator.internal.cfg.context.ConstraintMappingContextImplBase.constraints.

indexback to summary
private final int index

The index of the type parameter configured through this context. Always 0 in case of an array type.

LOGback to summary
private static final Log LOG

Hides org.hibernate.validator.internal.cfg.context.CascadableConstraintMappingContextImplBase.LOG.

nestedContainerElementContextsback to summary
protected final Map<Integer, ContainerElementConstraintMappingContextImpl> nestedContainerElementContexts

Contexts for configuring nested container elements, if any. Indexed by type parameter.

parentContainerElementTargetback to summary
private final ContainerElementTarget parentContainerElementTarget
parentLocationback to summary
private final ConstraintLocation parentLocation
typeContextback to summary
private final TypeConstraintMappingContextImpl<?> typeContext

Deprecated

as a consequence of TypeConstraintMappingContextImpl being deprecated. See corresponding docs for further information.

typeParameterback to summary
private final TypeVariable<?> typeParameter

The type parameter configured through this context. An instance of ArrayElement in case of an array type.

Constructor Detail

ContainerElementConstraintMappingContextImplback to summary
pack-priv ContainerElementConstraintMappingContextImpl(TypeConstraintMappingContextImpl<?> typeContext, ContainerElementTarget parentContainerElementTarget, ConstraintLocation parentLocation, int index)

Deprecated

as a consequence of TypeConstraintMappingContextImpl being deprecated. See corresponding docs for further information.

Method Detail

asMetaConstraintback to summary
private <A extends Annotation> MetaConstraint<A> asMetaConstraint(ConfiguredConstraint<A> config, ConstraintCreationContext constraintCreationContext)

Hides org.hibernate.validator.internal.cfg.context.ConstraintMappingContextImplBase.asMetaConstraint.

buildback to summary
pack-priv Set<MetaConstraint<?>> build(ConstraintCreationContext constraintCreationContext)
constraintback to summary
public ContainerElementConstraintMappingContext constraint(ConstraintDef<?, ?> definition)

Implements org.hibernate.validator.cfg.context.Constrainable.constraint.

Doc from org.hibernate.validator.cfg.context.Constrainable.constraint.

Adds a new constraint.

Parameters
definition:ConstraintDef<?, ?>

The constraint to add.

Returns:ContainerElementConstraintMappingContext

The current creational context following the method chaining pattern.

Annotations
@Override
constructorback to summary
public ConstructorConstraintMappingContext constructor(Class<?>... parameterTypes)

Implements org.hibernate.validator.cfg.context.ConstructorTarget.constructor.

Doc from org.hibernate.validator.cfg.context.ConstructorTarget.constructor.

Selects a constructor to which the next operations shall apply.

Until this method is called constraints apply on class level. After calling this method constraints apply to the specified constructor.

A given constructor may only be configured once.

Parameters
parameterTypes:Class<?>[]

The constructor parameter types.

Returns:ConstructorConstraintMappingContext

A creational context representing the selected constructor.

Annotations
@Override
containerElementTypeback to summary
public ContainerElementConstraintMappingContext containerElementType()

Implements org.hibernate.validator.cfg.context.ContainerElementTarget.containerElementType.

Doc from org.hibernate.validator.cfg.context.ContainerElementTarget.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.

Annotations
@Override
containerElementTypeback to summary
public ContainerElementConstraintMappingContext containerElementType(int index, int... nestedIndexes)

Implements org.hibernate.validator.cfg.context.ContainerElementTarget.containerElementType.

Doc from org.hibernate.validator.cfg.context.ContainerElementTarget.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.

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.

Annotations
@Override
fieldback to summary
public PropertyConstraintMappingContext field(String property)

Implements org.hibernate.validator.cfg.context.PropertyTarget.field.

Doc from org.hibernate.validator.cfg.context.PropertyTarget.field.

Deprecated

as a consequence of PropertyConstraintMappingContext being deprecated. See corresponding docs for further information.

Selects a field to which the next operations shall apply.

Until this method is called constraints apply on class level. After calling this method constraints apply on the specified field property.

A given field may only be configured once.

Parameters
property:String

The field name that represents a property on which to apply the following constraints.

Returns:PropertyConstraintMappingContext

A creational context representing the selected field property.

Annotations
@Override
getConstraintTypeback to summary
protected ConstraintDescriptorImpl.ConstraintType getConstraintType()

Implements abstract org.hibernate.validator.internal.cfg.context.ConstraintMappingContextImplBase.getConstraintType.

Doc from org.hibernate.validator.internal.cfg.context.ConstraintMappingContextImplBase.getConstraintType.

Returns the type of constraints hosted on the element configured by this creational context.

Returns:ConstraintDescriptorImpl.ConstraintType

the type of constraints hosted on the element configured by this creational context

Annotations
@Override
getContainerElementCascadingMetaDataBuilderback to summary
pack-priv CascadingMetaDataBuilder getContainerElementCascadingMetaDataBuilder()
getContainerElementTypeback to summary
private Type getContainerElementType()
getterback to summary
public PropertyConstraintMappingContext getter(String property)

Implements org.hibernate.validator.cfg.context.PropertyTarget.getter.

Doc from org.hibernate.validator.cfg.context.PropertyTarget.getter.

Deprecated

as a consequence of PropertyConstraintMappingContext being deprecated. See corresponding docs for further information.

Selects a getter to which the next operations shall apply.

Until this method is called constraints apply on class level. After calling this method constraints apply on the specified getter property.

A given getter may only be configured once.

Parameters
property:String

The getter property name (using the Java Bean notation, e.g. name to address getName()) that represents a property on which to apply the following constraints.

Returns:PropertyConstraintMappingContext

A creational context representing the selected getter property.

Annotations
@Override
getThisback to summary
protected ContainerElementConstraintMappingContext getThis()

Implements abstract org.hibernate.validator.internal.cfg.context.CascadableConstraintMappingContextImplBase.getThis.

Doc from org.hibernate.validator.internal.cfg.context.CascadableConstraintMappingContextImplBase.getThis.

Returns this object, narrowed down to the specific sub-type.

Returns:ContainerElementConstraintMappingContext

this object, narrowed down to the specific sub-type

Annotations
@Override
methodback to summary
public MethodConstraintMappingContext method(String name, Class<?>... parameterTypes)

Implements org.hibernate.validator.cfg.context.MethodTarget.method.

Doc from org.hibernate.validator.cfg.context.MethodTarget.method.

Selects a method to which the next operations shall apply.

Until this method is called constraints apply on class level. After calling this method constraints apply to the specified method.

A given method may only be configured once.

Parameters
name:String

The method name.

parameterTypes:Class<?>[]

The method parameter types.

Returns:MethodConstraintMappingContext

A creational context representing the selected method.

Annotations
@Override
nestedContainerElementback to summary
pack-priv ContainerElementConstraintMappingContext nestedContainerElement(int[] nestedIndexes)
parameterback to summary
public ParameterConstraintMappingContext parameter(int index)

Implements org.hibernate.validator.cfg.context.ParameterTarget.parameter.

Doc from org.hibernate.validator.cfg.context.ParameterTarget.parameter.

Changes the parameter for which added constraints apply. A given parameter may only be configured once.

Parameters
index:int

The parameter index.

Returns:ParameterConstraintMappingContext

A creational context representing the selected parameter.

Annotations
@Override
propertyback to summary
public PropertyConstraintMappingContext property(String property, ElementType elementType)

Implements org.hibernate.validator.cfg.context.PropertyTarget.property.

Doc from org.hibernate.validator.cfg.context.PropertyTarget.property.

Deprecated

Selects a property to which the next operations shall apply.

Until this method is called constraints apply on class level. After calling this method constraints apply on the specified property with the given access type.

A given property may only be configured once.

Parameters
property:String

The property on which to apply the following constraints (Java Bean notation).

elementType:ElementType

The access type (field/property).

Returns:PropertyConstraintMappingContext

A creational context representing the selected property.

Annotations
@Override
@Deprecated
returnValueback to summary
public ReturnValueConstraintMappingContext returnValue()

Implements org.hibernate.validator.cfg.context.ReturnValueTarget.returnValue.

Doc from org.hibernate.validator.cfg.context.ReturnValueTarget.returnValue.

Selects the current method's return value as the target for the next operations. The return value of one method or constructor may only be configured more once.

Returns:ReturnValueConstraintMappingContext

A creational context representing the current method's or constructor's return value.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override