org.apache.bval.jsr303
Class BeanDescriptorImpl

java.lang.Object
  extended by org.apache.bval.jsr303.ElementDescriptorImpl
      extended by org.apache.bval.jsr303.BeanDescriptorImpl
All Implemented Interfaces:
BeanDescriptor, ElementDescriptor
Direct Known Subclasses:
MethodBeanDescriptorImpl

public class BeanDescriptorImpl
extends ElementDescriptorImpl
implements BeanDescriptor

Description: Implements BeanDescriptor.


Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.validation.metadata.ElementDescriptor
ElementDescriptor.ConstraintFinder
 
Field Summary
protected  ApacheFactoryContext factoryContext
          The ApacheFactoryContext (not) used by this BeanDescriptorImpl
 
Fields inherited from class org.apache.bval.jsr303.ElementDescriptorImpl
elementClass, metaBean
 
Constructor Summary
protected BeanDescriptorImpl(ApacheFactoryContext factoryContext, MetaBean metaBean)
          Create a new BeanDescriptorImpl instance.
 
Method Summary
 Set<PropertyDescriptor> getConstrainedProperties()
          
 PropertyDescriptor getConstraintsForProperty(String propertyName)
          Return the property level constraints for a given propertyName or null if either the property does not exist or has no constraint.
 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)
 String toString()
          
 
Methods inherited from class org.apache.bval.jsr303.ElementDescriptorImpl
findConstraints, getConstraintDescriptors, getConstraintDescriptors, getElementClass, getMetaBean, getMutableConstraintDescriptors, hasConstraints, setConstraintDescriptors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.validation.metadata.ElementDescriptor
findConstraints, getConstraintDescriptors, getElementClass, hasConstraints
 

Field Detail

factoryContext

protected final ApacheFactoryContext factoryContext
The ApacheFactoryContext (not) used by this BeanDescriptorImpl

Constructor Detail

BeanDescriptorImpl

protected BeanDescriptorImpl(ApacheFactoryContext factoryContext,
                             MetaBean metaBean)
Create a new BeanDescriptorImpl instance.

Parameters:
factoryContext -
metaBean -
Method Detail

isBeanConstrained

public boolean isBeanConstrained()
Returns true if the bean involves validation:

Specified by:
isBeanConstrained in interface BeanDescriptor
Returns:
true if the bean involves validation

getConstraintsForProperty

public PropertyDescriptor getConstraintsForProperty(String propertyName)
Return the property level constraints for a given propertyName or null if either the property does not exist or has no constraint. The returned object (and associated objects including ConstraintDescriptors) are immutable.

Specified by:
getConstraintsForProperty in interface BeanDescriptor
Parameters:
propertyName - property evaluated

getConstrainedProperties

public Set<PropertyDescriptor> getConstrainedProperties()

Specified by:
getConstrainedProperties in interface BeanDescriptor
Returns:
the property descriptors having at least a constraint defined

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2010-2012 Apache Software Foundation. All Rights Reserved.