KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > xdoclet > modules > wsee > WebServicesXmlSubTask


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

5 package xdoclet.modules.wsee;
6
7 import xdoclet.XDocletException;
8 import xdoclet.XmlSubTask;
9 import xdoclet.util.Translator;
10
11 /**
12  * SubTask that generates the web-services.xml deployment descriptor.
13  *
14  * @author Christoph G. Jung (christoph.jung@infor.de)
15  * @created 23.12.03
16  * @ant.element display-name="webservices.xml" name="deploymentdescriptor"
17  * parent="xdoclet.modules.wsee.WseeDocletTask"
18  * @version $Revision: 1.3 $
19  * @xdoclet.merge-file file="custom-web-services.xml" relates-to="webservices.xml" description="An XML unparsed entity
20  * containing extensions to the defined web services."
21  */

22 public class WebServicesXmlSubTask extends XmlSubTask
23 {
24     /**
25      * some constants
26      */

27     private static String JavaDoc DEFAULT_TEMPLATE_FILE =
28         "resources/web-services_xml.xdt";
29     private static String JavaDoc GENERATED_FILE_NAME = "webservices.xml";
30     private static String JavaDoc XSD_SERVICES_11 =
31         "http://java.sun.com/xml/ns/j2ee/j2ee_web_services_1_1.xsd";
32
33     /**
34      * state
35      */

36     protected String JavaDoc smallIcon = "";
37     protected String JavaDoc largeIcon = "";
38     protected String JavaDoc displayName = "";
39     protected String JavaDoc description = "";
40     protected String JavaDoc name;
41
42     /**
43      * initializes default output location and template names
44      */

45     public WebServicesXmlSubTask()
46     {
47         setTemplateURL(getClass().getResource(DEFAULT_TEMPLATE_FILE));
48         setDestinationFile(GENERATED_FILE_NAME);
49     }
50
51     /**
52      * Gets the Description attribute of the WebXmlSubTask object
53      *
54      * @return The Description value
55      */

56     public String JavaDoc getDescription()
57     {
58         return description;
59     }
60
61     /**
62      * @return the display name of the webservice descriptor
63      */

64     public String JavaDoc getDisplayName()
65     {
66         return displayName;
67     }
68
69     /**
70      * @return large icon location
71      */

72     public String JavaDoc getLargeIcon()
73     {
74         return largeIcon;
75     }
76
77     /**
78      * @return id of the descriptor
79      */

80     public String JavaDoc getName()
81     {
82         return name;
83     }
84
85     /**
86      * @return small icon location
87      */

88     public String JavaDoc getSmallIcon()
89     {
90         return smallIcon;
91     }
92
93     /**
94      * Sets the Description attribute of the WebXmlSubTask object
95      *
96      * @param description The new Description value
97      */

98     public void setDescription(String JavaDoc description)
99     {
100         this.description = description;
101     }
102
103     /**
104      * set display name
105      *
106      * @param string name
107      */

108     public void setDisplayName(String JavaDoc string)
109     {
110         displayName = string;
111     }
112
113     /**
114      * set large icon location
115      *
116      * @param string location
117      */

118     public void setLargeIcon(String JavaDoc string)
119     {
120         largeIcon = string;
121     }
122
123     /**
124      * set descriptor name
125      *
126      * @param string name
127      */

128     public void setName(String JavaDoc string)
129     {
130         name = string;
131     }
132
133     /**
134      * set small icon location
135      *
136      * @param string location
137      */

138     public void setSmallIcon(String JavaDoc string)
139     {
140         smallIcon = string;
141     }
142
143     /**
144      * runs the subtask
145      *
146      * @exception XDocletException
147      */

148     public void execute() throws XDocletException
149     {
150         setSchema(XSD_SERVICES_11);
151         startProcess();
152     }
153
154     /**
155      * feedback upon engine start
156      *
157      * @exception XDocletException
158      */

159     protected void engineStarted() throws XDocletException
160     {
161         System.out.println(
162             Translator.getString(
163             XDocletModulesMessages.class,
164             XDocletModulesMessages.GENERATING_WEB_SERVICE_DESCRIPTOR,
165             new String JavaDoc[]{getDestinationFile()}));
166     }
167
168 }
169
Popular Tags