org.hibernate.validator.internal.cfg.context

## Class TypeConstraintMappingContextImpl<C>

- java.lang.Object
- - org.hibernate.validator.internal.cfg.context.ConstraintMappingContextImplBase
  - - org.hibernate.validator.internal.cfg.context.TypeConstraintMappingContextImpl<C>

- Type Parameters:
    `C` - The type represented by this creational context.
  All Implemented Interfaces:
    AnnotationProcessingOptions<TypeConstraintMappingContext<C>>, Constrainable<TypeConstraintMappingContext<C>>, ConstructorTarget, MethodTarget, PropertyTarget, TypeConstraintMappingContext<C>, TypeTarget

      public final class TypeConstraintMappingContextImpl<C>
      extends ConstraintMappingContextImplBase
      implements TypeConstraintMappingContext<C>

  Constraint mapping creational context which allows to configure the class-level constraints for one bean.
  Author:
    Hardy Ferentschik, Gunnar Morling, Kevin Pollet (C) 2011 SERLI

- - ### Field Summary

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

      `mapping`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TypeConstraintMappingContextImpl(DefaultConstraintMapping mapping, Class<C> beanClass)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `BeanConfiguration<C>` | `build(ConstraintHelper constraintHelper, ParameterNameProvider parameterNameProvider)`
    `TypeConstraintMappingContext<C>` | `constraint(ConstraintDef<?,?> definition)` Adds a new constraint.
    `ConstructorConstraintMappingContext` | `constructor(Class<?>... parameterTypes)` Selects a constructor to which the next operations shall apply.
    `TypeConstraintMappingContext<C>` | `defaultGroupSequence(Class<?>... defaultGroupSequence)` Defines the default group sequence for current type.
    `TypeConstraintMappingContext<C>` | `defaultGroupSequenceProviderClass(Class<? extends DefaultGroupSequenceProvider<? super C>> defaultGroupSequenceProviderClass)` Defines the default group sequence provider for the current type.
    `Class<?>` | `getBeanClass()`
    `protected ConstraintDescriptorImpl.ConstraintType` | `getConstraintType()` Returns the type of constraints hosted on the element configured by this creational context.
    `TypeConstraintMappingContext<C>` | `ignoreAllAnnotations()` Defines that all annotations for this type should be ignored.
    `TypeConstraintMappingContext<C>` | `ignoreAnnotations()` Specifies that annotations specified on the configured type or property should be ignored.
    `MethodConstraintMappingContext` | `method(String name, Class<?>... parameterTypes)` Selects a method to which the next operations shall apply.
    `PropertyConstraintMappingContext` | `property(String property, ElementType elementType)` Selects a property to which the next operations shall apply.

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

    - #### TypeConstraintMappingContextImpl

          public TypeConstraintMappingContextImpl(DefaultConstraintMapping mapping,
                                          Class<C> beanClass)

  - ### Method Detail

    - #### constraint

          public TypeConstraintMappingContext<C> constraint(ConstraintDef<?,?> definition)

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

    - #### ignoreAnnotations

          public TypeConstraintMappingContext<C> ignoreAnnotations()

      Description copied from interface: `AnnotationProcessingOptions`
      Specifies that annotations specified on the configured type or property should be ignored.
      Specified by:
        `ignoreAnnotations` in interface `AnnotationProcessingOptions<TypeConstraintMappingContext<C>>`
      Returns:
        Returns itself for method chaining.

    - #### ignoreAllAnnotations

          public TypeConstraintMappingContext<C> ignoreAllAnnotations()

      Description copied from interface: `TypeConstraintMappingContext`
      Defines that all annotations for this type should be ignored.
      Specified by:
        `ignoreAllAnnotations` in interface `TypeConstraintMappingContext<C>`
      Returns:
        The current creational context following the method chaining pattern.

    - #### defaultGroupSequence

          public TypeConstraintMappingContext<C> defaultGroupSequence(Class<?>... defaultGroupSequence)

      Description copied from interface: `TypeConstraintMappingContext`
      Defines the default group sequence for current type.
      Specified by:
        `defaultGroupSequence` in interface `TypeConstraintMappingContext<C>`
      Parameters:
        `defaultGroupSequence` - the default group sequence.
      Returns:
        The current creational context following the method chaining pattern.

    - #### defaultGroupSequenceProviderClass

          public TypeConstraintMappingContext<C> defaultGroupSequenceProviderClass(Class<? extends DefaultGroupSequenceProvider<? super C>> defaultGroupSequenceProviderClass)

      Description copied from interface: `TypeConstraintMappingContext`
      Defines the default group sequence provider for the current type.
      Specified by:
        `defaultGroupSequenceProviderClass` in interface `TypeConstraintMappingContext<C>`
      Parameters:
        `defaultGroupSequenceProviderClass` - The default group sequence provider class.
      Returns:
        The current creational context following the method chaining pattern.

    - #### property

          public PropertyConstraintMappingContext property(String property,
                                                  ElementType elementType)

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

      Specified by:
        `property` in interface `PropertyTarget`
      Parameters:
        `property` - The property on which to apply the following constraints (Java Bean notation).
        `elementType` - The access type (field/property).
      Returns:
        A creational context representing the selected property.

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

    - #### build

          public BeanConfiguration<C> build(ConstraintHelper constraintHelper,
                                   ParameterNameProvider parameterNameProvider)

    - #### getBeanClass

          public Class<?> getBeanClass()

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