org.hibernate.validator.internal.metadata.raw
Class AbstractConstrainedElement

java.lang.Object
  extended by org.hibernate.validator.internal.metadata.raw.AbstractConstrainedElement
All Implemented Interfaces:
Iterable<MetaConstraint<?>>, ConstrainedElement
Direct Known Subclasses:
ConstrainedField, ConstrainedMethod, 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
 
Constructor Summary
AbstractConstrainedElement(ConfigurationSource source, ConstrainedElement.ConstrainedElementKind kind, ConstraintLocation location, Set<MetaConstraint<?>> constraints, boolean isCascading)
           
 
Method Summary
 boolean equals(Object obj)
           
 Set<MetaConstraint<?>> getConstraints()
          Returns a set containing the constraints specified for this constrained element.
 ConstrainedElement.ConstrainedElementKind getKind()
          Returns the kind of this constrained element.
 ConstraintLocation getLocation()
          Returns the location of this constrained element.
 ConfigurationSource getSource()
           
 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()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractConstrainedElement

public AbstractConstrainedElement(ConfigurationSource source,
                                  ConstrainedElement.ConstrainedElementKind kind,
                                  ConstraintLocation location,
                                  Set<MetaConstraint<?>> constraints,
                                  boolean isCascading)
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.

getSource

public ConfigurationSource getSource()

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.

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.

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 © 2012 Oracle Corporation. All Rights Reserved.