javanet.staxutils
Class EmptyNamespaceContext

java.lang.Object
  extended by javanet.staxutils.EmptyNamespaceContext
All Implemented Interfaces:
ExtendedNamespaceContext, StaticNamespaceContext, NamespaceContext

public final class EmptyNamespaceContext
extends Object
implements ExtendedNamespaceContext, StaticNamespaceContext

ExtendedNamespaceContext that contains no namespaces.

Version:
$Revision: 1.2 $
Author:
Christian Niles

Field Summary
static EmptyNamespaceContext INSTANCE
           
 
Constructor Summary
EmptyNamespaceContext()
           
 
Method Summary
 Iterator getDeclaredPrefixes()
          Returns an Iterator of all namespace prefixes declared within this context, irrespective of any ancestor contexts.
static NamespaceContext getInstance()
           
 String getNamespaceURI(String prefix)
           
 NamespaceContext getParent()
          Returns a reference to the parent of this context.
 String getPrefix(String nsURI)
           
 Iterator getPrefixes()
          Returns an Iterator of all namespace prefixes in scope within this context, including those inherited from ancestor contexts.
 Iterator getPrefixes(String nsURI)
           
 boolean isPrefixDeclared(String prefix)
          Determines if the specified prefix is declared within this context, irrespective of any ancestor contexts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final EmptyNamespaceContext INSTANCE
Constructor Detail

EmptyNamespaceContext

public EmptyNamespaceContext()
Method Detail

getInstance

public static final NamespaceContext getInstance()

getNamespaceURI

public String getNamespaceURI(String prefix)
Specified by:
getNamespaceURI in interface NamespaceContext

getPrefix

public String getPrefix(String nsURI)
Specified by:
getPrefix in interface NamespaceContext

getPrefixes

public Iterator getPrefixes(String nsURI)
Specified by:
getPrefixes in interface NamespaceContext

getParent

public NamespaceContext getParent()
Description copied from interface: ExtendedNamespaceContext
Returns a reference to the parent of this context.

Specified by:
getParent in interface ExtendedNamespaceContext
Returns:
The parent context, or null if this is a root context.

isPrefixDeclared

public boolean isPrefixDeclared(String prefix)
Description copied from interface: ExtendedNamespaceContext
Determines if the specified prefix is declared within this context, irrespective of any ancestor contexts.

Specified by:
isPrefixDeclared in interface ExtendedNamespaceContext
Parameters:
prefix - The prefix to check.
Returns:
true if the prefix is declared in this context, false otherwise.

getPrefixes

public Iterator getPrefixes()
Description copied from interface: ExtendedNamespaceContext
Returns an Iterator of all namespace prefixes in scope within this context, including those inherited from ancestor contexts.

Specified by:
getPrefixes in interface ExtendedNamespaceContext
Returns:
An Iterator of prefix Strings.

getDeclaredPrefixes

public Iterator getDeclaredPrefixes()
Description copied from interface: ExtendedNamespaceContext
Returns an Iterator of all namespace prefixes declared within this context, irrespective of any ancestor contexts.

Specified by:
getDeclaredPrefixes in interface ExtendedNamespaceContext
Returns:
An Iterator of prefix Strings.