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
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
FieldsModifier and TypeFieldDescriptionprotected final CascadingMetaDataBuilderprotected final Set<MetaConstraint<?>>protected final ConfigurationSourceprotected final Set<MetaConstraint<?>> -
Constructor Summary
ConstructorsConstructorDescriptionAbstractConstrainedElement(ConfigurationSource source, ConstrainedElement.ConstrainedElementKind kind, Set<MetaConstraint<?>> constraints, Set<MetaConstraint<?>> typeArgumentConstraints, CascadingMetaDataBuilder cascadingMetaDataBuilder) -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the cascading metadata (e.g.Set<MetaConstraint<?>>Returns a set containing the constraints specified for this constrained element.getKind()Returns the kind of this constrained element.Returns the configuration source contributing this constrained element.Set<MetaConstraint<?>>Returns the type argument constraints of this element, if any.inthashCode()booleanWhether this element is constrained or not.iterator()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
source
-
constraints
-
cascadingMetaDataBuilder
-
typeArgumentConstraints
-
-
Constructor Details
-
AbstractConstrainedElement
public AbstractConstrainedElement(ConfigurationSource source, ConstrainedElement.ConstrainedElementKind kind, Set<MetaConstraint<?>> constraints, Set<MetaConstraint<?>> typeArgumentConstraints, CascadingMetaDataBuilder cascadingMetaDataBuilder)
-
-
Method Details
-
getKind
Description copied from interface:ConstrainedElementReturns the kind of this constrained element.- Specified by:
getKindin interfaceConstrainedElement- Returns:
- The kind of this constrained element.
-
iterator
- Specified by:
iteratorin interfaceIterable<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
Description copied from interface:ConstrainedElementReturns the type argument constraints of this element, if any.- Specified by:
getTypeArgumentConstraintsin interfaceConstrainedElement
-
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
Description copied from interface:ConstrainedElementReturns the configuration source contributing this constrained element.- Specified by:
getSourcein interfaceConstrainedElement
-
toString
-
hashCode
public int hashCode() -
equals
-