org.hibernate.validator.metadata
Class BeanDescriptorImpl<T>
java.lang.Object
org.hibernate.validator.metadata.ElementDescriptorImpl
org.hibernate.validator.metadata.BeanDescriptorImpl<T>
- All Implemented Interfaces:
- BeanDescriptor, ElementDescriptor, TypeDescriptor
public class BeanDescriptorImpl<T>
- extends ElementDescriptorImpl
- implements BeanDescriptor, TypeDescriptor
- Author:
- Emmanuel Bernard, Hardy Ferentschik, Gunnar Morling
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BeanDescriptorImpl
public BeanDescriptorImpl(BeanMetaData<T> beanMetaData)
isBeanConstrained
public final boolean isBeanConstrained()
- Specified by:
isBeanConstrained
in interface BeanDescriptor
getConstraintsForProperty
public final PropertyDescriptor getConstraintsForProperty(String propertyName)
- Specified by:
getConstraintsForProperty
in interface BeanDescriptor
getConstrainedProperties
public final Set<PropertyDescriptor> getConstrainedProperties()
- Specified by:
getConstrainedProperties
in interface 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 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(String methodName,
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 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 © 2007-2011 Red Hat Middleware, LLC. All Rights Reserved