org.jbind.xml.parser
Interface INamespaceContext

All Known Implementing Classes:
NamespaceContext

public interface INamespaceContext

Supports the tracking of nested namespace contexts according the namespace 1.1 declaration. A newly created namespace context knows from the very beginning already two prefix declarations:

  1. The empty string is mapped to the empty string.
  2. The string &qout;xml&qout; is mapped to the namespace "http://www.w3.org/XML/1998/namespace".


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.
 

Method Detail

pushContext

public void pushContext(java.util.Collection aPrefixDeclarations)
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).

Parameters:
aPrefixDeclarations - (optional). A collection of PrefixDeclaration.

popContext

public void popContext()
Ends the current context.


getCurrentMapping

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

Returns:
(required). Maps prefixes (strings) to namespaces (strings)

getAddedPrefixDeclarations

public java.util.Collection getAddedPrefixDeclarations()
Gets the prefix declarations that were added when the current context was pushed.

Returns:
(required). A collection of PrefixDeclaration.