public interface BeanDescriptor extends ElementDescriptor
ConstraintDescriptor
s) are immutable.ElementDescriptor.ConstraintFinder
Modifier and Type | Method and Description |
---|---|
java.util.Set<ConstructorDescriptor> |
getConstrainedConstructors()
Returns a set with descriptors for the constrained constructors of the
bean represented by this descriptor.
|
java.util.Set<MethodDescriptor> |
getConstrainedMethods(MethodType methodType,
MethodType... methodTypes)
Returns a set with descriptors for the constrained methods of the bean
represented by this descriptor.
|
java.util.Set<PropertyDescriptor> |
getConstrainedProperties()
Returns a set of property descriptors having at least one constraint defined
or marked as cascaded (
Valid ). |
ConstructorDescriptor |
getConstraintsForConstructor(java.lang.Class<?>... parameterTypes)
Returns a constructor descriptor for the given constructor.
|
MethodDescriptor |
getConstraintsForMethod(java.lang.String methodName,
java.lang.Class<?>... parameterTypes)
Returns a method descriptor for the given method.
|
PropertyDescriptor |
getConstraintsForProperty(java.lang.String propertyName)
Returns the property descriptor for a given property.
|
boolean |
isBeanConstrained()
Returns
true if the bean involves validation:
a constraint is hosted on the bean itself
a constraint is hosted on one of the bean properties
or a bean property is marked for cascaded validation (Valid )
Constrained methods and constructors are ignored. |
findConstraints, getConstraintDescriptors, getElementClass, hasConstraints
boolean isBeanConstrained()
true
if the bean involves validation:
Valid
)true
if the bean involves validation, false
otherwisePropertyDescriptor getConstraintsForProperty(java.lang.String propertyName)
null
if the property does not exist or has no
constraint nor is marked as cascaded (see getConstrainedProperties()
)
Properties of super types are considered.propertyName
- property evaluatedjava.lang.IllegalArgumentException
- if propertyName
is null
java.util.Set<PropertyDescriptor> getConstrainedProperties()
Valid
).
If not property matches, an empty set is returned.
Properties of super types are considered.PropertyDescriptor
s for the constraint properties; if
there are no constraint properties, the empty set is returnedMethodDescriptor getConstraintsForMethod(java.lang.String methodName, java.lang.Class<?>... parameterTypes)
null
if no method with the given name and parameter types
exists or the specified method neither has parameter or return value constraints nor a parameter
or return value marked for cascaded validation.
Methods of super types are considered.methodName
- the name of the methodparameterTypes
- the parameter types of the methodjava.lang.IllegalArgumentException
- if methodName
is null
java.util.Set<MethodDescriptor> getConstrainedMethods(MethodType methodType, MethodType... methodTypes)
methodType
- method type to considermethodTypes
- remaining optional method types to considernull
ConstructorDescriptor getConstraintsForConstructor(java.lang.Class<?>... parameterTypes)
null
if no constructor with the given parameter types
exists or the specified constructor neither has parameter or return value
constraints nor a parameter or return value marked for cascaded
validation.
Constructor of super types are considered.parameterTypes
- the parameter types of the constructorjava.util.Set<ConstructorDescriptor> getConstrainedConstructors()
null