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

pack-priv final Class ParameterConstraintMappingContextImpl

extends CascadableConstraintMappingContextImplBase<ParameterConstraintMappingContext>
implements ParameterConstraintMappingContext
Class Inheritance
All Implemented Interfaces
org.hibernate.validator.cfg.context.ParameterConstraintMappingContext, org.hibernate.validator.cfg.context.AnnotationIgnoreOptions, org.hibernate.validator.cfg.context.Cascadable, org.hibernate.validator.cfg.context.Constrainable, org.hibernate.validator.cfg.context.ContainerElementTarget, org.hibernate.validator.cfg.context.MethodTarget, org.hibernate.validator.cfg.context.ConstructorTarget, org.hibernate.validator.cfg.context.ReturnValueTarget, org.hibernate.validator.cfg.context.ParameterTarget, org.hibernate.validator.cfg.context.CrossParameterTarget, org.hibernate.validator.cfg.context.ConstraintMappingTarget, org.hibernate.validator.cfg.context.ConstraintDefinitionTarget, org.hibernate.validator.cfg.context.TypeTarget
Imports
java.lang.reflect.Type, org.hibernate.validator.cfg.ConstraintDef, org.hibernate.validator.cfg.context.ConstructorConstraintMappingContext, .ContainerElementConstraintMappingContext, .CrossParameterConstraintMappingContext, .MethodConstraintMappingContext, .ParameterConstraintMappingContext, .ReturnValueConstraintMappingContext, org.hibernate.validator.internal.engine.ConstraintCreationContext, org.hibernate.validator.internal.metadata.descriptor.ConstraintDescriptorImpl.ConstraintType, org.hibernate.validator.internal.metadata.location.ConstraintLocation, org.hibernate.validator.internal.metadata.raw.ConfigurationSource, .ConstrainedParameter

Constraint mapping creational context which allows to configure the constraints for one method parameter.
Authors
Hardy Ferentschik, Gunnar Morling, Kevin Pollet <[email protected]> (C) 2011 SERLI

Field Summary

Modifier and TypeField and Description
private final ExecutableConstraintMappingContextImpl
private final int
Inherited from org.hibernate.validator.internal.cfg.context.CascadableConstraintMappingContextImplBase:
groupConversionsisCascading

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public ConstrainedParameter
build(ConstraintCreationContext constraintCreationContext)

public ParameterConstraintMappingContext
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 CrossParameterConstraintMappingContext
crossParameter()

Implements org.hibernate.validator.cfg.context.CrossParameterTarget.crossParameter.

Selects the cross-parameter element of a method or constructor as target for the next constraint declaration operations.
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.
protected ParameterConstraintMappingContext
getThis()

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

Returns this object, narrowed down to the specific sub-type.
public ParameterConstraintMappingContext
ignoreAnnotations(boolean
Whether to ignore annotation-based constraints or not.
ignoreAnnotations
)

Implements org.hibernate.validator.cfg.context.AnnotationIgnoreOptions.ignoreAnnotations.

Specifies whether annotations at the given element should be ignored or not, overriding any setting given for parent elements.
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.
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 ReturnValueConstraintMappingContext
returnValue()

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

Selects the current method's return value as the target for the next operations.
Inherited from org.hibernate.validator.internal.cfg.context.CascadableConstraintMappingContextImplBase:
addGroupConversioncontainerElementcontainerElementconvertGroupgetCascadingMetaDataBuildergetTypeArgumentConstraintsisCascadingvalid

Field Detail

executableContextback to summary
private final ExecutableConstraintMappingContextImpl executableContext
parameterIndexback to summary
private final int parameterIndex

Constructor Detail

ParameterConstraintMappingContextImplback to summary
pack-priv ParameterConstraintMappingContextImpl(ExecutableConstraintMappingContextImpl executableContext, int parameterIndex)

Method Detail

buildback to summary
public ConstrainedParameter build(ConstraintCreationContext constraintCreationContext)
constraintback to summary
public ParameterConstraintMappingContext 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:ParameterConstraintMappingContext

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
crossParameterback to summary
public CrossParameterConstraintMappingContext crossParameter()

Implements org.hibernate.validator.cfg.context.CrossParameterTarget.crossParameter.

Doc from org.hibernate.validator.cfg.context.CrossParameterTarget.crossParameter.

Selects the cross-parameter element of a method or constructor as target for the next constraint declaration operations. May only be configured once for a given method or constructor.

Returns:CrossParameterConstraintMappingContext

A creational context representing the cross-parameter element of the current method or constructor.

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
getThisback to summary
protected ParameterConstraintMappingContext 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:ParameterConstraintMappingContext

this object, narrowed down to the specific sub-type

Annotations
@Override
ignoreAnnotationsback to summary
public ParameterConstraintMappingContext ignoreAnnotations(boolean ignoreAnnotations)

Implements org.hibernate.validator.cfg.context.AnnotationIgnoreOptions.ignoreAnnotations.

Doc from org.hibernate.validator.cfg.context.AnnotationIgnoreOptions.ignoreAnnotations.

Specifies whether annotations at the given element should be ignored or not, overriding any setting given for parent elements. E.g. the setting given for a method parameter overrides the setting given for the method declaring that parameter.

Parameters
ignoreAnnotations:boolean

Whether to ignore annotation-based constraints or not.

Returns:ParameterConstraintMappingContext

This context for method chaining.

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
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
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