org.idoox.xml
Interface TokenizerWrapper.TokenizerState

All Known Implementing Classes:
TokenizerWrapper.DefaultTokenizerState
Enclosing interface:
TokenizerWrapper

public static interface TokenizerWrapper.TokenizerState

This interface represents internal state of TokenizerWrapper. This state is used by TokenizerWrapper to implement functions inherited from Tokenizer interface. TokenzierWrapper provides implementation of this interface (DefaultTokenizerState) but you can implement this interface in a different way. You can manipulate internal state of TokenzierWrapper with TokenizerWrapper.getCurrentState() and TokenizerWrapper.setCurrentState(org.idoox.xml.TokenizerWrapper.TokenizerState) methods. It is also possible to use 'shortcut' functions declared directly on TokenizerWrapper (e.g. TokenizerWrapper.setCurrentToken(org.idoox.xml.Token)). It could be more efficient to provide your own implementation because you can provide a 'lazy implementation' which computes things when they are really needed (e.g. the array of new prefixes).

Since:
4.6
See Also:
DefaultTokenizerState

Method Summary
 java.lang.String getContent()
          Returns content which is used by TokenizerWrapper to implement Tokenizer.readContent().
Note that this function is used only if type of token returned by getToken() is Tokenizer.CONTENT.
 java.util.Map getNamespaceDeclarations()
          Returns map of namespace prefixes (mapping from prefixes to namespace URIs).
 java.util.Map getNewNamespaceDeclarations()
          Returns map of newly declared namespace prefixes (complete mapping is defined by prefix map of underlying tokenizer and this map).
 java.lang.String[] getNewPrefixes()
          Returns array of newly declared prefixes.
 Token getToken()
          Returns token which will be used by TokenizerWrapper to implement functions of Tokenizer (e.g.
 

Method Detail

getToken

public Token getToken()
Returns token which will be used by TokenizerWrapper to implement functions of Tokenizer (e.g. Tokenizer.readToken(org.idoox.xml.Token), Tokenizer.getLocalName(), ...).

Returns:
token

getContent

public java.lang.String getContent()
Returns content which is used by TokenizerWrapper to implement Tokenizer.readContent().
Note that this function is used only if type of token returned by getToken() is Tokenizer.CONTENT.

Returns:
content of "content token"

getNamespaceDeclarations

public java.util.Map getNamespaceDeclarations()
Returns map of namespace prefixes (mapping from prefixes to namespace URIs). If this function returns non-null it will overide mapping declared by underlying tokenizer and also getNewPrefixes() must be defined.

Returns:
map of namespace prefixes (mapping from prefixes to namespace URIs)

getNewNamespaceDeclarations

public java.util.Map getNewNamespaceDeclarations()
Returns map of newly declared namespace prefixes (complete mapping is defined by prefix map of underlying tokenizer and this map). If this function returns non-null it getNewPrefixes() function won't be used.

Returns:
map of newly declared namespace prefixes

getNewPrefixes

public java.lang.String[] getNewPrefixes()
Returns array of newly declared prefixes. If this getNamespaceDeclarations() returns non-null this function must return array of prefixes which are newly declared (were not declared on the start token of the parent element).

Returns:
array of newly declared prefixes