public class NamespaceHandling
extends java.lang.Object
UnmarshalHandler
to handle name spaces. It
manages a stack of name spaces, keeps track of when an new name space scope
is needed and maps name space URIs to package names.Constructor | Description |
---|---|
NamespaceHandling() |
Modifier and Type | Method | Description |
---|---|---|
void |
addDefaultNamespace(java.lang.String namespaceURI) |
Binds the namespaceURI to the default namespace.
|
void |
addNamespace(java.lang.String prefix,
java.lang.String namespaceURI) |
Binds the namespaceURI to the prefix
|
void |
addNamespaceToPackageMapping(java.lang.String nsURI,
java.lang.String packageName) |
Adds a mapping from the given namespace URI to the given package name.
|
void |
createNamespace() |
Creates a new name space.
|
java.lang.String |
getDefaultNamespaceURI() |
Gets the namespace URI that is bound to the default name space.
|
java.lang.String |
getMappedPackage(java.lang.String namespace) |
Looks up the package name from the given namespace URI.
|
Namespaces |
getNamespaceContext() |
Returns the current name space context.
|
java.lang.String |
getNamespacePrefix(java.lang.String namespaceURI) |
Gets the prefix that is bound to a namespaceURI.
|
java.lang.String |
getNamespaceURI(java.lang.String prefix) |
Gets the namespaceURI that is bound to a prefix.
|
boolean |
isNewNamespaceScopeNecessary() |
Indicates whether a new name space scope is needed.
|
void |
processNamespaces(XMLClassDescriptor classDesc,
java.lang.Object object) |
Saves local namespace declarations to the object model if necessary.
|
void |
removeCurrentNamespaceInstance() |
Pops the current namespace instance
|
java.lang.Object |
resolveNamespace(java.lang.Object value) |
Extracts the prefix and resolves it to it's associated namespace.
|
void |
startNamespaceScope() |
Starts a new name space scope, and resets the corresponding flag.
|
void |
stopNamespaceScope() |
Stops a name space scope, and resets the corresponding flag to false.
|
public void addNamespaceToPackageMapping(java.lang.String nsURI, java.lang.String packageName)
nsURI
- the namespace URI to map from.packageName
- the package name to map to.public java.lang.String getMappedPackage(java.lang.String namespace)
namespace
- the namespace URI to lookuppublic void processNamespaces(XMLClassDescriptor classDesc, java.lang.Object object)
classDesc
- the current ClassDescriptor.object
- the Object of the current statepublic java.lang.Object resolveNamespace(java.lang.Object value) throws org.xml.sax.SAXException
value
- the QName to resolve.org.xml.sax.SAXException
- if the nammespace associated with the prefix is nullpublic void removeCurrentNamespaceInstance()
public void addDefaultNamespace(java.lang.String namespaceURI)
namespaceURI
- Namespace URIpublic void addNamespace(java.lang.String prefix, java.lang.String namespaceURI)
prefix
- XML name space prefixnamespaceURI
- XML name space URI.public java.lang.String getNamespacePrefix(java.lang.String namespaceURI)
namespaceURI
- the namespaceURI to get the prefix frompublic java.lang.String getNamespaceURI(java.lang.String prefix)
prefix
- the prefix to get the namespaceURI frompublic java.lang.String getDefaultNamespaceURI()
public void createNamespace()
public Namespaces getNamespaceContext()
public boolean isNewNamespaceScopeNecessary()
public void startNamespaceScope()
public void stopNamespaceScope()
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com