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
ConstructorsConstructorDescriptionBuilder(Class<?> beanClass, ConstrainedExecutable constrainedMethod, ConstraintCreationContext constraintCreationContext) Builder(Class<?> beanClass, ConstrainedField constrainedProperty, ConstraintCreationContext constraintCreationContext) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccepts(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 voidadd(ConstrainedElement constrainedElement) Adds the given element to this builder.build()Creates a new, read-onlyConstraintMetaDataobject 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:MetaDataBuilderWhether 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:
acceptsin classMetaDataBuilder- Parameters:
constrainedElement- The element to check.- Returns:
trueif the given element can be added to this builder,falseotherwise.
-
add
Description copied from class:MetaDataBuilderAdds the given element to this builder. It must be checked withMetaDataBuilder.accepts(ConstrainedElement)before, whether this is allowed or not.- Overrides:
addin classMetaDataBuilder- Parameters:
constrainedElement- The element to add.
-
adaptConstraints
protected Set<MetaConstraint<?>> adaptConstraints(ConstrainedElement constrainedElement, Set<MetaConstraint<?>> constraints) Description copied from class:MetaDataBuilderAllows specific sub-classes to customize the retrieved constraints.- Overrides:
adaptConstraintsin classMetaDataBuilder
-
build
Description copied from class:MetaDataBuilderCreates a new, read-onlyConstraintMetaDataobject with all constraint information related to the method or property represented by this builder.- Specified by:
buildin classMetaDataBuilder- Returns:
- A
ConstraintMetaDataobject.
-