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 allConstrainedElementimplementations.- 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 Description protected CascadingMetaDataBuildercascadingMetaDataBuilderprotected Set<MetaConstraint<?>>constraintsprotected ConfigurationSourcesourceprotected Set<MetaConstraint<?>>typeArgumentConstraints
-
Constructor Summary
Constructors Constructor Description AbstractConstrainedElement(ConfigurationSource source, ConstrainedElement.ConstrainedElementKind kind, Set<MetaConstraint<?>> constraints, Set<MetaConstraint<?>> typeArgumentConstraints, CascadingMetaDataBuilder cascadingMetaDataBuilder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)CascadingMetaDataBuildergetCascadingMetaDataBuilder()Returns the cascading metadata (e.g.Set<MetaConstraint<?>>getConstraints()Returns a set containing the constraints specified for this constrained element.ConstrainedElement.ConstrainedElementKindgetKind()Returns the kind of this constrained element.ConfigurationSourcegetSource()Returns the configuration source contributing this constrained element.Set<MetaConstraint<?>>getTypeArgumentConstraints()Returns the type argument constraints of this element, if any.inthashCode()booleanisConstrained()Whether this element is constrained or not.Iterator<MetaConstraint<?>>iterator()StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
source
protected final ConfigurationSource source
-
constraints
protected final Set<MetaConstraint<?>> constraints
-
cascadingMetaDataBuilder
protected final CascadingMetaDataBuilder cascadingMetaDataBuilder
-
typeArgumentConstraints
protected final Set<MetaConstraint<?>> typeArgumentConstraints
-
-
Constructor Detail
-
AbstractConstrainedElement
public AbstractConstrainedElement(ConfigurationSource source, ConstrainedElement.ConstrainedElementKind kind, Set<MetaConstraint<?>> constraints, Set<MetaConstraint<?>> typeArgumentConstraints, CascadingMetaDataBuilder cascadingMetaDataBuilder)
-
-
Method Detail
-
getKind
public ConstrainedElement.ConstrainedElementKind getKind()
Description copied from interface:ConstrainedElementReturns the kind of this constrained element.- Specified by:
getKindin interfaceConstrainedElement- Returns:
- The kind of this constrained element.
-
iterator
public Iterator<MetaConstraint<?>> iterator()
- Specified by:
iteratorin interfaceIterable<MetaConstraint<?>>
-
getConstraints
public Set<MetaConstraint<?>> getConstraints()
Description copied from interface:ConstrainedElementReturns a set containing the constraints specified for this constrained element.- Specified by:
getConstraintsin interfaceConstrainedElement- Returns:
- A set with this constrained element's constraints. May be empty,
but never
null.
-
getTypeArgumentConstraints
public Set<MetaConstraint<?>> getTypeArgumentConstraints()
Description copied from interface:ConstrainedElementReturns the type argument constraints of this element, if any.- Specified by:
getTypeArgumentConstraintsin interfaceConstrainedElement
-
getCascadingMetaDataBuilder
public CascadingMetaDataBuilder getCascadingMetaDataBuilder()
Description copied from interface:ConstrainedElementReturns the cascading metadata (e.g.ValidandConvertGroup) for the element and the potential container elements.- Specified by:
getCascadingMetaDataBuilderin interfaceConstrainedElement
-
isConstrained
public boolean isConstrained()
Description copied from interface:ConstrainedElementWhether 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:
isConstrainedin interfaceConstrainedElement- Returns:
True, if this element is constrained,falseotherwise.
-
getSource
public ConfigurationSource getSource()
Description copied from interface:ConstrainedElementReturns the configuration source contributing this constrained element.- Specified by:
getSourcein interfaceConstrainedElement
-
-