org.hibernate.validator.internal.cfg.context

## Class PropertyConstraintMappingContextImpl

- java.lang.Object
- - org.hibernate.validator.internal.cfg.context.ConstraintMappingContextImplBase
  - - org.hibernate.validator.internal.cfg.context.CascadableConstraintMappingContextImplBase<PropertyConstraintMappingContext>
    - - org.hibernate.validator.internal.cfg.context.PropertyConstraintMappingContextImpl

- All Implemented Interfaces:
    AnnotationProcessingOptions<PropertyConstraintMappingContext>, Cascadable<PropertyConstraintMappingContext>, Constrainable<PropertyConstraintMappingContext>, ConstructorTarget, MethodTarget, PropertyConstraintMappingContext, PropertyTarget, TypeTarget, Unwrapable<PropertyConstraintMappingContext>

      public final class PropertyConstraintMappingContextImpl
      extends CascadableConstraintMappingContextImplBase<PropertyConstraintMappingContext>
      implements PropertyConstraintMappingContext

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

- - ### Field Summary

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

      `groupConversions, isCascading`

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

      `mapping`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PropertyConstraintMappingContextImpl(TypeConstraintMappingContextImpl<?> typeContext, Member member)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ConstrainedElement` | `build(ConstraintHelper constraintHelper)`
    `PropertyConstraintMappingContext` | `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.
    `protected PropertyConstraintMappingContextImpl` | `getThis()` Returns this object, narrowed down to the specific sub-type.
    `PropertyConstraintMappingContext` | `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.CascadableConstraintMappingContextImplBase

      `addGroupConversion, convertGroup, getGroupConversions, isCascading, unwrapValidatedValue, valid`

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

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

      `convertGroup, valid`

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

      `unwrapValidatedValue`

- - ### Constructor Detail

    - #### PropertyConstraintMappingContextImpl

          public PropertyConstraintMappingContextImpl(TypeConstraintMappingContextImpl<?> typeContext,
                                              Member member)

  - ### Method Detail

    - #### getThis

          protected PropertyConstraintMappingContextImpl getThis()

      Description copied from class: `CascadableConstraintMappingContextImplBase`
      Returns this object, narrowed down to the specific sub-type.
      Specified by:
        `getThis` in class `CascadableConstraintMappingContextImplBase<PropertyConstraintMappingContext>`
      Returns:
        this object, narrowed down to the specific sub-type
      See Also:
        "Get this" trick

    - #### constraint

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

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

    - #### ignoreAnnotations

          public PropertyConstraintMappingContext 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<PropertyConstraintMappingContext>`
      Returns:
        Returns itself for method chaining.

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

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

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

    - #### build

          public ConstrainedElement build(ConstraintHelper constraintHelper)

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