org.jibx.ws.wsdl.tools
Class Jibx2Wsdl

java.lang.Object
  extended by org.jibx.ws.wsdl.tools.Jibx2Wsdl

public class Jibx2Wsdl
extends java.lang.Object

Start-from-code WSDL generator using JiBX data binding. This starts from one or more service classes, each with one or more methods to be exposed as service operations, and generates complete bindings and WSDL for the services.

Author:
Dennis M. Sosnoski

Field Summary
private  BindGen m_bindingGenerator
          Binding generator.
private  java.util.Map m_classInstances
          Map from class name to instance.
private  java.util.Map m_classTypeMap
          Map from fully qualified class name to schema type name.
private  WsdlGeneratorCommandLine m_generationParameters
          Parameter information for generation.
private  SchemaGen m_schemaGenerator
          Schema generator.
private  java.util.Map m_uriSchemaMap
          Map from schema namespace URIs to schema holders.
 
Constructor Summary
private Jibx2Wsdl(WsdlGeneratorCommandLine parms)
          Constructor.
 
Method Summary
private  void accumulateData(ValueCustom value, java.util.Set dataset)
          Accumulate data type(s) from value to be included in binding.
 QName addCollectionBinding(ValueCustom value, java.util.Map typemap, BindingHolder bind)
          Add the <mapping> definition for a typed collection to a binding.
private  void addSchemaReference(ElementElement elem, SchemaHolder holder)
          Add reference defined by element to schema.
private  ElementElement buildValueElement(ValueCustom parm, java.util.Map typemap, SchemaHolder hold)
          Build an element representing a parameter or return value.
private  Definitions buildWSDL(ServiceCustom service, java.util.Map typemap)
          Build WSDL for service.
private  java.util.List generate(java.util.List classes, java.util.List extras)
          Generate based on list of service classes.
private  QName getMappingQName(java.lang.String type, MappingElement mapping)
          Get the qualified name used for an abstract mapping.
static void main(java.lang.String[] args)
          Run the WSDL generation using command line parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_generationParameters

private final WsdlGeneratorCommandLine m_generationParameters
Parameter information for generation.


m_bindingGenerator

private final BindGen m_bindingGenerator
Binding generator.


m_schemaGenerator

private final SchemaGen m_schemaGenerator
Schema generator.


m_uriSchemaMap

private final java.util.Map m_uriSchemaMap
Map from schema namespace URIs to schema holders.


m_classTypeMap

private java.util.Map m_classTypeMap
Map from fully qualified class name to schema type name.


m_classInstances

private final java.util.Map m_classInstances
Map from class name to instance. This is used to keep track of JavaDoc formatter instances.

Constructor Detail

Jibx2Wsdl

private Jibx2Wsdl(WsdlGeneratorCommandLine parms)
Constructor.

Parameters:
parms - generation parameters
Method Detail

getMappingQName

private QName getMappingQName(java.lang.String type,
                              MappingElement mapping)
Get the qualified name used for an abstract mapping. This throws an exception if the qualified name is not found.

Parameters:
type -
mapping -
Returns:
qualified name

buildValueElement

private ElementElement buildValueElement(ValueCustom parm,
                                         java.util.Map typemap,
                                         SchemaHolder hold)
Build an element representing a parameter or return value.

Parameters:
parm -
typemap - map from parameterized type to abstract mapping name
hold - containing schema holder
Returns:
constructed element

addSchemaReference

private void addSchemaReference(ElementElement elem,
                                SchemaHolder holder)
Add reference defined by element to schema. This finds the namespace of the type or element reference used by the provided element, and adds that namespace to the schema references.

Parameters:
elem -
holder -

buildWSDL

private Definitions buildWSDL(ServiceCustom service,
                              java.util.Map typemap)
Build WSDL for service.

Parameters:
service -
typemap - map from parameterized type to abstract mapping name
Returns:
constructed WSDL definitions

accumulateData

private void accumulateData(ValueCustom value,
                            java.util.Set dataset)
Accumulate data type(s) from value to be included in binding.

Parameters:
value -
dataset - set of types for binding

addCollectionBinding

public QName addCollectionBinding(ValueCustom value,
                                  java.util.Map typemap,
                                  BindingHolder bind)
Add the <mapping> definition for a typed collection to a binding. This always creates an abstract mapping with the type name based on both the item type and the collection type.

Parameters:
value - collection value
typemap - map from parameterized type to abstract mapping name
bind - target binding
Returns:
qualified name for collection

generate

private java.util.List generate(java.util.List classes,
                                java.util.List extras)
                         throws JiBXException,
                                java.io.IOException
Generate based on list of service classes.

Parameters:
classes - service class list
extras - list of extra classes for binding
Returns:
list of WSDLs
Throws:
JiBXException
java.io.IOException

main

public static void main(java.lang.String[] args)
                 throws JiBXException,
                        java.io.IOException
Run the WSDL generation using command line parameters.

Parameters:
args -
Throws:
JiBXException
java.io.IOException


Project Web Site