1 package org.apache.axis2.wsdl.codegen.writer; 2 3 import org.apache.axis2.wsdl.codegen.XSLTConstants; 4 import org.apache.axis2.wsdl.util.FileWriter; 5 import org.apache.axis2.wsdl.util.XSLTTemplateProcessor; 6 7 import java.io.File ; 8 import java.io.FileOutputStream ; 9 import java.io.InputStream ; 10 11 31 public abstract class ClassWriter { 32 33 protected File outputFileLocation = null; 34 protected FileOutputStream stream = null; 35 protected InputStream xsltStream = null; 36 protected int language = XSLTConstants.LanguageTypes.JAVA; 38 42 public void setLanguage(int language) { 43 this.language = language; 44 } 45 46 49 public abstract void loadTemplate(); 50 51 57 public void createOutFile(String packageName,String fileName) throws Exception { 58 File outputFile = FileWriter.createClassFile(outputFileLocation,packageName,fileName,language); 59 this.stream = new FileOutputStream (outputFile); 60 } 61 62 67 public void writeOutFile(InputStream documentStream) throws Exception { 68 XSLTTemplateProcessor.parse(this.stream,documentStream,this.xsltStream); 69 this.stream.flush(); 70 this.stream.close(); 71 72 73 } 74 75 76 } 77 | Popular Tags |