Class PropertyMetaData.Builder
java.lang.Object
org.hibernate.validator.internal.metadata.aggregated.MetaDataBuilder
org.hibernate.validator.internal.metadata.aggregated.PropertyMetaData.Builder
- Enclosing class:
- PropertyMetaData
-
Field Summary
Fields inherited from class org.hibernate.validator.internal.metadata.aggregated.MetaDataBuilder
constraintCreationContext
-
Constructor Summary
ConstructorDescriptionBuilder
(Class<?> beanClass, ConstrainedExecutable constrainedMethod, ConstraintCreationContext constraintCreationContext) Builder
(Class<?> beanClass, ConstrainedField constrainedProperty, ConstraintCreationContext constraintCreationContext) -
Method Summary
Modifier and TypeMethodDescriptionboolean
accepts
(ConstrainedElement constrainedElement) Whether this builder allows to add the given element or not.protected Set<MetaConstraint<?>>
adaptConstraints
(ConstrainedElement constrainedElement, Set<MetaConstraint<?>> constraints) Allows specific sub-classes to customize the retrieved constraints.final void
add
(ConstrainedElement constrainedElement) Adds the given element to this builder.build()
Creates a new, read-onlyConstraintMetaData
object with all constraint information related to the method or property represented by this builder.Methods inherited from class org.hibernate.validator.internal.metadata.aggregated.MetaDataBuilder
adaptOriginsAndImplicitGroups, getBeanClass, getContainerElementConstraints, getDirectConstraints, isCascading
-
Constructor Details
-
Builder
public Builder(Class<?> beanClass, ConstrainedField constrainedProperty, ConstraintCreationContext constraintCreationContext) -
Builder
public Builder(Class<?> beanClass, ConstrainedExecutable constrainedMethod, ConstraintCreationContext constraintCreationContext)
-
-
Method Details
-
accepts
Description copied from class:MetaDataBuilder
Whether this builder allows to add the given element or not. This is the case if the specified element relates to the same property or method with which this builder was instantiated.- Specified by:
accepts
in classMetaDataBuilder
- Parameters:
constrainedElement
- The element to check.- Returns:
true
if the given element can be added to this builder,false
otherwise.
-
add
Description copied from class:MetaDataBuilder
Adds the given element to this builder. It must be checked withMetaDataBuilder.accepts(ConstrainedElement)
before, whether this is allowed or not.- Overrides:
add
in classMetaDataBuilder
- Parameters:
constrainedElement
- The element to add.
-
adaptConstraints
protected Set<MetaConstraint<?>> adaptConstraints(ConstrainedElement constrainedElement, Set<MetaConstraint<?>> constraints) Description copied from class:MetaDataBuilder
Allows specific sub-classes to customize the retrieved constraints.- Overrides:
adaptConstraints
in classMetaDataBuilder
-
build
Description copied from class:MetaDataBuilder
Creates a new, read-onlyConstraintMetaData
object with all constraint information related to the method or property represented by this builder.- Specified by:
build
in classMetaDataBuilder
- Returns:
- A
ConstraintMetaData
object.
-