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 23 26 public class JavaHolderWriter extends JavaClassWriter { 27 28 29 private TypeEntry type; 30 31 37 protected JavaHolderWriter(Emitter emitter, TypeEntry type) { 38 39 super(emitter, Utils.holder(type, emitter), "holder"); 40 41 this.type = type; 42 } 44 49 protected String getClassModifiers() { 50 return super.getClassModifiers() + "final "; 51 } 53 58 protected String getImplementsText() { 59 return "implements javax.xml.rpc.holders.Holder "; 60 } 62 68 protected void writeFileBody(PrintWriter pw) throws IOException { 69 70 String holderType = type.getName(); 71 72 pw.println(" public " + holderType + " value;"); 73 pw.println(); 74 pw.println(" public " + className + "() {"); 75 pw.println(" }"); 76 pw.println(); 77 pw.println(" public " + className + "(" + holderType + " value) {"); 78 pw.println(" this.value = value;"); 79 pw.println(" }"); 80 pw.println(); 81 } 83 86 public void generate() throws IOException { 87 String fqcn = getPackage() + "." + getClassName(); 88 if (emitter.isDeploy()) { 89 if (!emitter.doesExist(fqcn)) { 90 super.generate(); 91 } 92 } else { 93 super.generate(); 94 } 95 } 96 } | Popular Tags |