public abstract class MetaDataBuilder
extends java.lang.Object
ConstraintMetaData
instances for the
ConstrainedElement
objects representing one method or property in a
type's inheritance hierarchy.Modifier and Type | Field and Description |
---|---|
protected ConstraintHelper |
constraintHelper |
protected TypeResolutionHelper |
typeResolutionHelper |
protected ValueExtractorManager |
valueExtractorManager |
Modifier | Constructor and Description |
---|---|
protected |
MetaDataBuilder(java.lang.Class<?> beanClass,
ConstraintHelper constraintHelper,
TypeResolutionHelper typeResolutionHelper,
ValueExtractorManager valueExtractorManager) |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
accepts(ConstrainedElement constrainedElement)
Whether this builder allows to add the given element or not.
|
protected java.util.Set<MetaConstraint<?>> |
adaptConstraints(ConstrainedElement constrainedElement,
java.util.Set<MetaConstraint<?>> constraints)
Allows specific sub-classes to customize the retrieved constraints.
|
protected java.util.Set<MetaConstraint<?>> |
adaptOriginsAndImplicitGroups(java.util.Set<MetaConstraint<?>> constraints)
Adapts the given constraints to the given bean type.
|
void |
add(ConstrainedElement constrainedElement)
Adds the given element to this builder.
|
abstract ConstraintMetaData |
build()
Creates a new, read-only
ConstraintMetaData object with all
constraint information related to the method or property represented by
this builder. |
protected java.lang.Class<?> |
getBeanClass() |
java.util.Set<MetaConstraint<?>> |
getContainerElementConstraints() |
protected java.util.Set<MetaConstraint<?>> |
getDirectConstraints() |
protected boolean |
isCascading() |
protected final ConstraintHelper constraintHelper
protected final TypeResolutionHelper typeResolutionHelper
protected final ValueExtractorManager valueExtractorManager
protected MetaDataBuilder(java.lang.Class<?> beanClass, ConstraintHelper constraintHelper, TypeResolutionHelper typeResolutionHelper, ValueExtractorManager valueExtractorManager)
public abstract boolean accepts(ConstrainedElement constrainedElement)
constrainedElement
- The element to check.true
if the given element can be added to this
builder, false
otherwise.public void add(ConstrainedElement constrainedElement)
accepts(ConstrainedElement)
before, whether this is allowed or
not.constrainedElement
- The element to add.public abstract ConstraintMetaData build()
ConstraintMetaData
object with all
constraint information related to the method or property represented by
this builder.ConstraintMetaData
object.protected java.util.Set<MetaConstraint<?>> getDirectConstraints()
public java.util.Set<MetaConstraint<?>> getContainerElementConstraints()
protected boolean isCascading()
protected java.lang.Class<?> getBeanClass()
protected java.util.Set<MetaConstraint<?>> adaptOriginsAndImplicitGroups(java.util.Set<MetaConstraint<?>> constraints)
ConstraintOrigin.DEFINED_IN_HIERARCHY
. If a
constraint is defined on an interface, the interface type will
additionally be part of the constraint's groups (implicit grouping).constraints
- The constraints that shall be adapted. The constraints themselves
will not be altered.protected java.util.Set<MetaConstraint<?>> adaptConstraints(ConstrainedElement constrainedElement, java.util.Set<MetaConstraint<?>> constraints)
Copyright © 2007-2022 Red Hat, Inc. All Rights Reserved