net.shibboleth.metadata.dom
Class SimpleNamespaceContext

java.lang.Object
  extended by net.shibboleth.metadata.dom.SimpleNamespaceContext
All Implemented Interfaces:
NamespaceContext

@ThreadSafe
public class SimpleNamespaceContext
extends Object
implements NamespaceContext

Simple implementation of NamespaceContext based on a map from prefix values to corresponding URIs. This is not a complete implementation, but does have enough functionality for use within XPath evaluations.


Field Summary
private  Map<String,String> prefixMappings
          Mapping from prefix values to the corresponding namespace URIs.
 
Constructor Summary
SimpleNamespaceContext()
          Constructor.
SimpleNamespaceContext(Map<String,String> mappings)
          Constructor.
 
Method Summary
 String getNamespaceURI(String prefix)
          
 String getPrefix(String namespaceURI)
          
 Iterator<String> getPrefixes(String namespaceURI)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prefixMappings

private final Map<String,String> prefixMappings
Mapping from prefix values to the corresponding namespace URIs.

Constructor Detail

SimpleNamespaceContext

public SimpleNamespaceContext()
Constructor.


SimpleNamespaceContext

public SimpleNamespaceContext(Map<String,String> mappings)
Constructor.

Parameters:
mappings - Maps prefix values to the corresponding namespace URIs.
Method Detail

getNamespaceURI

public String getNamespaceURI(String prefix)

Specified by:
getNamespaceURI in interface NamespaceContext

getPrefix

public String getPrefix(String namespaceURI)

Specified by:
getPrefix in interface NamespaceContext

getPrefixes

public Iterator<String> getPrefixes(String namespaceURI)

Specified by:
getPrefixes in interface NamespaceContext


Copyright © 2009-2011. All Rights Reserved.