2
* Copyright 2001-2004 The Apache Software Foundation.
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
16
package samples.integrationGuide.example2;
18
import org.apache.axis.wsdl.symbolTable.SymbolTable;
19
import org.apache.axis.wsdl.toJava.Emitter;
20
import org.apache.axis.wsdl.toJava.JavaWriter;
22
import javax.wsdl.Definition;
23
import java.io.IOException;
24
import java.io.PrintWriter;
26
public class MyDeployWriter extends JavaWriter {
28
private String filename;
30
public MyDeployWriter(Emitter emitter, Definition definition,
31
SymbolTable symbolTable) {
32
super(emitter, "deploy");
34
// Create the fully-qualified file name
35
String dir = emitter.getNamespaces().getAsDir(
36
definition.getTargetNamespace());
37
filename = dir + "deploy.useless";
40
public void generate() throws IOException {
41
if (emitter.isServerSide()) {
46
protected String getFileName() {
51
* Override the common JavaWriter header to a no-op.
53
protected void writeFileHeader(PrintWriter pw) throws IOException {
57
* Write the service list file.
59
protected void writeFileBody(PrintWriter pw) throws IOException {
60
MyEmitter myEmitter = (MyEmitter) emitter;
61
if (myEmitter.getSong() == MyEmitter.RUM) {
62
pw.println("Yo! Ho! Ho! And a bottle of rum.");
64
else if (myEmitter.getSong() == MyEmitter.WORK) {
65
pw.println("Hi ho! Hi ho! It's off to work we go.");
68
pw.println("Feelings... Nothing more than feelings...");
71
} // class MyDeployWriter