org.hibernate.validator.internal.cfg.context

## Class CrossParameterConstraintMappingContextImpl

- java.lang.Object
- - org.hibernate.validator.internal.cfg.context.ConstraintMappingContextImplBase
  - - org.hibernate.validator.internal.cfg.context.CrossParameterConstraintMappingContextImpl

- All Implemented Interfaces:
    Constrainable<CrossParameterConstraintMappingContext>, ConstructorTarget, CrossParameterConstraintMappingContext, MethodTarget, ParameterTarget, ReturnValueTarget, TypeTarget

      public final class CrossParameterConstraintMappingContextImpl
      extends ConstraintMappingContextImplBase
      implements CrossParameterConstraintMappingContext

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

- - ### Field Summary

    - ### Fields inherited from class org.hibernate.validator.internal.cfg.context.ConstraintMappingContextImplBase

      `mapping`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CrossParameterConstraintMappingContextImpl(ExecutableConstraintMappingContextImpl executableContext)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `CrossParameterConstraintMappingContext` | `constraint(ConstraintDef<?,?> definition)` Adds a new constraint.
    `ConstructorConstraintMappingContext` | `constructor(Class<?>... parameterTypes)` Selects a constructor to which the next operations shall apply.
    `protected ConstraintDescriptorImpl.ConstraintType` | `getConstraintType()` Returns the type of constraints hosted on the element configured by this creational context.
    `MethodConstraintMappingContext` | `method(String name, Class<?>... parameterTypes)` Selects a method to which the next operations shall apply.
    `ParameterConstraintMappingContext` | `parameter(int index)` Changes the parameter for which added constraints apply.
    `ReturnValueConstraintMappingContext` | `returnValue()` Selects the current method's return value as the target for the next operations.

    - ### Methods inherited from class org.hibernate.validator.internal.cfg.context.ConstraintMappingContextImplBase

      `addConstraint, getConstraintMapping, getConstraints, type`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.hibernate.validator.cfg.context.TypeTarget

      `type`

- - ### Constructor Detail

    - #### CrossParameterConstraintMappingContextImpl

          public CrossParameterConstraintMappingContextImpl(ExecutableConstraintMappingContextImpl executableContext)

  - ### Method Detail

    - #### constraint

          public CrossParameterConstraintMappingContext constraint(ConstraintDef<?,?> definition)

      Description copied from interface: `Constrainable`
      Adds a new constraint.
      Specified by:
        `constraint` in interface `Constrainable<CrossParameterConstraintMappingContext>`
      Parameters:
        `definition` - The constraint to add.
      Returns:
        The current creational context following the method chaining pattern.

    - #### parameter

          public ParameterConstraintMappingContext parameter(int index)

      Description copied from interface: `ParameterTarget`
      Changes the parameter for which added constraints apply. A given parameter may only be configured once.
      Specified by:
        `parameter` in interface `ParameterTarget`
      Parameters:
        `index` - The parameter index.
      Returns:
        A creational context representing the selected parameter.

    - #### method

          public MethodConstraintMappingContext method(String name,
                                              Class<?>... parameterTypes)

      Description copied from interface: `MethodTarget`
      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.

      Specified by:
        `method` in interface `MethodTarget`
      Parameters:
        `name` - The method name.
        `parameterTypes` - The method parameter types.
      Returns:
        A creational context representing the selected method.

    - #### constructor

          public ConstructorConstraintMappingContext constructor(Class<?>... parameterTypes)

      Description copied from interface: `ConstructorTarget`
      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.

      Specified by:
        `constructor` in interface `ConstructorTarget`
      Parameters:
        `parameterTypes` - The constructor parameter types.
      Returns:
        A creational context representing the selected constructor.

    - #### returnValue

          public ReturnValueConstraintMappingContext returnValue()

      Description copied from interface: `ReturnValueTarget`
      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.
      Specified by:
        `returnValue` in interface `ReturnValueTarget`
      Returns:
        A creational context representing the current method's or constructor's return value.

    - #### getConstraintType

          protected ConstraintDescriptorImpl.ConstraintType getConstraintType()

      Description copied from class: `ConstraintMappingContextImplBase`
      Returns the type of constraints hosted on the element configured by this creational context.
      Specified by:
        `getConstraintType` in class `ConstraintMappingContextImplBase`
      Returns:
        the type of constraints hosted on the element configured by this creational context

Copyright © 2007-2014 Red Hat, Inc. All Rights Reserved