org.apache.ws.resource.tool
Class Wsdl2Java

java.lang.Object
  extended byorg.apache.ws.resource.tool.Wsdl2Java

public class Wsdl2Java
extends java.lang.Object

Generates Java Web service types and skeletons from a WSRF WSDL. The types are generated as XMLBeans.

Author:
Ian Springer

Nested Class Summary
static class Wsdl2Java.Wsdl2JavaOptions
          DOCUMENT_ME
 
Field Summary
protected static org.apache.commons.cli.Options CMD_LINE_OPTIONS
          DOCUMENT_ME
protected static java.lang.String VELOCITY_CONTEXT_KEY_GENERATED
          DOCUMENT_ME
 
Constructor Summary
Wsdl2Java(java.io.File[] wsdlFiles, java.io.File outputDir, java.io.File[] classpathFiles, Wsdl2Java.Wsdl2JavaOptions options)
          Creates a new Wsdl2Java object.
 
Method Summary
protected  void addPortType2JavaInfo(PortType2JavaInfo ptInfo)
          DOCUMENT_ME
protected  org.apache.ws.resource.tool.velocity.ServiceProperties buildServiceProperties(ResourceDefinition resourceDef, java.io.File wsdlFile, java.io.File serviceDir)
          Builds the ServiceProperties object which is a javabean used for storing values which are passed to the VelocityContext for code generation.
 void generate()
          DOCUMENT_ME
 Wsdl2Java.Wsdl2JavaOptions getOptions()
          DOCUMENT_ME
 java.io.File getOutputDir()
          DOCUMENT_ME
protected  java.io.File getPackageDir(java.lang.String targetNamespace, java.io.File serviceDir)
          DOCUMENT_ME
protected  PortType2JavaInfo getPortType2JavaInfo(javax.xml.namespace.QName ptName)
          DOCUMENT_ME
protected  java.lang.String getValidJavaName(ResourceDefinition resourceDef)
          DOCUMENT_ME
protected  java.lang.String getWebbappName()
          DOCUMENT_ME
 java.io.File[] getWsdlFiles()
          DOCUMENT_ME
static void main(java.lang.String[] args)
          DOCUMENT_ME
protected  void processTemplate(org.apache.velocity.VelocityContext context, java.lang.String templateLocation, java.io.File outputFile)
           
protected  void processTemplates(ResourceDefinition resourceDef, java.io.File wsdlFile, java.io.File serviceDir)
           
protected  org.apache.velocity.VelocityContext updateVelocityContext(org.apache.velocity.VelocityContext context, ResourceDefinition resourceDef)
          Provides a hook for adding to the Velocity Context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CMD_LINE_OPTIONS

protected static final org.apache.commons.cli.Options CMD_LINE_OPTIONS
DOCUMENT_ME


VELOCITY_CONTEXT_KEY_GENERATED

protected static final java.lang.String VELOCITY_CONTEXT_KEY_GENERATED
DOCUMENT_ME

See Also:
Constant Field Values
Constructor Detail

Wsdl2Java

public Wsdl2Java(java.io.File[] wsdlFiles,
                 java.io.File outputDir,
                 java.io.File[] classpathFiles,
                 Wsdl2Java.Wsdl2JavaOptions options)
          throws java.lang.Exception
Creates a new Wsdl2Java object.

Parameters:
wsdlFiles - DOCUMENT_ME
outputDir - DOCUMENT_ME
classpathFiles -
options - DOCUMENT_ME
Method Detail

getOptions

public Wsdl2Java.Wsdl2JavaOptions getOptions()
DOCUMENT_ME

Returns:
DOCUMENT_ME

getOutputDir

public java.io.File getOutputDir()
DOCUMENT_ME

Returns:
DOCUMENT_ME

getWsdlFiles

public java.io.File[] getWsdlFiles()
DOCUMENT_ME

Returns:
DOCUMENT_ME

generate

public void generate()
              throws java.lang.Exception
DOCUMENT_ME

Throws:
java.lang.Exception - DOCUMENT_ME

main

public static void main(java.lang.String[] args)
                 throws org.apache.commons.cli.ParseException
DOCUMENT_ME

Parameters:
args - DOCUMENT_ME
Throws:
org.apache.commons.cli.ParseException - DOCUMENT_ME

getPackageDir

protected java.io.File getPackageDir(java.lang.String targetNamespace,
                                     java.io.File serviceDir)
DOCUMENT_ME

Parameters:
targetNamespace - DOCUMENT_ME
serviceDir - DOCUMENT_ME
Returns:
DOCUMENT_ME

getPortType2JavaInfo

protected PortType2JavaInfo getPortType2JavaInfo(javax.xml.namespace.QName ptName)
DOCUMENT_ME

Parameters:
ptName - DOCUMENT_ME
Returns:
DOCUMENT_ME

getValidJavaName

protected java.lang.String getValidJavaName(ResourceDefinition resourceDef)
DOCUMENT_ME

Parameters:
resourceDef - DOCUMENT_ME
Returns:
DOCUMENT_ME

getWebbappName

protected java.lang.String getWebbappName()
DOCUMENT_ME

Returns:
DOCUMENT_ME

addPortType2JavaInfo

protected void addPortType2JavaInfo(PortType2JavaInfo ptInfo)
DOCUMENT_ME

Parameters:
ptInfo - DOCUMENT_ME

buildServiceProperties

protected org.apache.ws.resource.tool.velocity.ServiceProperties buildServiceProperties(ResourceDefinition resourceDef,
                                                                                        java.io.File wsdlFile,
                                                                                        java.io.File serviceDir)
Builds the ServiceProperties object which is a javabean used for storing values which are passed to the VelocityContext for code generation.

Parameters:
resourceDef - The definition we are working on.
wsdlFile - The File representation of the wsdl file.
serviceDir - The File representation of the directory we are writing the service to.
Returns:
The ServiceProperties object.

processTemplate

protected void processTemplate(org.apache.velocity.VelocityContext context,
                               java.lang.String templateLocation,
                               java.io.File outputFile)
                        throws java.lang.Exception
Parameters:
context -
templateLocation -
outputFile -
Throws:
java.lang.Exception

processTemplates

protected void processTemplates(ResourceDefinition resourceDef,
                                java.io.File wsdlFile,
                                java.io.File serviceDir)
                         throws java.lang.Exception
Parameters:
resourceDef -
wsdlFile -
serviceDir -
Throws:
java.lang.Exception

updateVelocityContext

protected org.apache.velocity.VelocityContext updateVelocityContext(org.apache.velocity.VelocityContext context,
                                                                    ResourceDefinition resourceDef)
Provides a hook for adding to the Velocity Context.

Parameters:
context -
Returns:
VelocityContext


Copyright © 2004-2005 Apache Software Foundation. All Rights Reserved.