org.hibernate.validator.internal.metadata.raw

## Class AbstractConstrainedElement

- java.lang.Object
- - org.hibernate.validator.internal.metadata.raw.AbstractConstrainedElement

- All Implemented Interfaces:
    Iterable<MetaConstraint<?>>, ConstrainedElement
  Direct Known Subclasses:
    ConstrainedExecutable, ConstrainedField, ConstrainedParameter, ConstrainedType

      public abstract class AbstractConstrainedElement
      extends Object
      implements ConstrainedElement

  Base implementation of with functionality common to all `ConstrainedElement` implementations.
  Author:
    Gunnar Morling, Hardy Ferentschik

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.hibernate.validator.internal.metadata.raw.ConstrainedElement

      `ConstrainedElement.ConstrainedElementKind`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Set<MetaConstraint<?>>` | `constraints`
    `protected Map<Class<?>,Class<?>>` | `groupConversions`
    `protected boolean` | `isCascading`
    `protected ConstraintLocation` | `location`
    `protected boolean` | `requiresUnwrapping`
    `protected ConfigurationSource` | `source`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractConstrainedElement(ConfigurationSource source, ConstrainedElement.ConstrainedElementKind kind, ConstraintLocation location, Set<MetaConstraint<?>> constraints, Map<Class<?>,Class<?>> groupConversions, boolean isCascading, boolean requiresUnwrapping)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `Set<MetaConstraint<?>>` | `getConstraints()` Returns a set containing the constraints specified for this constrained element.
    `Map<Class<?>,Class<?>>` | `getGroupConversions()` Returns a map with the group conversions for this constrained element, as e.g.
    `ConstrainedElement.ConstrainedElementKind` | `getKind()` Returns the kind of this constrained element.
    `ConstraintLocation` | `getLocation()` Returns the location of this constrained element.
    `int` | `hashCode()`
    `boolean` | `isCascading()` Whether cascading validation for the represented element shall be performed or not.
    `boolean` | `isConstrained()` Whether this element is constrained or not.
    `Iterator<MetaConstraint<?>>` | `iterator()`
    `boolean` | `requiresUnwrapping()` Whether this element is marked for unwrapping prior to validation or not.
    `String` | `toString()`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### source

          protected final ConfigurationSource source

    - #### location

          protected final ConstraintLocation location

    - #### constraints

          protected final Set<MetaConstraint<?>> constraints

    - #### groupConversions

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

    - #### isCascading

          protected final boolean isCascading

    - #### requiresUnwrapping

          protected final boolean requiresUnwrapping

  - ### Constructor Detail

    - #### AbstractConstrainedElement

          public AbstractConstrainedElement(ConfigurationSource source,
                                    ConstrainedElement.ConstrainedElementKind kind,
                                    ConstraintLocation location,
                                    Set<MetaConstraint<?>> constraints,
                                    Map<Class<?>,Class<?>> groupConversions,
                                    boolean isCascading,
                                    boolean requiresUnwrapping)

  - ### Method Detail

    - #### getKind

          public ConstrainedElement.ConstrainedElementKind getKind()

      Description copied from interface: `ConstrainedElement`
      Returns the kind of this constrained element.
      Specified by:
        `getKind` in interface `ConstrainedElement`
      Returns:
        The kind of this constrained element.

    - #### getLocation

          public ConstraintLocation getLocation()

      Description copied from interface: `ConstrainedElement`
      Returns the location of this constrained element.
      Specified by:
        `getLocation` in interface `ConstrainedElement`
      Returns:
        The location of this constrained element.

    - #### iterator

          public Iterator<MetaConstraint<?>> iterator()

      Specified by:
        `iterator` in interface `Iterable<MetaConstraint<?>>`

    - #### getConstraints

          public Set<MetaConstraint<?>> getConstraints()

      Description copied from interface: `ConstrainedElement`
      Returns a set containing the constraints specified for this constrained element.
      Specified by:
        `getConstraints` in interface `ConstrainedElement`
      Returns:
        A set with this constrained element's constraints. May be empty, but never `null`.

    - #### getGroupConversions

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

      Description copied from interface: `ConstrainedElement`
      Returns a map with the group conversions for this constrained element, as e.g. given using the `@ConvertGroup` annotation.
      Specified by:
        `getGroupConversions` in interface `ConstrainedElement`
      Returns:
        A map with this constrained element's group conversions. May be empty, but never `null`.

    - #### isCascading

          public boolean isCascading()

      Description copied from interface: `ConstrainedElement`
      Whether cascading validation for the represented element shall be performed or not.
      Specified by:
        `isCascading` in interface `ConstrainedElement`
      Returns:
        `True`, if cascading validation for the represented element shall be performed, `false` otherwise.

    - #### isConstrained

          public boolean isConstrained()

      Description copied from interface: `ConstrainedElement`
      Whether this element is constrained or not. This is the case, if this element has at least one constraint or a cascaded validation shall be performed for it.
      Specified by:
        `isConstrained` in interface `ConstrainedElement`
      Returns:
        `True`, if this element is constrained, `false` otherwise.

    - #### requiresUnwrapping

          public boolean requiresUnwrapping()

      Description copied from interface: `ConstrainedElement`
      Whether this element is marked for unwrapping prior to validation or not.
      Specified by:
        `requiresUnwrapping` in interface `ConstrainedElement`
      Returns:
        `true` if the value to be validated needs to unwrapped, `false` otherwise.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

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