Class PropertyMetaData
java.lang.Object
org.hibernate.validator.internal.metadata.aggregated.AbstractConstraintMetaData
org.hibernate.validator.internal.metadata.aggregated.PropertyMetaData
- All Implemented Interfaces:
Iterable<MetaConstraint<?>>
,ConstraintMetaData
Represents the constraint related meta data for a JavaBeans property.
Abstracts from the concrete physical type of the underlying Java element(s)
(fields or getter methods).
In order to provide a unified access to all JavaBeans constraints also class-level constraints are represented by this meta data type.
Identity is solely based on the property name, hence sets and similar collections of this type may only be created in the scope of one Java type.
- Author:
- Gunnar Morling, Guillaume Smet
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionasDescriptor
(boolean defaultGroupSequenceRedefined, List<Class<?>> defaultGroupSequence) Returns this meta data object's corresponding representation in the descriptor model.boolean
Returns the cascadables of this property, if any.getKind()
Returns thekind
of this meta data object.int
hashCode()
toString()
Methods inherited from class org.hibernate.validator.internal.metadata.aggregated.AbstractConstraintMetaData
asContainerElementTypeDescriptors, asDescriptors, getAllConstraints, getContainerElementsConstraints, getDirectConstraints, getName, getType, isCascading, isConstrained, iterator
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
asDescriptor
public PropertyDescriptorImpl asDescriptor(boolean defaultGroupSequenceRedefined, List<Class<?>> defaultGroupSequence) Description copied from interface:ConstraintMetaData
Returns this meta data object's corresponding representation in the descriptor model.- Parameters:
defaultGroupSequenceRedefined
- Whether the bean hosting the represented element has a redefined default group sequence or not.defaultGroupSequence
- The default group sequence of the bean hosting the represented element.- Returns:
- This meta data object's corresponding descriptor model
representation. Implementations should return a specific sub type
of
ElementDescriptor
.
-
getCascadables
Returns the cascadables of this property, if any. Often, there will be just a single element returned. Several elements may be returned in the following cases:- a property's field has been marked with
@Valid
but type-level constraints have been given on the getter - one type parameter of a property has been marked with
@Valid
on the field (e.g. a map's key) but another type parameter has been marked with@Valid
on the property (e.g. the map's value) - a (shaded) private field in a super-type and another field of the same name in a sub-type are both marked
with
@Valid
- a property's field has been marked with
-
toString
- Overrides:
toString
in classAbstractConstraintMetaData
-
getKind
Description copied from interface:ConstraintMetaData
Returns thekind
of this meta data object.- Returns:
- The
kind
of this meta data object.
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAbstractConstraintMetaData
-
equals
- Overrides:
equals
in classAbstractConstraintMetaData
-