org.apache.muse.tools.generator
Class Wsdl2Java

java.lang.Object
  extended by org.apache.muse.tools.generator.util.AbstractCommandLineApp
      extended by org.apache.muse.tools.generator.Wsdl2Java
All Implemented Interfaces:
Wsdl2JavaConstants

public class Wsdl2Java
extends AbstractCommandLineApp
implements Wsdl2JavaConstants

Wsdl2Java is a command-line utility that takes a WSDL descriptor and generates all the code, project and deployment files you need to actualize a managability endpoint.

Author:
Andrew Eberbach (aeberbac)

Field Summary
 
Fields inherited from class org.apache.muse.tools.generator.util.AbstractCommandLineApp
_logger, PATH_TO_POM_PROPERTIES, TOP_LEVEL_PACKAGE, VERSION_PROPERTY
 
Fields inherited from interface org.apache.muse.tools.generator.Wsdl2JavaConstants
ANALYZER_FLAG, AXIS2_TYPE, BASE_DESCRIPTOR_FLAG, DESCRIPTOR_FLAG, HEADERS_FLAG, HELP_ADVANCED_FLAG, HELP_FLAG, J2EE_FLAG, MINI_TYPE, MUSE_BASE_DESCRIPTOR, OSGI_FLAG, OUTPUT_FLAG, OVERWRITE_FLAG, PROJECTIZER_FLAG, PROXY_FLAG, QUIET_FLAG, SYNTHESIZER_FLAG, VERBOSE_FLAG, VERSION_FLAG, WSDL_DEFINITION_FLAG
 
Constructor Summary
Wsdl2Java(File wsdlFile)
          Simplest constructor.
Wsdl2Java(File wsdlFile, boolean overwrite)
          Same as the WSDL-only constructor except that here we can specify if we want to overwrite existing files.
Wsdl2Java(File wsdlFile, File descriptorFile, boolean overwrite, boolean generateCustomHeaders, File targetDirectory)
          Specify all three: WSDL file, Muse descriptor and overwrite boolean.
 
Method Summary
 ConfigurationData getConfigurationData()
          Get the current configuration data that is first passed to the analyzer phase.
static void main(String[] args)
          Venerable main method.
 void run()
          Generate code using the analyser, synthesizer and projectizer.
 void setAnalyzer(Analyzer analyzer)
          Sets the analyzer to use during code generation.
 void setProjectizer(Projectizer projectizer)
          Sets the projectizer to use during code generation.
 void setSynthesizer(Synthesizer synthesizer)
          Sets the synthesizer to use during code generation.
 
Methods inherited from class org.apache.muse.tools.generator.util.AbstractCommandLineApp
checkOverwriteArg, checkParentDirectory, createLogger, getFiller, getMetadataDescriptor, getMetadataDescriptor, getMetadataDescriptors, getVersion, getWSDLDocument, getWSDLDocuments, handleErrorAndExit, handleErrorAndExit, handleExit, handleMessage, hasNoArguments
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Wsdl2Java

public Wsdl2Java(File wsdlFile)
          throws Exception
Simplest constructor. Takes a WSDL file. Assumes that we should use a default Muse descriptor (which can be dumped out) and that existing files should NOT be overwritten.

Parameters:
wsdlFile - The WSDL file to analyze.
Throws:
Exception

Wsdl2Java

public Wsdl2Java(File wsdlFile,
                 boolean overwrite)
          throws Exception
Same as the WSDL-only constructor except that here we can specify if we want to overwrite existing files. Also uses the built-in Muse skeleton descriptor.

Parameters:
wsdlFile - The WSDL file to analyze.
overwrite - Whether or not to overwrite existing files.
Throws:
Exception

Wsdl2Java

public Wsdl2Java(File wsdlFile,
                 File descriptorFile,
                 boolean overwrite,
                 boolean generateCustomHeaders,
                 File targetDirectory)
          throws Exception
Specify all three: WSDL file, Muse descriptor and overwrite boolean. The Muse descriptor can be null.

Parameters:
wsdlFile - The WSDL file to analyze.
descriptorFile - The Muse descriptor (can be null).
overwrite - Whether or not to overwrite existing files.
generateCustomHeaders -
Throws:
Exception
Method Detail

run

public void run()
         throws Exception
Generate code using the analyser, synthesizer and projectizer. If any one of the three are null they are initialized here to default values.

Throws:
Exception - If anything goes wrong during code generation.

setAnalyzer

public void setAnalyzer(Analyzer analyzer)
Sets the analyzer to use during code generation.

Parameters:
analyzer -

setProjectizer

public void setProjectizer(Projectizer projectizer)
Sets the projectizer to use during code generation.

Parameters:
projectizer -

setSynthesizer

public void setSynthesizer(Synthesizer synthesizer)
Sets the synthesizer to use during code generation.

Parameters:
synthesizer -

getConfigurationData

public ConfigurationData getConfigurationData()
Get the current configuration data that is first passed to the analyzer phase. The Wsdl2Java constructor creates one of these so that normal users of this class don't have to worry about initializing it correctly. However, this method allows users to get the configuration data and add custom parameters to it before calling run().

Returns:
Current configuration data

main

public static void main(String[] args)
Venerable main method. We check all command line parameters and initialize a Wsdl2Java object before running it. If anything goes wrong we abort the program after printing a (hopefully) useful error message. This is meant to be called from the command line, you can also just instantiate this class with the above constructors and then call run()

Parameters:
args - Command line parameters
See Also:
run()


Copyright © 2005-2011 Apache Web Services - Muse. All Rights Reserved.