org.jbind.xml.parser
Class NamespaceContext

java.lang.Object
  extended byorg.jbind.xml.parser.NamespaceContext
All Implemented Interfaces:
INamespaceContext

public class NamespaceContext
extends java.lang.Object
implements INamespaceContext


Constructor Summary
NamespaceContext()
           
 
Method Summary
 java.util.Collection getAddedPrefixDeclarations()
          Gets the prefix declarations that were added when the current context was pushed.
 java.util.Map getCurrentMapping()
          Gets the prefix to namespace mapping of the current context.
 void popContext()
          Ends the current context.
 void pushContext(java.util.Collection aPrefixDeclarations)
          Starts a new context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamespaceContext

public NamespaceContext()
Method Detail

getCurrentMapping

public java.util.Map getCurrentMapping()
Description copied from interface: INamespaceContext
Gets the prefix to namespace mapping of the current context. The map returned is independent of the maps of other contexts.

Specified by:
getCurrentMapping in interface INamespaceContext
Returns:
(required). Maps prefixes (strings) to namespaces (strings)

getAddedPrefixDeclarations

public java.util.Collection getAddedPrefixDeclarations()
Description copied from interface: INamespaceContext
Gets the prefix declarations that were added when the current context was pushed.

Specified by:
getAddedPrefixDeclarations in interface INamespaceContext
Returns:
(required). A collection of PrefixDeclaration.

popContext

public void popContext()
Description copied from interface: INamespaceContext
Ends the current context.

Specified by:
popContext in interface INamespaceContext

pushContext

public void pushContext(java.util.Collection aPrefixDeclarations)
Description copied from interface: INamespaceContext
Starts a new context. All prefix declarations of the previous context are copied. The prefix declarations supplied with this context are added. If an added prefix declaration has the same prefix as a copied one then the added one overwrites the copied one.

If an added prefix declaration has the empty string as its namespace then the prefix declaration for that prefix is removed if the prefix itself is not an empty string (cf. the namespace 1.1 specification). A prefix declaration in which the namespace and the prefix are empty strings is treated like a normal prefix declaration. In other words, the empty string prefix is mapped to the empty string namespace (like it is in a newly created namespace context).

Specified by:
pushContext in interface INamespaceContext
Parameters:
aPrefixDeclarations - (optional). A collection of PrefixDeclaration.