javax.validation.metadata
Interface BeanDescriptor

All Superinterfaces:
ElementDescriptor

public interface BeanDescriptor
extends ElementDescriptor

Describes a constrained Java Bean and the constraints associated to it.

Author:
Emmanuel Bernard

Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.validation.metadata.ElementDescriptor
ElementDescriptor.ConstraintFinder
 
Method Summary
 java.util.Set<PropertyDescriptor> getConstrainedProperties()
          Returns a set of property descriptors having at least one constraint defined or marked as cascaded (@Valid).
 PropertyDescriptor getConstraintsForProperty(java.lang.String propertyName)
          Return the property descriptor for a given property.
 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)
 
Methods inherited from interface javax.validation.metadata.ElementDescriptor
findConstraints, getConstraintDescriptors, getElementClass, hasConstraints
 

Method Detail

isBeanConstrained

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

Returns:
true if the bean involves validation, false otherwise.

getConstraintsForProperty

PropertyDescriptor getConstraintsForProperty(java.lang.String propertyName)
Return the property descriptor for a given property. Return null if the property does not exist or has no constraint nor is marked as cascaded (see getConstrainedProperties() )

The returned object (and associated objects including ConstraintDescriptors) are immutable.

Parameters:
propertyName - property evaluated
Returns:
the property descriptor for a given property.
Throws:
IllegalArgumentException - if propertyName is null

getConstrainedProperties

java.util.Set<PropertyDescriptor> getConstrainedProperties()
Returns a set of property descriptors having at least one constraint defined or marked as cascaded (@Valid). If not property matches, an empty set is returned.



Submit a bug or feature

Copyright © 2009-2011, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.

Generated on 10-February-2011 12:41