deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.framework.xml
Class NamespaceContext

java.lang.Object
  extended by org.deegree.framework.xml.NamespaceContext
All Implemented Interfaces:
org.jaxen.NamespaceContext

public class NamespaceContext
extends Object
implements org.jaxen.NamespaceContext

Implementation of Jaxen's (http://jaxen.codehaus.org) NamespaceContext interface.

NOTE: This should be used everywhere inside deegree, don't use org.jaxen.SimpleNamespaceContext -- this prevents unnecessary binding to Jaxen.

Version:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
Markus Schneider , last edited by: $Author: mschneider $

Constructor Summary
NamespaceContext()
          Creates a new instance of NamespaceContext with only the prefix 'xmlns:' being bound.
NamespaceContext(NamespaceContext nsContext)
          Creates a new instance of NamespaceContext that contains all the bindings from the argument NamespaceContext.
 
Method Summary
 void addAll(NamespaceContext nsc)
          registeres all prexifes and assigned namespaces from another NamespaceContext.
 void addNamespace(String prefix, URI namespace)
          registers a new prefix with an assigned namespace URI
 Map<String,URI> getNamespaceMap()
           
 URI getURI(String prefix)
           
 String toString()
           
 String translateNamespacePrefixToUri(String prefix)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NamespaceContext

public NamespaceContext()
Creates a new instance of NamespaceContext with only the prefix 'xmlns:' being bound.


NamespaceContext

public NamespaceContext(NamespaceContext nsContext)
Creates a new instance of NamespaceContext that contains all the bindings from the argument NamespaceContext.

Parameters:
nsContext - bindings to copy
Method Detail

getNamespaceMap

public Map<String,URI> getNamespaceMap()
Returns:
the namespace map of the context.

addNamespace

public void addNamespace(String prefix,
                         URI namespace)
registers a new prefix with an assigned namespace URI

Parameters:
prefix -
namespace -

addAll

public void addAll(NamespaceContext nsc)
registeres all prexifes and assigned namespaces from another NamespaceContext. If a prefix already exists in this NamespaceContext it will be ignored.

Parameters:
nsc -

translateNamespacePrefixToUri

public String translateNamespacePrefixToUri(String prefix)
Specified by:
translateNamespacePrefixToUri in interface org.jaxen.NamespaceContext

getURI

public URI getURI(String prefix)
Parameters:
prefix - to get the namespace for
Returns:
the URI (namespace) associated with the given prefix, or null if it was not found.

toString

public String toString()
Overrides:
toString in class Object

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org