org.hibernate.validator.metadata
Class BeanDescriptorImpl<T>

java.lang.Object
  extended by org.hibernate.validator.metadata.ElementDescriptorImpl
      extended by 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

Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.validation.metadata.ElementDescriptor
ElementDescriptor.ConstraintFinder
 
Constructor Summary
BeanDescriptorImpl(BeanMetaData<T> beanMetaData)
           
 
Method Summary
 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()
           
 MethodDescriptor getConstraintsForMethod(String methodName, Class<?>... parameterTypes)
          Returns a descriptor for the specified method.
 PropertyDescriptor getConstraintsForProperty(String propertyName)
           
 boolean isBeanConstrained()
           
 boolean isTypeConstrained()
          Whether this type has any class-, property- (field or getter style) or method-level constraints or not.
 
Methods inherited from class org.hibernate.validator.metadata.ElementDescriptorImpl
addConstraintDescriptor, findConstraints, getConstraintDescriptors, getElementClass, getMetaDataBean, hasConstraints
 
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
 

Constructor Detail

BeanDescriptorImpl

public BeanDescriptorImpl(BeanMetaData<T> beanMetaData)
Method Detail

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

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