1 16 package org.apache.axis.wsdl.toJava; 17 18 import org.apache.axis.wsdl.symbolTable.TypeEntry; 19 20 import java.io.IOException ; 21 import java.io.PrintWriter ; 22 import java.util.Vector ; 23 import java.util.Set ; 24 import java.util.Collections ; 25 import java.util.HashSet ; 26 27 32 public class JavaBeanFaultWriter extends JavaBeanWriter { 33 44 public static final Set RESERVED_PROPERTY_NAMES; 45 static { 46 Set temp = new HashSet (); 47 temp.add("cause"); 49 temp.add("message"); 50 temp.add("localizedMessage"); 51 temp.add("stackTrace"); 52 temp.add("faultActor"); 54 temp.add("faultCode"); 55 temp.add("faultDetails"); 56 temp.add("faultNode"); 57 temp.add("faultReason"); 58 temp.add("faultRole"); 59 temp.add("faultString"); 60 temp.add("faultSubCodes"); 61 temp.add("headers"); 62 RESERVED_PROPERTY_NAMES = Collections.unmodifiableSet(temp); 63 } 64 65 66 76 protected JavaBeanFaultWriter(Emitter emitter, TypeEntry type, 77 Vector elements, TypeEntry extendType, 78 Vector attributes, JavaWriter helper) { 79 80 super(emitter, type, elements, extendType, attributes, helper); 81 82 enableDefaultConstructor = true; 87 88 enableFullConstructor = true; 90 91 enableSetters = true; 93 } 95 100 protected String getExtendsText() { 101 102 String extendsText = super.getExtendsText(); 104 105 if (extendsText.equals("")) { 106 107 extendsText = " extends org.apache.axis.AxisFault "; 110 } 111 112 return extendsText; 113 } 114 115 123 protected void writeFileFooter(PrintWriter pw) throws IOException { 124 125 pw.println(); 132 pw.println(" /**"); 133 pw.println(" * Writes the exception data to the faultDetails"); 134 pw.println(" */"); 135 pw.println( 136 " public void writeDetails(javax.xml.namespace.QName qname, org.apache.axis.encoding.SerializationContext context) throws java.io.IOException {"); 137 pw.println(" context.serialize(qname, null, this);"); 138 pw.println(" }"); 139 super.writeFileFooter(pw); 140 } } | Popular Tags |