public class BeanDescriptorImpl<T> extends ElementDescriptorImpl implements BeanDescriptor, TypeDescriptor
ElementDescriptor.ConstraintFinder| Constructor and Description |
|---|
BeanDescriptorImpl(BeanMetaData<T> beanMetaData) |
| Modifier and Type | Method and Description |
|---|---|
BeanDescriptor |
getBeanDescriptor()
Returns a descriptor for the bean related constraints of this type.
|
Set<MethodDescriptor> |
getConstrainedMethods()
Returns a set with the constrained methods of this type.
|
Set<PropertyDescriptor> |
getConstrainedProperties()
Returns a set of property descriptors having at least one constraint defined
or marked as cascaded (
@Valid |
MethodDescriptor |
getConstraintsForMethod(String methodName,
Class<?>... parameterTypes)
Returns a descriptor for the specified method.
|
PropertyDescriptor |
getConstraintsForProperty(String propertyName)
Return 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 cascade (@Valid)
|
boolean |
isTypeConstrained()
Whether this type has any class-, property- (field or getter style) or
method-level constraints or not.
|
addConstraintDescriptor, findConstraints, getConstraintDescriptors, getElementClass, getMetaDataBean, hasConstraintsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfindConstraints, getConstraintDescriptors, getElementClass, hasConstraintspublic BeanDescriptorImpl(BeanMetaData<T> beanMetaData)
public final boolean isBeanConstrained()
BeanDescriptortrue if the bean involves validation:
@Valid)isBeanConstrained in interface BeanDescriptortrue if the bean involves validation, false otherwise.public final PropertyDescriptor getConstraintsForProperty(String propertyName)
BeanDescriptornull if the property does not exist or has no
constraint nor is marked as cascaded (see BeanDescriptor.getConstrainedProperties() )
The returned object (and associated objects including ConstraintDescriptors)
are immutable.getConstraintsForProperty in interface BeanDescriptorpropertyName - property evaluatedpublic final Set<PropertyDescriptor> getConstrainedProperties()
BeanDescriptor@Valid). If not property matches,
an empty set is returned. getConstrainedProperties in interface BeanDescriptorpublic boolean isTypeConstrained()
TypeDescriptorValid
annotation,Valid annotation,Valid annotationisTypeConstrained in interface TypeDescriptorTrue, if this type has any constraints,
falsepublic Set<MethodDescriptor> getConstrainedMethods()
TypeDescriptorgetConstrainedMethods in interface TypeDescriptorpublic MethodDescriptor getConstraintsForMethod(String methodName, Class<?>... parameterTypes)
TypeDescriptorgetConstraintsForMethod in interface TypeDescriptormethodName - The name of the method to retrieve a descriptor for.parameterTypes - The types of the parameters of the method to retrieve a
descriptor for, in the order as they are defined in the method
signature.null, if no method
with the given name and parameter types is declared on the type represented
by this descriptor or its super types.public BeanDescriptor getBeanDescriptor()
TypeDescriptorgetBeanDescriptor in interface TypeDescriptorCopyright © 2012 JBoss by Red Hat. All Rights Reserved.