KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_ws > wsgen > generator > axis > wsdl2java > JOnASGeneratorFactory


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999-2004 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: JOnASGeneratorFactory.java,v 1.1 2004/09/09 16:12:37 sauthieg Exp $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.jonas_ws.wsgen.generator.axis.wsdl2java;
26
27 import javax.wsdl.Definition;
28 import javax.wsdl.Service;
29
30 import org.apache.axis.wsdl.gen.Generator;
31 import org.apache.axis.wsdl.gen.NoopGenerator;
32 import org.apache.axis.wsdl.symbolTable.ServiceEntry;
33 import org.apache.axis.wsdl.symbolTable.SymbolTable;
34 import org.apache.axis.wsdl.toJava.Emitter;
35 import org.apache.axis.wsdl.toJava.JavaDefinitionWriter;
36 import org.apache.axis.wsdl.toJava.JavaGeneratorFactory;
37
38 /**
39  * <code>JOnASGeneratorFactory</code> returns our own JOnASServiceWriter in WSDL2Java process.
40  *
41  * @author Guillaume Sauthier
42  */

43 public class JOnASGeneratorFactory extends JavaGeneratorFactory {
44
45     /**
46      * Constructs a new JOnASGeneratorFactory associated with a given
47      * JOnASEmitter
48      * @param emitter the JOnASEmitter
49      */

50     public JOnASGeneratorFactory(Emitter emitter) {
51         super(emitter);
52     }
53
54     /**
55      * Method addDefinitionGenerators
56      */

57     protected void addDefinitionGenerators() {
58         addGenerator(Definition.class, JavaDefinitionWriter.class); // for
59
// faults
60
} // addDefinitionGenerators
61

62     /**
63      * @param service wsdl:service instance
64      * @param symbolTable SymbolTable
65      * @return Returns the JOnASServiceWriter when encoutering Service in
66      * SymbolTable
67      */

68     public Generator getGenerator(Service service, SymbolTable symbolTable) {
69         if (include(service.getQName())) {
70             Generator writer = new JOnASServiceWriter(emitter, service, symbolTable);
71             ServiceEntry sEntry = symbolTable.getServiceEntry(service.getQName());
72             serviceWriters.addStuff(writer, sEntry, symbolTable);
73             return serviceWriters;
74         } else {
75             return new NoopGenerator();
76         }
77     } // getGenerator
78

79     /**
80      * Method getGenerator
81      *
82      * @param type TypeEntry
83      * @param symbolTable SymbolTable
84      * @return a NoopGenerator (we don't need Types at this time, should be already generated)
85      */

86     /*
87     public Generator getGenerator(TypeEntry type, SymbolTable symbolTable) {
88         return new NoopGenerator();
89     } // getGenerator
90 */

91 }
Popular Tags