org.deegree.commons.xml
Class NamespaceContext

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

public class NamespaceContext
extends java.lang.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: 24581 $, $Date: 2010-05-26 17:05:14 +0200 (Mi, 26. Mai 2010) $
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.
NamespaceContext(javax.xml.namespace.NamespaceContext nsContext)
          Creates a new instance of NamespaceContext that contains all the bindings from the argument NamespaceContext.
 
Method Summary
 NamespaceContext addNamespace(java.lang.String prefix, java.lang.String namespace)
          registers a new prefix with an assigned namespace URI
 java.lang.String getURI(java.lang.String prefix)
           
 java.lang.String toString()
           
 java.lang.String translateNamespacePrefixToUri(java.lang.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

NamespaceContext

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

Parameters:
nsContext - bindings to copy
Method Detail

addNamespace

public NamespaceContext addNamespace(java.lang.String prefix,
                                     java.lang.String namespace)
registers a new prefix with an assigned namespace URI

Parameters:
prefix -
namespace -
Returns:
this: new XPath(..., new NamespaceContext().addNamespace(...)

translateNamespacePrefixToUri

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

getURI

public java.lang.String getURI(java.lang.String prefix)
Parameters:
prefix -
Returns:
namespcae URI assigned to a prefix

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2011. All Rights Reserved.