KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis2 > wsdl > codegen > writer > ServiceXMLWriter


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
6 import java.io.File JavaDoc;
7 import java.io.FileOutputStream JavaDoc;
8
9 /*
10 * Copyright 2004,2005 The Apache Software Foundation.
11 *
12 * Licensed under the Apache License, Version 2.0 (the "License");
13 * you may not use this file except in compliance with the License.
14 * You may obtain a copy of the License at
15 *
16 * http://www.apache.org/licenses/LICENSE-2.0
17 *
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an "AS IS" BASIS,
20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
23 *
24 *
25 */

26 public class ServiceXMLWriter extends ClassWriter{
27
28
29     public ServiceXMLWriter(String JavaDoc outputFileLocation) {
30         this.outputFileLocation = new File JavaDoc(outputFileLocation);
31     }
32
33     public ServiceXMLWriter(File JavaDoc outputFileLocation,int language) {
34         this.outputFileLocation = outputFileLocation;
35         this.language = language;
36     }
37
38     /**
39      * @see org.apache.axis2.wsdl.codegen.writer.ClassWriter#loadTemplate()
40      */

41     public void loadTemplate(){
42         Class JavaDoc clazz = this.getClass();
43         this.xsltStream = clazz.getResourceAsStream(XSLTConstants.XSLTServiceXMLTemplates.GENERAL_SERVICE_TEMPLATE);
44     }
45
46     public void createOutFile(String JavaDoc packageName, String JavaDoc fileName) throws Exception JavaDoc {
47         File JavaDoc outputFile = FileWriter.createClassFile(outputFileLocation,packageName,"service",".xml");
48         this.stream = new FileOutputStream JavaDoc(outputFile);
49     }
50 }
51
52
Popular Tags