org.hibernate.validator.metadata
Class BeanDescriptorImpl<T>
java.lang.Object
org.hibernate.validator.metadata.ElementDescriptorImpl
org.hibernate.validator.metadata.BeanDescriptorImpl<T>
- All Implemented Interfaces:
- javax.validation.metadata.BeanDescriptor, javax.validation.metadata.ElementDescriptor, TypeDescriptor
public class BeanDescriptorImpl<T>
- extends ElementDescriptorImpl
- implements javax.validation.metadata.BeanDescriptor, TypeDescriptor
- Author:
- Emmanuel Bernard, Hardy Ferentschik, Gunnar Morling
| Nested classes/interfaces inherited from interface javax.validation.metadata.ElementDescriptor |
javax.validation.metadata.ElementDescriptor.ConstraintFinder |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.validation.metadata.ElementDescriptor |
findConstraints, getConstraintDescriptors, getElementClass, hasConstraints |
BeanDescriptorImpl
public BeanDescriptorImpl(BeanMetaData<T> beanMetaData)
isBeanConstrained
public final boolean isBeanConstrained()
- Specified by:
isBeanConstrained in interface javax.validation.metadata.BeanDescriptor
getConstraintsForProperty
public final javax.validation.metadata.PropertyDescriptor getConstraintsForProperty(java.lang.String propertyName)
- Specified by:
getConstraintsForProperty in interface javax.validation.metadata.BeanDescriptor
getConstrainedProperties
public final java.util.Set<javax.validation.metadata.PropertyDescriptor> getConstrainedProperties()
- Specified by:
getConstrainedProperties in interface javax.validation.metadata.BeanDescriptor
isTypeConstrained
public boolean isTypeConstrained()
- Description copied from interface:
TypeDescriptor
- Whether this type has any class-, property- (field or getter style) or
method-level constraints or not. This is the case if
- a constraint is hosted at this type itself,
- a constraint is hosted on any of this type's bean properties
(represented by fields or getter methods),
- any of this type's bean properties (represented by fields or getter
methods) is marked for cascaded validation with the
Valid
annotation,
- a constraint is hosted on any of this type's method's parameters,
- any of this type's method's parameters is marked for cascaded
validation with the
Valid annotation,
- a constraint is hosted on the return value of any of this type's
methods or
- the return value of any of this type's methods is marked for cascaded
validation with the
Valid annotation
- Specified by:
isTypeConstrained in interface TypeDescriptor
- Returns:
True, if this type has any constraints,
false
getConstrainedMethods
public java.util.Set<MethodDescriptor> getConstrainedMethods()
- Description copied from interface:
TypeDescriptor
- Returns a set with the constrained methods of this type.
- Specified by:
getConstrainedMethods in interface TypeDescriptor
- Returns:
- A set with the constrained methods of this type, will be empty if
none of this type's methods are constrained.
getConstraintsForMethod
public MethodDescriptor getConstraintsForMethod(java.lang.String methodName,
java.lang.Class<?>... parameterTypes)
- Description copied from interface:
TypeDescriptor
- Returns a descriptor for the specified method.
- Specified by:
getConstraintsForMethod in interface TypeDescriptor
- Parameters:
methodName - 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.
- Returns:
- A descriptor for the specified method or
null, if no method
with the given name and parameter types is declared on the type represented
by this descriptor or its super types.
getBeanDescriptor
public javax.validation.metadata.BeanDescriptor getBeanDescriptor()
- Description copied from interface:
TypeDescriptor
- Returns a descriptor for the bean related constraints of this type.
- Specified by:
getBeanDescriptor in interface TypeDescriptor
- Returns:
- A bean descriptor. Will never be null, also if this type has no bean properties.
Copyright © 2011 Oracle Corporation. All Rights Reserved.