325N/A/*
325N/A * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
325N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
325N/A *
325N/A * This code is free software; you can redistribute it and/or modify it
325N/A * under the terms of the GNU General Public License version 2 only, as
325N/A * published by the Free Software Foundation. Oracle designates this
325N/A * particular file as subject to the "Classpath" exception as provided
325N/A * by Oracle in the LICENSE file that accompanied this code.
325N/A *
325N/A * This code is distributed in the hope that it will be useful, but WITHOUT
325N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
325N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
325N/A * version 2 for more details (a copy is included in the LICENSE file that
325N/A * accompanied this code).
325N/A *
325N/A * You should have received a copy of the GNU General Public License version
325N/A * 2 along with this work; if not, write to the Free Software Foundation,
325N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
325N/A *
325N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
325N/A * or visit www.oracle.com if you need additional information or have any
325N/A * questions.
325N/A */
325N/A
325N/Apackage com.sun.xml.internal.org.jvnet.staxex;
325N/A
325N/Aimport javax.xml.namespace.NamespaceContext;
325N/Aimport java.util.Iterator;
325N/A
325N/A/**
325N/A * Extended {@link NamespaceContext}.
325N/A *
325N/A * @author Kohsuke Kawaguchi
325N/A * @author Paul Sandoz
325N/A */
325N/Apublic interface NamespaceContextEx extends NamespaceContext, Iterable<NamespaceContextEx.Binding> {
325N/A
325N/A /**
325N/A * Iterates all the in-scope namespace bindings.
325N/A *
325N/A * <p>
325N/A * This method enumerates all the active in-scope namespace bindings.
325N/A * This does not include implicit bindings, such as
325N/A * <tt>"xml"->"http://www.w3.org/XML/1998/namespace"</tt>
325N/A * or <tt>""->""</tt> (the implicit default namespace URI.)
325N/A *
325N/A * <p>
325N/A * The returned iterator may not include the same prefix more than once.
325N/A * For example, the returned iterator may only contain <tt>f=ns2</tt>
325N/A * if the document is as follows and this method is used at the bar element.
325N/A *
325N/A * <pre><xmp>
325N/A * <foo xmlns:f='ns1'>
325N/A * <bar xmlns:f='ns2'>
325N/A * ...
325N/A * </xmp></pre>
325N/A *
325N/A * <p>
325N/A * The iteration may be done in no particular order.
325N/A *
325N/A * @return
325N/A * may return an empty iterator, but never null.
325N/A */
325N/A Iterator<Binding> iterator();
325N/A
325N/A /**
325N/A * Prefix to namespace URI binding.
325N/A */
325N/A interface Binding {
325N/A /**
325N/A * Gets the prefix.
325N/A *
325N/A * <p>
325N/A * The default namespace URI is represented by using an
325N/A * empty string "", not null.
325N/A *
325N/A * @return
325N/A * never null. String like "foo", "ns12", or "".
325N/A */
325N/A String getPrefix();
325N/A
325N/A /**
325N/A * Gets the namespace URI.
325N/A *
325N/A * <p>
325N/A * The empty namespace URI is represented by using
325N/A * an empty string "", not null.
325N/A *
325N/A * @return
325N/A * never null. String like "http://www.w3.org/XML/1998/namespace",
325N/A * "urn:oasis:names:specification:docbook:dtd:xml:4.1.2", or "".
325N/A */
325N/A String getNamespaceURI();
325N/A }
325N/A}