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

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

Describes a validated bean.

Author:
Emmanuel Bernard, Hardy Ferentschik, Gunnar Morling

Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.validation.metadata.ElementDescriptor
javax.validation.metadata.ElementDescriptor.ConstraintFinder
 
Constructor Summary
BeanDescriptorImpl(Class<T> beanClass, Set<ConstraintDescriptorImpl<?>> classLevelConstraints, Map<String,javax.validation.metadata.PropertyDescriptor> properties, Map<String,MethodDescriptor> methods, boolean defaultGroupSequenceRedefined, List<Class<?>> defaultGroupSequence)
           
 
Method Summary
 javax.validation.metadata.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<javax.validation.metadata.PropertyDescriptor> getConstrainedProperties()
           
 MethodDescriptor getConstraintsForMethod(String methodName, Class<?>... parameterTypes)
          Returns a descriptor for the specified method.
 javax.validation.metadata.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.internal.metadata.descriptor.ElementDescriptorImpl
asDescriptors, findConstraints, getConstraintDescriptors, getElementClass, hasConstraints, isCascaded
 
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(Class<T> beanClass,
                          Set<ConstraintDescriptorImpl<?>> classLevelConstraints,
                          Map<String,javax.validation.metadata.PropertyDescriptor> properties,
                          Map<String,MethodDescriptor> methods,
                          boolean defaultGroupSequenceRedefined,
                          List<Class<?>> defaultGroupSequence)
Method Detail

isBeanConstrained

public final boolean isBeanConstrained()
Specified by:
isBeanConstrained in interface javax.validation.metadata.BeanDescriptor

getConstraintsForProperty

public final javax.validation.metadata.PropertyDescriptor getConstraintsForProperty(String propertyName)
Specified by:
getConstraintsForProperty in interface javax.validation.metadata.BeanDescriptor

getConstrainedProperties

public final 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

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 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 © 2012 Oracle Corporation. All Rights Reserved.