01: /*
02: * Copyright (c) 2002-2006 by OpenSymphony
03: * All rights reserved.
04: */
05:
06: package com.opensymphony.xwork.validator;
07:
08: import java.util.List;
09:
10: /**
11: * <code>ActionValidatorManager</code>
12: *
13: * @author Rainer Hermanns
14: * @version $Id: ActionValidatorManager.java 1281 2006-12-25 04:23:44Z tm_jee $
15: */
16: public interface ActionValidatorManager {
17:
18: /**
19: * Returns a list of validators for the given class and context. This is the primary
20: * lookup method for validators.
21: *
22: * @param clazz the class to lookup.
23: * @param context the context of the action class - can be <tt>null</tt>.
24: * @return a list of all validators for the given class and context.
25: */
26: List getValidators(Class clazz, String context);
27:
28: /**
29: * Validates the given object using action and its context.
30: *
31: * @param object the action to validate.
32: * @param context the action's context.
33: * @throws ValidationException if an error happens when validating the action.
34: */
35: void validate(Object object, String context)
36: throws ValidationException;
37:
38: /**
39: * Validates an action give its context and a validation context.
40: *
41: * @param object the action to validate.
42: * @param context the action's context.
43: * @param validatorContext
44: * @throws ValidationException if an error happens when validating the action.
45: */
46: void validate(Object object, String context,
47: ValidatorContext validatorContext)
48: throws ValidationException;
49:
50: /**
51: * Validates an action through a series of <code>validators</code> with
52: * the given <code>validatorContext</code>.
53: *
54: * @param object
55: * @param validators
56: * @param validatorContext
57: * @throws ValidationException
58: */
59: void validate(Object object, List validators,
60: ValidatorContext validatorContext)
61: throws ValidationException;
62: }
|