Class 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 the NamespaceContext interface.
    • Constructor Detail

      • NSContext

        public NSContext()
        Creates a new object.
      • NSContext

        public NSContext​(String prefix,
                         String uri)
        Creates a new context object and add one namespace to it.
        Parameters:
        prefix - the prefix of the namespace to add.
        uri - the namespace URI.
    • Method Detail

      • 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.
      • containsPair

        public boolean containsPair​(String prefix,
                                    String uri)
        Indicates if this context has a given namespace URI associated with a given prefix.
        Parameters:
        prefix - the prefix to look for.
        uri - the URI to look for.
        Returns:
        treu of the pair is in the context, false otherwise.