Package net.sf.okapi.lib.xliff2
Class NSContext
- java.lang.Object
-
- net.sf.okapi.lib.xliff2.NSContext
-
- All Implemented Interfaces:
Cloneable,NamespaceContext
public class NSContext extends Object implements NamespaceContext, Cloneable
Represents the context of the namespaces at a specific point during reading or writing of an XLIFF document. The namespaces http://www.w3.org/XML/1998/namespace and http://www.w3.org/2000/xmlns/ are pre-defined. This class implements theNamespaceContextinterface.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NSContextclone()booleancontainsPair(String prefix, String uri)Indicates if this context has a given namespace URI associated with a given prefix.StringgetNamespaceURI(String prefix)StringgetPrefix(String uri)Iterator<String>getPrefixes(String uri)voidput(String prefix, String uri)Sets a prefix/uri pair to this context.StringtoString()
-
-
-
Method Detail
-
getNamespaceURI
public String getNamespaceURI(String prefix)
- Specified by:
getNamespaceURIin interfaceNamespaceContext
-
getPrefix
public String getPrefix(String uri)
- Specified by:
getPrefixin interfaceNamespaceContext
-
getPrefixes
public Iterator<String> getPrefixes(String uri)
- Specified by:
getPrefixesin interfaceNamespaceContext
-
put
public void put(String prefix, String uri)
Sets a prefix/uri pair to this context. No checking is done for existing prefix: If the same is already defined, it will be overwritten.- Parameters:
prefix- the prefix of the namespace.uri- the URI of the namespace.
-
-