KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > xdoclet > modules > spring > SpringValidationXmlSubTask


1 /*
2  * Copyright (c) 2001, 2002 The XDoclet team
3  * All rights reserved.
4  */

5 package xdoclet.modules.spring;
6
7 import xdoclet.XDocletException;
8 import xdoclet.XmlSubTask;
9
10 /**
11  * Generates Struts Validator validation.xml deployment descriptor.
12  *
13  * @author Erik Hatcher (ehatcher@apache.org)
14  * @created August 23, 2002
15  * @ant.element display-name="validation.xml" name="springvalidationxml"
16  * parent="xdoclet.modules.web.WebDocletTask"
17  * @version $Revision: 1.1 $
18  * @xdoclet.merge-file file="validation-global.xml" relates-to="validation.xml" description="An XML unparsed entity
19  * containing the global elements for the validation descriptor."
20  */

21 public class SpringValidationXmlSubTask extends XmlSubTask
22 {
23     private final static String JavaDoc DTD_FILE_NAME_11 = "resources/validation_1_1.dtd";
24     private final static String JavaDoc VALIDATION_PUBLICID_11 = "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1//EN";
25     private final static String JavaDoc VALIDATION_SYSTEMID_11 = "http://jakarta.apache.org/commons/dtds/validator_1_1.dtd";
26
27     private static String JavaDoc DEFAULT_TEMPLATE_FILE = "resources/validation_xml.xdt";
28     private static String JavaDoc GENERATED_FILE_NAME = "validation.xml";
29
30     /**
31      * Describe what the StrutsValidationXmlSubTask constructor does
32      */

33     public SpringValidationXmlSubTask()
34     {
35         setTemplateURL(getClass().getResource(DEFAULT_TEMPLATE_FILE));
36         setDestinationFile(GENERATED_FILE_NAME);
37         setPublicId(VALIDATION_PUBLICID_11);
38         setSystemId(VALIDATION_SYSTEMID_11);
39         setDtdURL(getClass().getResource(DTD_FILE_NAME_11));
40     }
41
42     /**
43      * Describe what the method does
44      *
45      * @exception XDocletException
46      * @todo is this method even needed here?
47      */

48     public void execute() throws XDocletException
49     {
50         startProcess();
51     }
52 }
53
Popular Tags