|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.idoox.xml.TokenizerWrapper.DefaultTokenizerState
This is default implementation of internal tokenizers state.
You can manipulate internal state of TokenzierWrapper
with TokenizerWrapper.getCurrentState() and
TokenizerWrapper.setCurrentState(org.idoox.xml.TokenizerWrapper.TokenizerState) methods.
TokenizerState| Constructor Summary | |
TokenizerWrapper.DefaultTokenizerState()
Constructs empty tokenizer state. |
|
TokenizerWrapper.DefaultTokenizerState(java.lang.String content)
Constructs tokenizer state with specified content. |
|
TokenizerWrapper.DefaultTokenizerState(Token currentToken)
Constructs tokenizer state with specified token. |
|
TokenizerWrapper.DefaultTokenizerState(Token currentToken,
java.util.Map newNamespaceDeclarations)
Constructs tokenizer state with specified token and new namespace declarations. |
|
TokenizerWrapper.DefaultTokenizerState(Token currentToken,
java.util.Map namespaceDeclarations,
java.lang.String[] newPrefixes)
Constructs tokenizer state with specified token and namespace declarations. |
|
| 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. |
void |
setContent(java.lang.String content)
|
void |
setNamespaceDeclarations(java.util.Map namespaceDeclarations)
|
void |
setNewPrefixes(java.lang.String[] newPrefixes)
|
void |
setToken(Token currentToken)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public TokenizerWrapper.DefaultTokenizerState()
public TokenizerWrapper.DefaultTokenizerState(Token currentToken)
Tokenizer.START_TOKEN
and Tokenizer.END_TOKEN of the underlying tokenizer.
Namespaces are not affected (namespace declarations are used from
underlying tokenizer).
This function is useful if user wants to change name or namespace
of some element.
currentToken - token which overrides token returned by underlying tokenzierpublic TokenizerWrapper.DefaultTokenizerState(java.lang.String content)
Tokenizer.CONTENT token
of the underlying tokenizer.
This function is useful if user wants to change content of some element.
content - content which overrides token returned by underlying tokenzier
public TokenizerWrapper.DefaultTokenizerState(Token currentToken,
java.util.Map newNamespaceDeclarations)
Tokenizer.START_TOKEN
and Tokenizer.END_TOKEN of the underlying tokenizer and
add declarations of namespaces.
Namespaces declared by underlying tokenizer are updated with
new namespace declarations specified.
This function is useful if user wants to change name or namespace
of some element and add declarations of namespaces.
currentToken - token which overrides token returned by underlying tokenziernewNamespaceDeclarations - new namespace declarations
public TokenizerWrapper.DefaultTokenizerState(Token currentToken,
java.util.Map namespaceDeclarations,
java.lang.String[] newPrefixes)
Tokenizer.START_TOKEN
and Tokenizer.END_TOKEN of the underlying tokenizer and
override declarations of namespaces.
Namespaces declared by underlying tokenizer are overrided with
namespace declarations specified.
This function is useful if user wants to change name or namespace
of some element and override declarations of namespaces.
currentToken - token which overrides token returned by underlying tokenziernamespaceDeclarations - new namespace declarationsnewPrefixes - array of newly defined prefixes (that were
not defined on the Tokenizer.START_TOKEN
of parent element)| Method Detail |
public Token getToken()
TokenizerWrapper.TokenizerStateTokenizerWrapper
to implement functions of Tokenizer (e.g. Tokenizer.readToken(org.idoox.xml.Token),
Tokenizer.getLocalName(), ...).
getToken in interface TokenizerWrapper.TokenizerStatepublic void setToken(Token currentToken)
public java.lang.String getContent()
TokenizerWrapper.TokenizerStateTokenizerWrapper
to implement Tokenizer.readContent().TokenizerWrapper.TokenizerState.getToken() is Tokenizer.CONTENT.
getContent in interface TokenizerWrapper.TokenizerStatepublic void setContent(java.lang.String content)
public java.util.Map getNamespaceDeclarations()
TokenizerWrapper.TokenizerStateTokenizerWrapper.TokenizerState.getNewPrefixes() must be
defined.
getNamespaceDeclarations in interface TokenizerWrapper.TokenizerStatepublic java.util.Map getNewNamespaceDeclarations()
TokenizerWrapper.TokenizerStateTokenizerWrapper.TokenizerState.getNewPrefixes() function
won't be used.
getNewNamespaceDeclarations in interface TokenizerWrapper.TokenizerStatepublic void setNamespaceDeclarations(java.util.Map namespaceDeclarations)
public java.lang.String[] getNewPrefixes()
TokenizerWrapper.TokenizerStateTokenizerWrapper.TokenizerState.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).
getNewPrefixes in interface TokenizerWrapper.TokenizerStatepublic void setNewPrefixes(java.lang.String[] newPrefixes)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||