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

pack-priv final Class CrossParameterConstraintMappingContextImpl

extends ConstraintMappingContextImplBase
implements CrossParameterConstraintMappingContext
Class Inheritance
All Implemented Interfaces
org.hibernate.validator.cfg.context.CrossParameterConstraintMappingContext, org.hibernate.validator.cfg.context.AnnotationIgnoreOptions, org.hibernate.validator.cfg.context.Constrainable, org.hibernate.validator.cfg.context.ReturnValueTarget, org.hibernate.validator.cfg.context.ParameterTarget, org.hibernate.validator.cfg.context.MethodTarget, org.hibernate.validator.cfg.context.ConstructorTarget, org.hibernate.validator.cfg.context.ConstraintMappingTarget, org.hibernate.validator.cfg.context.ConstraintDefinitionTarget, org.hibernate.validator.cfg.context.TypeTarget
Imports
org.hibernate.validator.cfg.ConstraintDef, org.hibernate.validator.cfg.context.ConstructorConstraintMappingContext, .CrossParameterConstraintMappingContext, .MethodConstraintMappingContext, .ParameterConstraintMappingContext, .ReturnValueConstraintMappingContext, org.hibernate.validator.internal.metadata.descriptor.ConstraintDescriptorImpl.ConstraintType

Constraint mapping creational context which allows to configure cross-parameter constraints for a method or constructor.
Author
Gunnar Morling

Field Summary

Modifier and TypeField and Description
private final ExecutableConstraintMappingContextImpl

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public CrossParameterConstraintMappingContext
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.
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.
public CrossParameterConstraintMappingContext
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.ConstraintMappingContextImplBase:
addConstraintgetConstraintMappinggetConstraints

Field Detail

executableContextback to summary
private final ExecutableConstraintMappingContextImpl executableContext

Constructor Detail

CrossParameterConstraintMappingContextImplback to summary
pack-priv CrossParameterConstraintMappingContextImpl(ExecutableConstraintMappingContextImpl executableContext)

Method Detail

constraintback to summary
public CrossParameterConstraintMappingContext 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:CrossParameterConstraintMappingContext

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
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
ignoreAnnotationsback to summary
public CrossParameterConstraintMappingContext 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:CrossParameterConstraintMappingContext

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