|
Lines 14-84
Link Here
|
| 14 |
return result; |
14 |
return result; |
| 15 |
} |
15 |
} |
| 16 |
|
16 |
|
| 17 |
public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; //$NON-NLS-1$ |
17 |
public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; |
| 18 |
protected final String TEXT_1 = "package "; //$NON-NLS-1$ |
18 |
protected final String TEXT_1 = "package "; |
| 19 |
protected final String TEXT_2 = ";"; //$NON-NLS-1$ |
19 |
protected final String TEXT_2 = ";"; |
| 20 |
protected final String TEXT_3 = NL; |
20 |
protected final String TEXT_3 = NL; |
| 21 |
protected final String TEXT_4 = NL + "import "; //$NON-NLS-1$ |
21 |
protected final String TEXT_4 = NL + "import "; |
| 22 |
protected final String TEXT_5 = ";"; //$NON-NLS-1$ |
22 |
protected final String TEXT_5 = ";"; |
| 23 |
protected final String TEXT_6 = NL; |
23 |
protected final String TEXT_6 = NL; |
| 24 |
protected final String TEXT_7 = NL; |
24 |
protected final String TEXT_7 = NL; |
| 25 |
protected final String TEXT_8 = "/**" + NL + " * Servlet implementation class "; //$NON-NLS-1$ //$NON-NLS-2$ |
25 |
protected final String TEXT_8 = "/**" + NL + " * Servlet implementation class "; |
| 26 |
protected final String TEXT_9 = NL + " *" + NL + " * @web.servlet" + NL + " * name=\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
26 |
protected final String TEXT_9 = NL + " *" + NL + " * @web.servlet" + NL + " * name=\""; |
| 27 |
protected final String TEXT_10 = "\"" + NL + " * display-name=\""; //$NON-NLS-1$ //$NON-NLS-2$ |
27 |
protected final String TEXT_10 = "\"" + NL + " * display-name=\""; |
| 28 |
protected final String TEXT_11 = "\""; //$NON-NLS-1$ |
28 |
protected final String TEXT_11 = "\""; |
| 29 |
protected final String TEXT_12 = NL + " * description=\""; //$NON-NLS-1$ |
29 |
protected final String TEXT_12 = NL + " * description=\""; |
| 30 |
protected final String TEXT_13 = "\""; //$NON-NLS-1$ |
30 |
protected final String TEXT_13 = "\""; |
| 31 |
protected final String TEXT_14 = NL + " *" + NL + " * @web.servlet-mapping" + NL + " * url-pattern=\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
31 |
protected final String TEXT_14 = NL + " *" + NL + " * @web.servlet-mapping" + NL + " * url-pattern=\""; |
| 32 |
protected final String TEXT_15 = "\""; //$NON-NLS-1$ |
32 |
protected final String TEXT_15 = "\""; |
| 33 |
protected final String TEXT_16 = NL + " *" + NL + " * @web.servlet-init-param" + NL + " * name=\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
33 |
protected final String TEXT_16 = NL + " *" + NL + " * @web.servlet-init-param" + NL + " * name=\""; |
| 34 |
protected final String TEXT_17 = "\"" + NL + " * value=\""; //$NON-NLS-1$ //$NON-NLS-2$ |
34 |
protected final String TEXT_17 = "\"" + NL + " * value=\""; |
| 35 |
protected final String TEXT_18 = "\""; //$NON-NLS-1$ |
35 |
protected final String TEXT_18 = "\""; |
| 36 |
protected final String TEXT_19 = NL + " * description=\""; //$NON-NLS-1$ |
36 |
protected final String TEXT_19 = NL + " * description=\""; |
| 37 |
protected final String TEXT_20 = "\""; //$NON-NLS-1$ |
37 |
protected final String TEXT_20 = "\""; |
| 38 |
protected final String TEXT_21 = NL + " */"; //$NON-NLS-1$ |
38 |
protected final String TEXT_21 = NL + " */"; |
| 39 |
protected final String TEXT_22 = NL + "public "; //$NON-NLS-1$ |
39 |
protected final String TEXT_22 = NL + "@WebServlet"; |
| 40 |
protected final String TEXT_23 = "abstract "; //$NON-NLS-1$ |
40 |
protected final String TEXT_23 = NL + "public "; |
| 41 |
protected final String TEXT_24 = "final "; //$NON-NLS-1$ |
41 |
protected final String TEXT_24 = "abstract "; |
| 42 |
protected final String TEXT_25 = "class "; //$NON-NLS-1$ |
42 |
protected final String TEXT_25 = "final "; |
| 43 |
protected final String TEXT_26 = " extends "; //$NON-NLS-1$ |
43 |
protected final String TEXT_26 = "class "; |
| 44 |
protected final String TEXT_27 = " implements "; //$NON-NLS-1$ |
44 |
protected final String TEXT_27 = " extends "; |
| 45 |
protected final String TEXT_28 = ", "; //$NON-NLS-1$ |
45 |
protected final String TEXT_28 = " implements "; |
| 46 |
protected final String TEXT_29 = " {"; //$NON-NLS-1$ |
46 |
protected final String TEXT_29 = ", "; |
| 47 |
protected final String TEXT_30 = NL + "\tprivate static final long serialVersionUID = 1L;"; //$NON-NLS-1$ |
47 |
protected final String TEXT_30 = " {"; |
| 48 |
protected final String TEXT_31 = NL + NL + " /**" + NL + " * Default constructor. " + NL + " */" + NL + " public "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ |
48 |
protected final String TEXT_31 = NL + "\tprivate static final long serialVersionUID = 1L;"; |
| 49 |
protected final String TEXT_32 = "() {" + NL + " // TODO Auto-generated constructor stub" + NL + " }"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
49 |
protected final String TEXT_32 = NL + NL + " /**" + NL + " * Default constructor. " + NL + " */" + NL + " public "; |
| 50 |
protected final String TEXT_33 = NL + " " + NL + " /**" + NL + " * @see "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
50 |
protected final String TEXT_33 = "() {" + NL + " // TODO Auto-generated constructor stub" + NL + " }"; |
| 51 |
protected final String TEXT_34 = "#"; //$NON-NLS-1$ |
51 |
protected final String TEXT_34 = NL + " " + NL + " /**" + NL + " * @see "; |
| 52 |
protected final String TEXT_35 = "("; //$NON-NLS-1$ |
52 |
protected final String TEXT_35 = "#"; |
| 53 |
protected final String TEXT_36 = ")" + NL + " */" + NL + " public "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
53 |
protected final String TEXT_36 = "("; |
| 54 |
protected final String TEXT_37 = "("; //$NON-NLS-1$ |
54 |
protected final String TEXT_37 = ")" + NL + " */" + NL + " public "; |
| 55 |
protected final String TEXT_38 = ") {" + NL + " super("; //$NON-NLS-1$ //$NON-NLS-2$ |
55 |
protected final String TEXT_38 = "("; |
| 56 |
protected final String TEXT_39 = ");" + NL + " // TODO Auto-generated constructor stub" + NL + " }"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
56 |
protected final String TEXT_39 = ") {" + NL + " super("; |
| 57 |
protected final String TEXT_40 = NL + NL + "\t/**" + NL + " * @see "; //$NON-NLS-1$ //$NON-NLS-2$ |
57 |
protected final String TEXT_40 = ");" + NL + " // TODO Auto-generated constructor stub" + NL + " }"; |
| 58 |
protected final String TEXT_41 = "#"; //$NON-NLS-1$ |
58 |
protected final String TEXT_41 = NL + NL + "\t/**" + NL + " * @see "; |
| 59 |
protected final String TEXT_42 = "("; //$NON-NLS-1$ |
59 |
protected final String TEXT_42 = "#"; |
| 60 |
protected final String TEXT_43 = ")" + NL + " */" + NL + " public "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
60 |
protected final String TEXT_43 = "("; |
| 61 |
protected final String TEXT_44 = " "; //$NON-NLS-1$ |
61 |
protected final String TEXT_44 = ")" + NL + " */" + NL + " public "; |
| 62 |
protected final String TEXT_45 = "("; //$NON-NLS-1$ |
62 |
protected final String TEXT_45 = " "; |
| 63 |
protected final String TEXT_46 = ") {" + NL + " // TODO Auto-generated method stub"; //$NON-NLS-1$ //$NON-NLS-2$ |
63 |
protected final String TEXT_46 = "("; |
| 64 |
protected final String TEXT_47 = NL + "\t\t\treturn "; //$NON-NLS-1$ |
64 |
protected final String TEXT_47 = ") {" + NL + " // TODO Auto-generated method stub"; |
| 65 |
protected final String TEXT_48 = ";"; //$NON-NLS-1$ |
65 |
protected final String TEXT_48 = NL + "\t\t\treturn "; |
| 66 |
protected final String TEXT_49 = NL + " }"; //$NON-NLS-1$ |
66 |
protected final String TEXT_49 = ";"; |
| 67 |
protected final String TEXT_50 = NL + NL + "\t/**" + NL + "\t * @see Servlet#init(ServletConfig)" + NL + "\t */" + NL + "\tpublic void init(ServletConfig config) throws ServletException {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ |
67 |
protected final String TEXT_50 = NL + " }"; |
| 68 |
protected final String TEXT_51 = NL + NL + "\t/**" + NL + "\t * @see Servlet#destroy()" + NL + "\t */" + NL + "\tpublic void destroy() {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ |
68 |
protected final String TEXT_51 = NL + NL + "\t/**" + NL + "\t * @see Servlet#init(ServletConfig)" + NL + "\t */" + NL + "\tpublic void init(ServletConfig config) throws ServletException {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t}"; |
| 69 |
protected final String TEXT_52 = NL + NL + "\t/**" + NL + "\t * @see Servlet#getServletConfig()" + NL + "\t */" + NL + "\tpublic ServletConfig getServletConfig() {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t\treturn null;" + NL + "\t}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ |
69 |
protected final String TEXT_52 = NL + NL + "\t/**" + NL + "\t * @see Servlet#destroy()" + NL + "\t */" + NL + "\tpublic void destroy() {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t}"; |
| 70 |
protected final String TEXT_53 = NL + NL + "\t/**" + NL + "\t * @see Servlet#getServletInfo()" + NL + "\t */" + NL + "\tpublic String getServletInfo() {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t\treturn null; " + NL + "\t}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ |
70 |
protected final String TEXT_53 = NL + NL + "\t/**" + NL + "\t * @see Servlet#getServletConfig()" + NL + "\t */" + NL + "\tpublic ServletConfig getServletConfig() {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t\treturn null;" + NL + "\t}"; |
| 71 |
protected final String TEXT_54 = NL + NL + "\t/**" + NL + "\t * @see Servlet#service(ServletRequest request, ServletResponse response)" + NL + "\t */" + NL + "\tpublic void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ |
71 |
protected final String TEXT_54 = NL + NL + "\t/**" + NL + "\t * @see Servlet#getServletInfo()" + NL + "\t */" + NL + "\tpublic String getServletInfo() {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t\treturn null; " + NL + "\t}"; |
| 72 |
protected final String TEXT_55 = NL + NL + "\t/**" + NL + "\t * @see HttpServlet#service(HttpServletRequest request, HttpServletResponse response)" + NL + "\t */" + NL + "\tprotected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ |
72 |
protected final String TEXT_55 = NL + NL + "\t/**" + NL + "\t * @see Servlet#service(ServletRequest request, ServletResponse response)" + NL + "\t */" + NL + "\tpublic void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t}"; |
| 73 |
protected final String TEXT_56 = NL + NL + "\t/**" + NL + "\t * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)" + NL + "\t */" + NL + "\tprotected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ |
73 |
protected final String TEXT_56 = NL + NL + "\t/**" + NL + "\t * @see HttpServlet#service(HttpServletRequest request, HttpServletResponse response)" + NL + "\t */" + NL + "\tprotected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t}"; |
| 74 |
protected final String TEXT_57 = NL + NL + "\t/**" + NL + "\t * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)" + NL + "\t */" + NL + "\tprotected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ |
74 |
protected final String TEXT_57 = NL + NL + "\t/**" + NL + "\t * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)" + NL + "\t */" + NL + "\tprotected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t}"; |
| 75 |
protected final String TEXT_58 = NL + NL + "\t/**" + NL + "\t * @see HttpServlet#doPut(HttpServletRequest, HttpServletResponse)" + NL + "\t */" + NL + "\tprotected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ |
75 |
protected final String TEXT_58 = NL + NL + "\t/**" + NL + "\t * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)" + NL + "\t */" + NL + "\tprotected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t}"; |
| 76 |
protected final String TEXT_59 = NL + NL + "\t/**" + NL + "\t * @see HttpServlet#doDelete(HttpServletRequest, HttpServletResponse)" + NL + "\t */" + NL + "\tprotected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ |
76 |
protected final String TEXT_59 = NL + NL + "\t/**" + NL + "\t * @see HttpServlet#doPut(HttpServletRequest, HttpServletResponse)" + NL + "\t */" + NL + "\tprotected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t}"; |
| 77 |
protected final String TEXT_60 = NL + NL + "\t/**" + NL + "\t * @see HttpServlet#doHead(HttpServletRequest, HttpServletResponse)" + NL + "\t */" + NL + "\tprotected void doHead(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ |
77 |
protected final String TEXT_60 = NL + NL + "\t/**" + NL + "\t * @see HttpServlet#doDelete(HttpServletRequest, HttpServletResponse)" + NL + "\t */" + NL + "\tprotected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t}"; |
| 78 |
protected final String TEXT_61 = NL + NL + "\t/**" + NL + "\t * @see HttpServlet#doOptions(HttpServletRequest, HttpServletResponse)" + NL + "\t */" + NL + "\tprotected void doOptions(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ |
78 |
protected final String TEXT_61 = NL + NL + "\t/**" + NL + "\t * @see HttpServlet#doHead(HttpServletRequest, HttpServletResponse)" + NL + "\t */" + NL + "\tprotected void doHead(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t}"; |
| 79 |
protected final String TEXT_62 = NL + NL + "\t/**" + NL + "\t * @see HttpServlet#doTrace(HttpServletRequest, HttpServletResponse)" + NL + "\t */" + NL + "\tprotected void doTrace(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ |
79 |
protected final String TEXT_62 = NL + NL + "\t/**" + NL + "\t * @see HttpServlet#doOptions(HttpServletRequest, HttpServletResponse)" + NL + "\t */" + NL + "\tprotected void doOptions(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t}"; |
| 80 |
protected final String TEXT_63 = NL + NL + "}"; //$NON-NLS-1$ |
80 |
protected final String TEXT_63 = NL + NL + "\t/**" + NL + "\t * @see HttpServlet#doTrace(HttpServletRequest, HttpServletResponse)" + NL + "\t */" + NL + "\tprotected void doTrace(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t}"; |
| 81 |
protected final String TEXT_64 = NL; |
81 |
protected final String TEXT_64 = NL + NL + "}"; |
|
|
82 |
protected final String TEXT_65 = NL; |
| 82 |
|
83 |
|
| 83 |
public String generate(Object argument) |
84 |
public String generate(Object argument) |
| 84 |
{ |
85 |
{ |
|
Lines 163-194
Link Here
|
| 163 |
} |
164 |
} |
| 164 |
|
165 |
|
| 165 |
stringBuffer.append(TEXT_21); |
166 |
stringBuffer.append(TEXT_21); |
|
|
167 |
|
| 168 |
if ("3.0".equals(model.getJavaEEVersion())) { |
| 169 |
|
| 170 |
stringBuffer.append(TEXT_22); |
| 171 |
stringBuffer.append(model.getJavaEE6AnnotationParameters()); |
| 172 |
|
| 173 |
} |
| 174 |
|
| 166 |
|
175 |
|
| 167 |
if (model.isPublic()) { |
176 |
if (model.isPublic()) { |
| 168 |
|
177 |
|
| 169 |
stringBuffer.append(TEXT_22); |
178 |
stringBuffer.append(TEXT_23); |
| 170 |
|
179 |
|
| 171 |
} |
180 |
} |
| 172 |
|
181 |
|
| 173 |
if (model.isAbstract()) { |
182 |
if (model.isAbstract()) { |
| 174 |
|
183 |
|
| 175 |
stringBuffer.append(TEXT_23); |
184 |
stringBuffer.append(TEXT_24); |
| 176 |
|
185 |
|
| 177 |
} |
186 |
} |
| 178 |
|
187 |
|
| 179 |
if (model.isFinal()) { |
188 |
if (model.isFinal()) { |
| 180 |
|
189 |
|
| 181 |
stringBuffer.append(TEXT_24); |
190 |
stringBuffer.append(TEXT_25); |
| 182 |
|
191 |
|
| 183 |
} |
192 |
} |
| 184 |
|
193 |
|
| 185 |
stringBuffer.append(TEXT_25); |
194 |
stringBuffer.append(TEXT_26); |
| 186 |
stringBuffer.append( model.getClassName() ); |
195 |
stringBuffer.append( model.getClassName() ); |
| 187 |
|
196 |
|
| 188 |
String superClass = model.getSuperclassName(); |
197 |
String superClass = model.getSuperclassName(); |
| 189 |
if (superClass != null && superClass.length() > 0) { |
198 |
if (superClass != null && superClass.length() > 0) { |
| 190 |
|
199 |
|
| 191 |
stringBuffer.append(TEXT_26); |
200 |
stringBuffer.append(TEXT_27); |
| 192 |
stringBuffer.append( superClass ); |
201 |
stringBuffer.append( superClass ); |
| 193 |
|
202 |
|
| 194 |
} |
203 |
} |
|
Lines 196-202
Link Here
|
| 196 |
List<String> interfaces = model.getInterfaces(); |
205 |
List<String> interfaces = model.getInterfaces(); |
| 197 |
if ( interfaces.size() > 0) { |
206 |
if ( interfaces.size() > 0) { |
| 198 |
|
207 |
|
| 199 |
stringBuffer.append(TEXT_27); |
208 |
stringBuffer.append(TEXT_28); |
| 200 |
|
209 |
|
| 201 |
} |
210 |
} |
| 202 |
|
211 |
|
|
Lines 204-210
Link Here
|
| 204 |
String INTERFACE = interfaces.get(i); |
213 |
String INTERFACE = interfaces.get(i); |
| 205 |
if (i > 0) { |
214 |
if (i > 0) { |
| 206 |
|
215 |
|
| 207 |
stringBuffer.append(TEXT_28); |
216 |
stringBuffer.append(TEXT_29); |
| 208 |
|
217 |
|
| 209 |
} |
218 |
} |
| 210 |
|
219 |
|
|
Lines 212-231
Link Here
|
| 212 |
|
221 |
|
| 213 |
} |
222 |
} |
| 214 |
|
223 |
|
| 215 |
stringBuffer.append(TEXT_29); |
224 |
stringBuffer.append(TEXT_30); |
| 216 |
|
225 |
|
| 217 |
if (model.isGenericServletSuperclass()) { |
226 |
if (model.isGenericServletSuperclass()) { |
| 218 |
|
227 |
|
| 219 |
stringBuffer.append(TEXT_30); |
228 |
stringBuffer.append(TEXT_31); |
| 220 |
|
229 |
|
| 221 |
} |
230 |
} |
| 222 |
|
231 |
|
| 223 |
|
232 |
|
| 224 |
if (!model.hasEmptySuperclassConstructor()) { |
233 |
if (!model.hasEmptySuperclassConstructor()) { |
| 225 |
|
234 |
|
| 226 |
stringBuffer.append(TEXT_31); |
|
|
| 227 |
stringBuffer.append( model.getClassName() ); |
| 228 |
stringBuffer.append(TEXT_32); |
235 |
stringBuffer.append(TEXT_32); |
|
|
236 |
stringBuffer.append( model.getClassName() ); |
| 237 |
stringBuffer.append(TEXT_33); |
| 229 |
|
238 |
|
| 230 |
} |
239 |
} |
| 231 |
|
240 |
|
|
Lines 234-252
Link Here
|
| 234 |
for (Constructor constructor : constructors) { |
243 |
for (Constructor constructor : constructors) { |
| 235 |
if (constructor.isPublic() || constructor.isProtected()) { |
244 |
if (constructor.isPublic() || constructor.isProtected()) { |
| 236 |
|
245 |
|
| 237 |
stringBuffer.append(TEXT_33); |
|
|
| 238 |
stringBuffer.append( model.getSuperclassName() ); |
| 239 |
stringBuffer.append(TEXT_34); |
246 |
stringBuffer.append(TEXT_34); |
| 240 |
stringBuffer.append( model.getSuperclassName() ); |
247 |
stringBuffer.append( model.getSuperclassName() ); |
| 241 |
stringBuffer.append(TEXT_35); |
248 |
stringBuffer.append(TEXT_35); |
| 242 |
stringBuffer.append( constructor.getParamsForJavadoc() ); |
249 |
stringBuffer.append( model.getSuperclassName() ); |
| 243 |
stringBuffer.append(TEXT_36); |
250 |
stringBuffer.append(TEXT_36); |
| 244 |
stringBuffer.append( model.getClassName() ); |
251 |
stringBuffer.append( constructor.getParamsForJavadoc() ); |
| 245 |
stringBuffer.append(TEXT_37); |
252 |
stringBuffer.append(TEXT_37); |
| 246 |
stringBuffer.append( constructor.getParamsForDeclaration() ); |
253 |
stringBuffer.append( model.getClassName() ); |
| 247 |
stringBuffer.append(TEXT_38); |
254 |
stringBuffer.append(TEXT_38); |
| 248 |
stringBuffer.append( constructor.getParamsForCall() ); |
255 |
stringBuffer.append( constructor.getParamsForDeclaration() ); |
| 249 |
stringBuffer.append(TEXT_39); |
256 |
stringBuffer.append(TEXT_39); |
|
|
257 |
stringBuffer.append( constructor.getParamsForCall() ); |
| 258 |
stringBuffer.append(TEXT_40); |
| 250 |
|
259 |
|
| 251 |
} |
260 |
} |
| 252 |
} |
261 |
} |
|
Lines 256-330
Link Here
|
| 256 |
if (model.shouldImplementAbstractMethods()) { |
265 |
if (model.shouldImplementAbstractMethods()) { |
| 257 |
for (Method method : model.getUnimplementedMethods()) { |
266 |
for (Method method : model.getUnimplementedMethods()) { |
| 258 |
|
267 |
|
| 259 |
stringBuffer.append(TEXT_40); |
|
|
| 260 |
stringBuffer.append( method.getContainingJavaClass() ); |
| 261 |
stringBuffer.append(TEXT_41); |
268 |
stringBuffer.append(TEXT_41); |
| 262 |
stringBuffer.append( method.getName() ); |
269 |
stringBuffer.append( method.getContainingJavaClass() ); |
| 263 |
stringBuffer.append(TEXT_42); |
270 |
stringBuffer.append(TEXT_42); |
| 264 |
stringBuffer.append( method.getParamsForJavadoc() ); |
271 |
stringBuffer.append( method.getName() ); |
| 265 |
stringBuffer.append(TEXT_43); |
272 |
stringBuffer.append(TEXT_43); |
| 266 |
stringBuffer.append( method.getReturnType() ); |
273 |
stringBuffer.append( method.getParamsForJavadoc() ); |
| 267 |
stringBuffer.append(TEXT_44); |
274 |
stringBuffer.append(TEXT_44); |
| 268 |
stringBuffer.append( method.getName() ); |
275 |
stringBuffer.append( method.getReturnType() ); |
| 269 |
stringBuffer.append(TEXT_45); |
276 |
stringBuffer.append(TEXT_45); |
| 270 |
stringBuffer.append( method.getParamsForDeclaration() ); |
277 |
stringBuffer.append( method.getName() ); |
| 271 |
stringBuffer.append(TEXT_46); |
278 |
stringBuffer.append(TEXT_46); |
|
|
279 |
stringBuffer.append( method.getParamsForDeclaration() ); |
| 280 |
stringBuffer.append(TEXT_47); |
| 272 |
|
281 |
|
| 273 |
String defaultReturnValue = method.getDefaultReturnValue(); |
282 |
String defaultReturnValue = method.getDefaultReturnValue(); |
| 274 |
if (defaultReturnValue != null) { |
283 |
if (defaultReturnValue != null) { |
| 275 |
|
284 |
|
| 276 |
stringBuffer.append(TEXT_47); |
|
|
| 277 |
stringBuffer.append( defaultReturnValue ); |
| 278 |
stringBuffer.append(TEXT_48); |
285 |
stringBuffer.append(TEXT_48); |
|
|
286 |
stringBuffer.append( defaultReturnValue ); |
| 287 |
stringBuffer.append(TEXT_49); |
| 279 |
|
288 |
|
| 280 |
} |
289 |
} |
| 281 |
|
290 |
|
| 282 |
stringBuffer.append(TEXT_49); |
291 |
stringBuffer.append(TEXT_50); |
| 283 |
|
292 |
|
| 284 |
} |
293 |
} |
| 285 |
} |
294 |
} |
| 286 |
|
295 |
|
| 287 |
if (model.shouldGenInit()) { |
296 |
if (model.shouldGenInit()) { |
| 288 |
stringBuffer.append(TEXT_50); |
|
|
| 289 |
} |
| 290 |
if (model.shouldGenDestroy()) { |
| 291 |
stringBuffer.append(TEXT_51); |
297 |
stringBuffer.append(TEXT_51); |
| 292 |
} |
298 |
} |
| 293 |
if (model.shouldGenGetServletConfig()) { |
299 |
if (model.shouldGenDestroy()) { |
| 294 |
stringBuffer.append(TEXT_52); |
300 |
stringBuffer.append(TEXT_52); |
| 295 |
} |
301 |
} |
| 296 |
if (model.shouldGenGetServletInfo()) { |
302 |
if (model.shouldGenGetServletConfig()) { |
| 297 |
stringBuffer.append(TEXT_53); |
303 |
stringBuffer.append(TEXT_53); |
| 298 |
} |
304 |
} |
| 299 |
if (model.shouldGenService() && !model.isHttpServletSuperclass()) { |
305 |
if (model.shouldGenGetServletInfo()) { |
| 300 |
stringBuffer.append(TEXT_54); |
306 |
stringBuffer.append(TEXT_54); |
| 301 |
} |
307 |
} |
| 302 |
if (model.shouldGenService() && model.isHttpServletSuperclass()) { |
308 |
if (model.shouldGenService() && !model.isHttpServletSuperclass()) { |
| 303 |
stringBuffer.append(TEXT_55); |
309 |
stringBuffer.append(TEXT_55); |
| 304 |
} |
310 |
} |
| 305 |
if (model.shouldGenDoGet()) { |
311 |
if (model.shouldGenService() && model.isHttpServletSuperclass()) { |
| 306 |
stringBuffer.append(TEXT_56); |
312 |
stringBuffer.append(TEXT_56); |
| 307 |
} |
313 |
} |
| 308 |
if (model.shouldGenDoPost()) { |
314 |
if (model.shouldGenDoGet()) { |
| 309 |
stringBuffer.append(TEXT_57); |
315 |
stringBuffer.append(TEXT_57); |
| 310 |
} |
316 |
} |
| 311 |
if (model.shouldGenDoPut()) { |
317 |
if (model.shouldGenDoPost()) { |
| 312 |
stringBuffer.append(TEXT_58); |
318 |
stringBuffer.append(TEXT_58); |
| 313 |
} |
319 |
} |
| 314 |
if (model.shouldGenDoDelete()) { |
320 |
if (model.shouldGenDoPut()) { |
| 315 |
stringBuffer.append(TEXT_59); |
321 |
stringBuffer.append(TEXT_59); |
| 316 |
} |
322 |
} |
| 317 |
if (model.shouldGenDoHead()) { |
323 |
if (model.shouldGenDoDelete()) { |
| 318 |
stringBuffer.append(TEXT_60); |
324 |
stringBuffer.append(TEXT_60); |
| 319 |
} |
325 |
} |
| 320 |
if (model.shouldGenDoOptions()) { |
326 |
if (model.shouldGenDoHead()) { |
| 321 |
stringBuffer.append(TEXT_61); |
327 |
stringBuffer.append(TEXT_61); |
| 322 |
} |
328 |
} |
| 323 |
if (model.shouldGenDoTrace()) { |
329 |
if (model.shouldGenDoOptions()) { |
| 324 |
stringBuffer.append(TEXT_62); |
330 |
stringBuffer.append(TEXT_62); |
| 325 |
} |
331 |
} |
|
|
332 |
if (model.shouldGenDoTrace()) { |
| 326 |
stringBuffer.append(TEXT_63); |
333 |
stringBuffer.append(TEXT_63); |
|
|
334 |
} |
| 327 |
stringBuffer.append(TEXT_64); |
335 |
stringBuffer.append(TEXT_64); |
|
|
336 |
stringBuffer.append(TEXT_65); |
| 328 |
return stringBuffer.toString(); |
337 |
return stringBuffer.toString(); |
| 329 |
} |
338 |
} |
| 330 |
} |
339 |
} |