org.apache.ws.java2wsdl
Class NamespaceMapping

java.lang.Object
  extended by org.apache.ws.java2wsdl.NamespaceMapping
All Implemented Interfaces:
Mapper

public class NamespaceMapping
extends Object
implements Mapper

Used for nested package definitions. The file format used for storing mappings is a list of package=namespace


Field Summary
static QName MAPPING
           
static String NAMESPACE
           
static String PACKAGE
           
static QName PKG2NS_MAPPINGS
           
 
Constructor Summary
NamespaceMapping()
          pass in the namespace to map to
 
Method Summary
 void execute(HashMap map, boolean packageIsKey)
          execute the mapping
 InputStream getMapInputStream()
           
 File getMappingFile()
           
 XMLStreamReader getXmlReader()
           
protected  void map(HashMap map, String packName, String nspace, boolean packageIsKey)
          map a namespace to a package
protected  void mapFile(HashMap map, boolean packageIsKey)
          Load a mapping file and save it to the map
protected  void mapXmlReader(HashMap map, boolean packageIsKey)
          Load a mapping xml reader and save it to the map
protected  void mapXmlStream(HashMap map, boolean packageIsKey)
          Load a mapping input stream and save it to the map
 void setFile(File file)
          name of a property file that contains mappings in package=namespace format
 void setMapInputStream(InputStream mapInputStream)
           
 void setMappingFile(File mappingFile)
           
 void setNamespace(String value)
          the namespace in the WSDL.
 void setPackage(String value)
          the Java package to bind to.
 void setXmlReader(XMLStreamReader xmlReader)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PKG2NS_MAPPINGS

public static final QName PKG2NS_MAPPINGS

MAPPING

public static final QName MAPPING

NAMESPACE

public static final String NAMESPACE
See Also:
Constant Field Values

PACKAGE

public static final String PACKAGE
See Also:
Constant Field Values
Constructor Detail

NamespaceMapping

public NamespaceMapping()
pass in the namespace to map to

Method Detail

setNamespace

public void setNamespace(String value)
the namespace in the WSDL. Required.

Parameters:
value - new uri of the mapping

setPackage

public void setPackage(String value)
the Java package to bind to. Required.

Parameters:
value - java package name

setFile

public void setFile(File file)
name of a property file that contains mappings in package=namespace format

Parameters:
file - file to load

map

protected void map(HashMap map,
                   String packName,
                   String nspace,
                   boolean packageIsKey)
map a namespace to a package

Parameters:
map - map to assign to
packName - package name
nspace - namespace
packageIsKey - if the package is to be the key for the map

mapXmlReader

protected void mapXmlReader(HashMap map,
                            boolean packageIsKey)
                     throws org.apache.tools.ant.BuildException
Load a mapping xml reader and save it to the map

Parameters:
map - target map file
packageIsKey - if the package is to be the key for the map
Throws:
org.apache.tools.ant.BuildException - if an IOException needed swallowing

mapXmlStream

protected void mapXmlStream(HashMap map,
                            boolean packageIsKey)
                     throws org.apache.tools.ant.BuildException
Load a mapping input stream and save it to the map

Parameters:
map - target map file
packageIsKey - if the package is to be the key for the map
Throws:
org.apache.tools.ant.BuildException - if an IOException needed swallowing

mapFile

protected void mapFile(HashMap map,
                       boolean packageIsKey)
                throws org.apache.tools.ant.BuildException
Load a mapping file and save it to the map

Parameters:
map - target map file
packageIsKey - if the package is to be the key for the map
Throws:
org.apache.tools.ant.BuildException - if an IOException needed swallowing

execute

public void execute(HashMap map,
                    boolean packageIsKey)
             throws org.apache.tools.ant.BuildException
execute the mapping

Specified by:
execute in interface Mapper
Parameters:
map - map to map to
packageIsKey - if the package is to be the key for the map
Throws:
org.apache.tools.ant.BuildException - in case of emergency

getMapInputStream

public InputStream getMapInputStream()

setMapInputStream

public void setMapInputStream(InputStream mapInputStream)

getMappingFile

public File getMappingFile()

setMappingFile

public void setMappingFile(File mappingFile)

getXmlReader

public XMLStreamReader getXmlReader()

setXmlReader

public void setXmlReader(XMLStreamReader xmlReader)


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.