1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.geronimo.ews.jaxrpcmapping;
18
19 import org.apache.axis.wsdl.symbolTable.TypeEntry;
20 import org.apache.axis.wsdl.toJava.JavaWriter;
21
22 import java.io.IOException;
23 import java.io.PrintWriter;
24 import java.util.Vector;
25
26 /***
27 * This is Wsdl2java's Complex Fault Writer.
28 * It generates bean-like class for complexTypes used
29 * in a operation fault message.
30 *
31 * @author Ias (iasandcb@tmax.co.kr)
32 * @deprecated no more used by J2eeGeneratorFactory
33 */
34 public class J2eeBeanFaultWriter extends J2eeBeanWriter {
35 /***
36 * Constructor.
37 *
38 * @param emitter
39 * @param type The type representing this class
40 * @param elements Vector containing the Type and name of each property
41 * @param extendType The type representing the extended class (or null)
42 * @param attributes Vector containing the attribute types and names
43 * @param helper Helper class writer
44 */
45 protected J2eeBeanFaultWriter(J2eeEmitter emitter,
46 TypeEntry type,
47 Vector elements,
48 TypeEntry extendType,
49 Vector attributes,
50 JavaWriter helper) {
51 super(emitter, type, elements,
52 extendType, attributes, helper);
53
54
55
56
57
58 enableDefaultConstructor = true;
59
60
61 enableFullConstructor = true;
62
63
64 enableSetters = true;
65 }
66
67 /***
68 * Returns the appropriate extends text
69 *
70 * @return "" or " extends <class> "
71 */
72 protected String getExtendsText() {
73
74 String extendsText = super.getExtendsText();
75 if (extendsText.equals("")) {
76
77
78 extendsText = " extends org.apache.axis.AxisFault ";
79 }
80 return extendsText;
81 }
82
83 /***
84 * Write the Exception serialization code
85 * NOTE: This function is written in JavaFaultWriter.java also.
86 */
87 protected void writeFileFooter(PrintWriter pw) throws IOException {
88
89
90
91
92
93
94
95 pw.println();
96 pw.println(" /**");
97 pw.println(" * Writes the exception data to the faultDetails");
98 pw.println(" */");
99 pw.println(" public void writeDetails(javax.xml.namespace.QName qname, org.apache.axis.encoding.SerializationContext context) throws java.io.IOException {");
100 pw.println(" context.serialize(qname, null, this);");
101 pw.println(" }");
102 super.writeFileFooter(pw);
103 }
104 }