class CodeWriter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) java.lang.String |
codeHead
The header file code of the actual web service adapter
|
(package private) java.lang.String |
codeImpl
The implementation of the actual web service adapter
|
(package private) java.lang.String |
codeUsage
Stores the code that gives a usage stub for each supported method
|
(package private) java.lang.String |
wsdlUrl
The resource URL of the web service's WSDL description file
|
Constructor and Description |
---|
CodeWriter(java.lang.String url)
Initializes a new CodeWriter
Adds initial static stub code to the respective variables
|
Modifier and Type | Method and Description |
---|---|
private void |
addDocumentation(javax.wsdl.Operation op,
java.lang.String output)
Creates a Description Text/Documentation for an Operation
|
(package private) static void |
addFilesToZip(java.io.File archive,
java.io.File[] files,
java.lang.String path)
Copies files into a zip archive
|
(package private) void |
addOperation(javax.wsdl.Operation op,
java.lang.String params,
java.lang.String output)
Creates a new adapter method for the given web service operation
|
private void |
finalizeUsageCode()
Adds further static code to the Objective-C usage stub that is needed to generate a valid XCode project.
|
(package private) static java.lang.String |
getAdapterAddress()
Tries to at least half way determine the host address
|
private void |
hasInputHasOutputWriter(javax.wsdl.Operation op,
java.lang.String params,
java.lang.String output)
Code stub generation for a request-response message with parameters
|
private void |
hasInputNoOutputWriter(javax.wsdl.Operation op,
java.lang.String params)
Code stub generation for a one-way message with parameters
|
private java.lang.String |
htmlDocumentation()
Generates an html document that displays nicely formatted stub code for developers
Depends on codeUsage, codeHead and codeImplementation to already be correctly generated
|
(package private) static java.lang.String |
keyVal(java.lang.String key,
java.lang.String value,
java.lang.String comment)
Creates a currently Objective-C specific NSDictionary element with key, value and optional comment.
|
private void |
noInputHasOutputWriter(javax.wsdl.Operation op,
java.lang.String output)
Code stub generation for a request-response message without parameters
|
private void |
noInputNoOutputWriter(javax.wsdl.Operation op)
Code stub generation for a one-way message without parameters
|
private java.lang.String |
parameterDictionary(javax.wsdl.Operation op,
java.lang.String params)
Generates a NSMutableDictionary Object (part of the Cocoa Foundation Framework) from the parameters object
|
(package private) static void |
toFile(java.lang.String dirPath,
java.lang.String filename,
java.lang.String content)
Writes a String to a file
|
(package private) void |
write(java.lang.String dirPath)
Writes the generated code stubs to the servlet's resource path
|
private static boolean |
zipEntryMatch(java.lang.String zeName,
java.io.File[] files,
java.lang.String path)
Helper function to check if a certain file already exists
|
java.lang.String codeUsage
java.lang.String codeHead
java.lang.String codeImpl
java.lang.String wsdlUrl
CodeWriter(java.lang.String url)
url
- The resource URL of the web service's WSDL description filevoid addOperation(javax.wsdl.Operation op, java.lang.String params, java.lang.String output)
op
- The javax.wsdl.Operation object representing the web service's operation that should be addedparams
- A string representation of the parameter structure that may be passed to the web service's operation as provided by WSDLParser.getParameterDetails(String, QName, QName)output
- A string representation of the object structure that may be returned by the web service's operation as provided by WSDLParser.getParameterDetails(String, QName, QName)void write(java.lang.String dirPath)
dirPath
- The file system path that should be written toprivate void noInputNoOutputWriter(javax.wsdl.Operation op)
op
- The javax.wsdl.Operation object representing the web service's operation that should be addedprivate void noInputHasOutputWriter(javax.wsdl.Operation op, java.lang.String output)
op
- The javax.wsdl.Operation object representing the web service's operation that should be addedoutput
- A string representation of the object structure that may be returned by the web service's operation as provided by WSDLParser.getParameterDetails(String, QName, QName)private void hasInputNoOutputWriter(javax.wsdl.Operation op, java.lang.String params)
op
- The javax.wsdl.Operation object representing the web service's operation that should be addedparams
- A string representation of the parameter structure that may be passed to the web service's operation as provided by WSDLParser.getParameterDetails(String, QName, QName)private void hasInputHasOutputWriter(javax.wsdl.Operation op, java.lang.String params, java.lang.String output)
op
- The javax.wsdl.Operation object representing the web service's operation that should be addedparams
- A string representation of the parameter structure that may be passed to the web service's operation as provided by WSDLParser.getParameterDetails(String, QName, QName)output
- A string representation of the object structure that may be returned by the web service's operation as provided by WSDLParser.getParameterDetails(String, QName, QName)private void finalizeUsageCode()
private void addDocumentation(javax.wsdl.Operation op, java.lang.String output)
op
- The javax.wsdl.Operation object representing the web service's operation that should be addedoutput
- A string representation of the object structure that may be returned by the web service's operation as provided by WSDLParser.getParameterDetails(String, QName, QName)private java.lang.String htmlDocumentation()
private java.lang.String parameterDictionary(javax.wsdl.Operation op, java.lang.String params)
op
- The javax.wsdl.Operation object representing a web service operationparams
- A string representation of the parameter structure that may be passed to the web service's operation as provided by WSDLParser.getParameterDetails(String, QName, QName)static java.lang.String keyVal(java.lang.String key, java.lang.String value, java.lang.String comment)
key
- The entry keyvalue
- The entry valuecomment
- An optional comment for the entrystatic void toFile(java.lang.String dirPath, java.lang.String filename, java.lang.String content)
dirPath
- The file system path to write tofilename
- The filename that should be usedcontent
- The content to write to the filestatic void addFilesToZip(java.io.File archive, java.io.File[] files, java.lang.String path)
archive
- The zip archive that should be written tofiles
- An array of file that should be copied to the zip archivepath
- The path inside the zip archive that the files should be written toprivate static boolean zipEntryMatch(java.lang.String zeName, java.io.File[] files, java.lang.String path)
zeName
- The filename (inside the zip archive) to checkfiles
- The file array that should be checked for equalitypath
- The zip archive path to search instatic java.lang.String getAdapterAddress()