1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.acegisecurity.domain.validation;
17
18 import org.springframework.validation.BindException;
19
20
21 /***
22 * Indicates a domain object wishes to perform additional binding before the
23 * <code>Validator</code> is called.
24 *
25 * <p>
26 * Typically this type of binding sets up private or protected properties that
27 * the end user is not responsible for modifying. Whilst generally this can be
28 * done by adding a hook to every property setter, the
29 * <code>BindBeforeValidation</code> interface provides an AOP-style approach
30 * that ensures missing hooks do not cause invalid object state.
31 * </p>
32 *
33 * @author Ben Alex
34 * @version $Id: BindBeforeValidation.java,v 1.2 2005/11/17 00:55:50 benalex Exp $
35 */
36 public interface BindBeforeValidation {
37
38
39 /***
40 * This method will be called by infrastructure code before attempting to
41 * validate the object. Given this method is called prior to validation,
42 * implementations of this method should <b>not</b> assume the object is
43 * in a valid state.
44 *
45 * <p>
46 * Implementations should modify the object as required so that the
47 * <code>Validator</code> will succeed if user-controllable properties are
48 * correct.
49 * </p>
50 *
51 * @throws BindException if there are problems that the method wish to
52 * advise (note that the <code>Validator</code> should be allowed
53 * to determine errors in most cases, rather than this method
54 * doing so)
55 */
56 public void bindSupport() throws BindException;
57 }