org.specrunner.source.namespace.core
Class NamespaceInfoDefault

java.lang.Object
  extended by org.specrunner.source.namespace.core.NamespaceInfoDefault
All Implemented Interfaces:
INamespaceInfo

public class NamespaceInfoDefault
extends Object
implements INamespaceInfo

Default namespace info extractor.

Author:
Thiago Santos.

Constructor Summary
NamespaceInfoDefault(Map<String,String> prefixToUri, Map<String,String> uriToPrefix, Map<String,nu.xom.XPathContext> prefixToContext, Map<String,nu.xom.XPathContext> uriToContext)
          Map of namespace information.
 
Method Summary
 nu.xom.XPathContext getByPrefix(String prefix)
          Get context by prefix.
 nu.xom.XPathContext getByURI(String uri)
          Get context by uri.
 String getPrefix(String uri)
          Get prefix by uri information.
 String getURI(String prefix)
          Get uri by prefix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamespaceInfoDefault

public NamespaceInfoDefault(Map<String,String> prefixToUri,
                            Map<String,String> uriToPrefix,
                            Map<String,nu.xom.XPathContext> prefixToContext,
                            Map<String,nu.xom.XPathContext> uriToContext)
Map of namespace information.

Parameters:
prefixToUri - Map from prefix to uri.
uriToPrefix - Map from uri to prefix.
prefixToContext - Map from prefix to context.
uriToContext - Map from uri to context.
Method Detail

getPrefix

public String getPrefix(String uri)
Description copied from interface: INamespaceInfo
Get prefix by uri information.

Specified by:
getPrefix in interface INamespaceInfo
Parameters:
uri - A uri.
Returns:
The prefix, if exists, null, otherwise.

getURI

public String getURI(String prefix)
Description copied from interface: INamespaceInfo
Get uri by prefix.

Specified by:
getURI in interface INamespaceInfo
Parameters:
prefix - A prefix.
Returns:
The uri, if exists, null, otherwise.

getByPrefix

public nu.xom.XPathContext getByPrefix(String prefix)
Description copied from interface: INamespaceInfo
Get context by prefix.

Specified by:
getByPrefix in interface INamespaceInfo
Parameters:
prefix - The prefix.
Returns:
The context, if exists, null, otherwise.

getByURI

public nu.xom.XPathContext getByURI(String uri)
Description copied from interface: INamespaceInfo
Get context by uri.

Specified by:
getByURI in interface INamespaceInfo
Parameters:
uri - The uri.
Returns:
The context, if exists, null, otherwise.


Copyright © 2014. All rights reserved.