< prev index next >

src/java.xml.bind/share/classes/com/sun/xml/internal/org/jvnet/staxex/NamespaceContextEx.java

Print this page




  25 
  26 package com.sun.xml.internal.org.jvnet.staxex;
  27 
  28 import javax.xml.namespace.NamespaceContext;
  29 import java.util.Iterator;
  30 
  31 /**
  32  * Extended {@link NamespaceContext}.
  33  *
  34  * @author Kohsuke Kawaguchi
  35  * @author Paul Sandoz
  36  */
  37 public interface NamespaceContextEx extends NamespaceContext, Iterable<NamespaceContextEx.Binding> {
  38 
  39     /**
  40      * Iterates all the in-scope namespace bindings.
  41      *
  42      * <p>
  43      * This method enumerates all the active in-scope namespace bindings.
  44      * This does not include implicit bindings, such as
  45      * <tt>"xml"->"http://www.w3.org/XML/1998/namespace"</tt>
  46      * or <tt>""->""</tt> (the implicit default namespace URI.)
  47      *
  48      * <p>
  49      * The returned iterator may not include the same prefix more than once.
  50      * For example, the returned iterator may only contain <tt>f=ns2</tt>
  51      * if the document is as follows and this method is used at the bar element.
  52      *
  53      * <pre><xmp>
  54      * <foo xmlns:f='ns1'>
  55      *   <bar xmlns:f='ns2'>
  56      *     ...
  57      * </xmp></pre>
  58      *
  59      * <p>
  60      * The iteration may be done in no particular order.
  61      *
  62      * @return
  63      *      may return an empty iterator, but never null.
  64      */
  65     Iterator<Binding> iterator();
  66 
  67     /**
  68      * Prefix to namespace URI binding.
  69      */
  70     interface Binding {
  71         /**
  72          * Gets the prefix.
  73          *
  74          * <p>
  75          * The default namespace URI is represented by using an
  76          * empty string "", not null.
  77          *


  25 
  26 package com.sun.xml.internal.org.jvnet.staxex;
  27 
  28 import javax.xml.namespace.NamespaceContext;
  29 import java.util.Iterator;
  30 
  31 /**
  32  * Extended {@link NamespaceContext}.
  33  *
  34  * @author Kohsuke Kawaguchi
  35  * @author Paul Sandoz
  36  */
  37 public interface NamespaceContextEx extends NamespaceContext, Iterable<NamespaceContextEx.Binding> {
  38 
  39     /**
  40      * Iterates all the in-scope namespace bindings.
  41      *
  42      * <p>
  43      * This method enumerates all the active in-scope namespace bindings.
  44      * This does not include implicit bindings, such as
  45      * {@code "xml"->"http://www.w3.org/XML/1998/namespace"}
  46      * or {@code ""->""} (the implicit default namespace URI.)
  47      *
  48      * <p>
  49      * The returned iterator may not include the same prefix more than once.
  50      * For example, the returned iterator may only contain {@code f=ns2}
  51      * if the document is as follows and this method is used at the bar element.
  52      *
  53      * <pre>{@code
  54      * <foo xmlns:f='ns1'>
  55      *   <bar xmlns:f='ns2'>
  56      *     ...
  57      * }</pre>
  58      *
  59      * <p>
  60      * The iteration may be done in no particular order.
  61      *
  62      * @return
  63      *      may return an empty iterator, but never null.
  64      */
  65     Iterator<Binding> iterator();
  66 
  67     /**
  68      * Prefix to namespace URI binding.
  69      */
  70     interface Binding {
  71         /**
  72          * Gets the prefix.
  73          *
  74          * <p>
  75          * The default namespace URI is represented by using an
  76          * empty string "", not null.
  77          *
< prev index next >