org.apache.wsif.mapping
Class ParserMappingConvention
java.lang.Object
|
+--org.apache.wsif.mapping.ParserMappingConvention
- All Implemented Interfaces:
- WSIFMappingConvention
- public class ParserMappingConvention
- extends java.lang.Object
- implements WSIFMappingConvention
Implementation of WSIFMappingConvention
that matches the
convention used by the now deprecated getTypeMappings methods on
Parser
This convention works as follows:
- For all types, the package for the class is determined by in the following way:
Take the "hostname" part of the namespace uri. Reverse the components. Take the remainder
of the uri. Split it by the / character and rebuild with . between each component. At
all times strings are checked to make sure that they are valid Java names.
- Local parts of the xml name are converted to valid Java class names and appended to
the generated package name
- Class names for elements are appended with the string "Element"
So for example, the xml name
http://www.wsif.com/test/types:address
would map to
com.wsif.www.test.types.Address
- Author:
- Owen Burroughs
Method Summary |
java.lang.String |
getClassNameForComplexType(javax.xml.namespace.QName qn)
Get a class name for a complexType |
java.lang.String |
getClassNameForElementType(javax.xml.namespace.QName qn)
Get a class name for a global element |
java.lang.String |
getClassNameForSimpleType(javax.xml.namespace.QName qn)
Get a class name for a simpleType |
void |
overridePackageMapping(java.lang.String namespace,
java.lang.String packageName)
Override the mapping from a namespace to a package name for a specific
namespace |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ParserMappingConvention
public ParserMappingConvention()
getClassNameForComplexType
public java.lang.String getClassNameForComplexType(javax.xml.namespace.QName qn)
- Description copied from interface:
WSIFMappingConvention
- Get a class name for a complexType
- Specified by:
getClassNameForComplexType
in interface WSIFMappingConvention
- See Also:
WSIFMappingConvention.getClassNameForComplexType(QName)
getClassNameForSimpleType
public java.lang.String getClassNameForSimpleType(javax.xml.namespace.QName qn)
- Description copied from interface:
WSIFMappingConvention
- Get a class name for a simpleType
- Specified by:
getClassNameForSimpleType
in interface WSIFMappingConvention
- See Also:
WSIFMappingConvention.getClassNameForSimpleType(QName)
getClassNameForElementType
public java.lang.String getClassNameForElementType(javax.xml.namespace.QName qn)
- Description copied from interface:
WSIFMappingConvention
- Get a class name for a global element
- Specified by:
getClassNameForElementType
in interface WSIFMappingConvention
- See Also:
WSIFMappingConvention.getClassNameForElementType(QName)
overridePackageMapping
public void overridePackageMapping(java.lang.String namespace,
java.lang.String packageName)
- Description copied from interface:
WSIFMappingConvention
- Override the mapping from a namespace to a package name for a specific
namespace
- Specified by:
overridePackageMapping
in interface WSIFMappingConvention
- See Also:
WSIFMappingConvention.overridePackageMapping(String, String)
Copyright © 2002, 2003 Apache XML Project. All Rights Reserved.