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 CascadingMetaDataBuilder
protected final Set<MetaConstraint<?>>
protected final ConfigurationSource
protected final Set<MetaConstraint<?>>
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractConstrainedElement
(ConfigurationSource source, ConstrainedElement.ConstrainedElementKind kind, Set<MetaConstraint<?>> constraints, Set<MetaConstraint<?>> typeArgumentConstraints, CascadingMetaDataBuilder cascadingMetaDataBuilder) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns 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.int
hashCode()
boolean
Whether this element is constrained or not.iterator()
toString()
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 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:ConstrainedElement
Returns the kind of this constrained element.- Specified by:
getKind
in interfaceConstrainedElement
- Returns:
- The kind of this constrained element.
-
iterator
- Specified by:
iterator
in interfaceIterable<MetaConstraint<?>>
-
getConstraints
Description copied from interface:ConstrainedElement
Returns a set containing the constraints specified for this constrained element.- Specified by:
getConstraints
in interfaceConstrainedElement
- Returns:
- A set with this constrained element's constraints. May be empty,
but never
null
.
-
getTypeArgumentConstraints
Description copied from interface:ConstrainedElement
Returns the type argument constraints of this element, if any.- Specified by:
getTypeArgumentConstraints
in interfaceConstrainedElement
-
getCascadingMetaDataBuilder
Description copied from interface:ConstrainedElement
Returns the cascading metadata (e.g.Valid
andConvertGroup
) for the element and the potential container elements.- Specified by:
getCascadingMetaDataBuilder
in interfaceConstrainedElement
-
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 interfaceConstrainedElement
- Returns:
True
, if this element is constrained,false
otherwise.
-
getSource
Description copied from interface:ConstrainedElement
Returns the configuration source contributing this constrained element.- Specified by:
getSource
in interfaceConstrainedElement
-
toString
-
hashCode
public int hashCode() -
equals
-