JavaBindingWriterpublic class JavaBindingWriter extends Object implements org.apache.axis.wsdl.gen.GeneratorThis is Wsdl2java's Binding Writer. It writes the following files, as appropriate:
Stub.java, Skeleton.java, Impl.java. |
Fields Summary |
---|
protected org.apache.axis.wsdl.gen.Generator | stubWriterField stubWriter | protected org.apache.axis.wsdl.gen.Generator | skelWriterField skelWriter | protected org.apache.axis.wsdl.gen.Generator | implWriterField implWriter | protected org.apache.axis.wsdl.gen.Generator | interfaceWriterField interfaceWriter | protected Emitter | emitterField emitter | protected javax.wsdl.Binding | bindingField binding | protected org.apache.axis.wsdl.symbolTable.SymbolTable | symbolTableField symbolTable | public static String | INTERFACE_NAMEField INTERFACE_NAME |
Methods Summary |
---|
public void | generate()Write all the binding bindings: stub, skeleton, and impl.
setGenerators();
postSetGenerators();
if (interfaceWriter != null) {
interfaceWriter.generate();
}
if (stubWriter != null) {
stubWriter.generate();
}
if (skelWriter != null) {
skelWriter.generate();
}
if (implWriter != null) {
implWriter.generate();
}
| protected org.apache.axis.wsdl.gen.Generator | getJavaImplWriter(Emitter emitter, org.apache.axis.wsdl.symbolTable.BindingEntry bEntry, org.apache.axis.wsdl.symbolTable.SymbolTable st)getJavaImplWriter
return new JavaImplWriter(emitter, bEntry, st);
| protected org.apache.axis.wsdl.gen.Generator | getJavaInterfaceWriter(Emitter emitter, org.apache.axis.wsdl.symbolTable.PortTypeEntry ptEntry, org.apache.axis.wsdl.symbolTable.BindingEntry bEntry, org.apache.axis.wsdl.symbolTable.SymbolTable st)getJavaInterfaceWriter
return new JavaInterfaceWriter(emitter, ptEntry, bEntry, st);
| protected org.apache.axis.wsdl.gen.Generator | getJavaSkelWriter(Emitter emitter, org.apache.axis.wsdl.symbolTable.BindingEntry bEntry, org.apache.axis.wsdl.symbolTable.SymbolTable st)getJavaSkelWriter
return new JavaSkelWriter(emitter, bEntry, st);
| protected org.apache.axis.wsdl.gen.Generator | getJavaStubWriter(Emitter emitter, org.apache.axis.wsdl.symbolTable.BindingEntry bEntry, org.apache.axis.wsdl.symbolTable.SymbolTable st)getJavaStubWriter
return new JavaStubWriter(emitter, bEntry, st);
| protected void | postSetGenerators()Set the writer based on the other condition after generate() is called.
if (emitter.isDeploy()) {
interfaceWriter = null;
stubWriter = null;
skelWriter = null;
implWriter = null;
}
| protected void | setGenerators()setGenerators
Logic to set the generators that are based on the Binding
This logic was moved from the constructor so extended interfaces
can more effectively use the hooks.
BindingEntry bEntry = symbolTable.getBindingEntry(binding.getQName());
// Interface writer
PortTypeEntry ptEntry =
symbolTable.getPortTypeEntry(binding.getPortType().getQName());
if (ptEntry.isReferenced()) {
interfaceWriter = getJavaInterfaceWriter(emitter, ptEntry, bEntry,
symbolTable);
}
if (bEntry.isReferenced()) {
// Stub writer
stubWriter = getJavaStubWriter(emitter, bEntry, symbolTable);
// Skeleton and Impl writers
if (emitter.isServerSide()) {
if (emitter.isSkeletonWanted()) {
skelWriter = getJavaSkelWriter(emitter, bEntry,
symbolTable);
}
// Use custom implementation classname if available
String fileName = emitter.getImplementationClassName();
if ( fileName == null)
fileName = Utils.getJavaLocalName(bEntry.getName())
+ "Impl.java";
else
fileName = Utils.getJavaLocalName(fileName) + ".java";
try {
if (Utils.fileExists(fileName,
binding.getQName().getNamespaceURI(),
emitter.getNamespaces())) {
if (!emitter.isQuiet()) {
System.out.println(
Messages.getMessage("wontOverwrite",
fileName));
}
} else {
implWriter = getJavaImplWriter(emitter, bEntry,
symbolTable);
}
} catch (IOException ioe) {
System.err.println(Messages.getMessage("fileExistError00",
fileName));
}
}
}
|
|