org.hibernate.validator.internal.cfg.context

## Class CascadableConstraintMappingContextImplBase<C extends Cascadable<C> & Unwrapable<C>>

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

- All Implemented Interfaces:
    Cascadable<C>, Unwrapable<C>
  Direct Known Subclasses:
    ParameterConstraintMappingContextImpl, PropertyConstraintMappingContextImpl, ReturnValueConstraintMappingContextImpl

      public abstract class CascadableConstraintMappingContextImplBase<C extends Cascadable<C> & Unwrapable<C>>
      extends ConstraintMappingContextImplBase
      implements Cascadable<C>, Unwrapable<C>

  Base class for all implementations of cascadable context types.
  Author:
    Gunnar Morling

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Map<Class<?>,Class<?>>` | `groupConversions`
    `protected boolean` | `isCascading`

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

      `mapping`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CascadableConstraintMappingContextImplBase(DefaultConstraintMapping mapping)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addGroupConversion(Class<?> from, Class<?> to)` Adds a group conversion for this element.
    `GroupConversionTargetContext<C>` | `convertGroup(Class<?> from)` Adds a group conversion for this cascadable element.
    `Map<Class<?>,Class<?>>` | `getGroupConversions()`
    `protected abstract C` | `getThis()` Returns this object, narrowed down to the specific sub-type.
    `boolean` | `isCascading()`
    `C` | `unwrapValidatedValue()` Marks the current element (property, parameter etc.) as unwrapable.
    `C` | `valid()` Marks the current element (property, parameter etc.) as cascadable.

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

      `addConstraint, getConstraintMapping, getConstraints, getConstraintType, type`

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

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

- - ### Field Detail

    - #### isCascading

          protected boolean isCascading

    - #### groupConversions

          protected Map<Class<?>,Class<?>> groupConversions

  - ### Constructor Detail

    - #### CascadableConstraintMappingContextImplBase

          public CascadableConstraintMappingContextImplBase(DefaultConstraintMapping mapping)

  - ### Method Detail

    - #### getThis

          protected abstract C getThis()

      Returns this object, narrowed down to the specific sub-type.
      Returns:
        this object, narrowed down to the specific sub-type
      See Also:
        "Get this" trick

    - #### addGroupConversion

          public void addGroupConversion(Class<?> from,
                                Class<?> to)

      Adds a group conversion for this element.
      Parameters:
        `from` - the source group of the conversion
        `to` - the target group of the conversion

    - #### valid

          public C valid()

      Description copied from interface: `Cascadable`
      Marks the current element (property, parameter etc.) as cascadable.
      Specified by:
        `valid` in interface `Cascadable<C extends Cascadable<C> & Unwrapable<C>>`
      Returns:
        The current creational context following the method chaining pattern.

    - #### convertGroup

          public GroupConversionTargetContext<C> convertGroup(Class<?> from)

      Description copied from interface: `Cascadable`
      Adds a group conversion for this cascadable element. Several conversions may be configured for one element.
      Specified by:
        `convertGroup` in interface `Cascadable<C extends Cascadable<C> & Unwrapable<C>>`
      Parameters:
        `from` - the source group of the conversion to be configured
      Returns:
        a creational context allow to set the target group of the conversion

    - #### isCascading

          public boolean isCascading()

    - #### getGroupConversions

          public Map<Class<?>,Class<?>> getGroupConversions()

    - #### unwrapValidatedValue

          public C unwrapValidatedValue()

      Description copied from interface: `Unwrapable`
      Marks the current element (property, parameter etc.) as unwrapable. Equivalent to annotating this element with `UnwrapValidatedValue`.
      Specified by:
        `unwrapValidatedValue` in interface `Unwrapable<C extends Cascadable<C> & Unwrapable<C>>`
      Returns:
        The current creational context following the method chaining pattern.

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