[hibernate-issues] [Hibernate-JIRA] Created: (BVAL-152) TraversableResolver should differentiate reachability and cascadability

Emmanuel Bernard (JIRA) noreply at atlassian.com
Tue May 5 06:18:17 EDT 2009


TraversableResolver should differentiate reachability and cascadability
-----------------------------------------------------------------------

                 Key: BVAL-152
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/BVAL-152
             Project: Bean Validation
          Issue Type: Improvement
          Components: spec-general
    Affects Versions: 1.0 proposed final draft
            Reporter: Emmanuel Bernard
             Fix For: 1.0 final


/**
 * Contract determining if a property can be accessed by the Bean Validation provider
 * This contract is called for each property either validated or traversed.
 *
 * A traversable resolver implementation must be thread-safe.
 *
 * @author Emmanuel Bernard
 */
public interface TraversableResolver {
	/**
	 * Determine if Bean Validation is allowed to reach the property state
	 *
	 * @param traversableObject object hosting <code>traversableProperty</code>, null if validateValue is called
	 * @param traversableProperty name of the traversable property.
	 * @param rootBeanType type of the root object passed to the Validator.
	 * @param pathToTraversableObject path from the root object to
	 *        <code>traversableObject</code> ("" if the <code>traversableObject</code> 
	 *        is the root object)
	 *        (using the path specification defined by Bean Validator).
	 * @param elementType either <code>FIELD</code> or <code>METHOD</code>.
	 *
	 * @return <code>true</code> if Bean Validation is allowed to reach the property state,
	 *         <code>false</code> otherwise.
	 */
	boolean isReachable(Object traversableObject,
						  String traversableProperty,
						  Class<?> rootBeanType,
						  String pathToTraversableObject,
						  ElementType elementType);

	/**
	 * Determine if Bean Validation is allowed to cascade validation on
	 * the bean instance returned by the property value
	 * marked as <code>@Valid</code>.
	 * Note that this method is called only if isReachable returns true for the same set of
	 * arguments and if the property is marked as <code>@Valid</code>
	 *
	 * @param traversableObject object hosting <code>traversableProperty</code>, null if validateValue is called
	 * @param traversableProperty name of the traversable property.
	 * @param rootBeanType type of the root object passed to the Validator.
	 * @param pathToTraversableObject path from the root object to
	 *        <code>traversableObject</code> ("" if the <code>traversableObject</code>
	 *        is the root object)
	 *        (using the path specification defined by Bean Validator).
	 * @param elementType either <code>FIELD</code> or <code>METHOD</code>.
	 *
	 * @return <code>true</code> if Bean Validation is allowed to cascade validation,
	 *         <code>false</code> otherwise.
	 */
	boolean isCascadable(Object traversableObject,
						  String traversableProperty,
						  Class<?> rootBeanType,
						  String pathToTraversableObject,
						  ElementType elementType);
}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list