1 package com.opensymphony.xwork2.validator;
2
3 import java.io.InputStream;
4 import java.util.List;
5 import java.util.Map;
6
7 /**
8 * This class serves 2 purpose :
9 * <ul>
10 * <li>
11 * Parse the validation config file. (eg. MyAction-validation.xml, MyAction-actionAlias-validation.xml)
12 * to return a List of ValidatorConfig encapsulating the validator information.
13 * </li>
14 * <li>
15 * Parse the validator definition file, (eg. validators.xml) that defines the {@link Validator}s
16 * registered with XWork.
17 * </li>
18 * </ul>
19 *
20 * @author Jason Carreira
21 * @author James House
22 * @author tm_jee ( tm_jee (at) yahoo.co.uk )
23 * @author Rob Harrop
24 * @author Rene Gielen
25 *
26 * @see com.opensymphony.xwork2.validator.ValidatorConfig
27 */
28 public interface ValidatorFileParser {
29 /**
30 * Parse resource for a list of ValidatorConfig objects (configuring which validator(s) are
31 * being applied to a particular field etc.)
32 *
33 * @param is input stream to the resource
34 * @param resourceName file name of the resource
35 * @return List list of ValidatorConfig
36 */
37 List<ValidatorConfig> parseActionValidatorConfigs(ValidatorFactory validatorFactory, InputStream is, String resourceName);
38
39 /**
40 * Parses validator definitions (register various validators with XWork).
41 *
42 * @param is The input stream
43 * @param resourceName The location of the input stream
44 */
45 void parseValidatorDefinitions(Map<String,String> validators, InputStream is, String resourceName);
46 }