|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.eos.trie.AbstractTrieLoader<CharSequence,Set<CharSequence>> net.sf.eos.trie.XmlTrieLoader
public class XmlTrieLoader
The builder creates a trie from a simple XML file. The file must be like the following DTD:
<!ELEMENT trie (entry*) > <!ELEMENT entry (key, value) > <!ELEMENT key (#PCDATA) > <!ELEMENT value (#PCDATA) >
The builder doesn't validate validates the XML structure.
If a key is twice in the XML structure the builder adds it to the
value Collection
.
Field Summary |
---|
Fields inherited from class net.sf.eos.trie.AbstractTrieLoader |
---|
TRIE_LOADER_IMPL_CONFIG_NAME |
Constructor Summary | |
---|---|
XmlTrieLoader()
|
Method Summary | |
---|---|
TextBuilder |
getTextBuilder()
Returns a setted builder. |
ResettableTokenizer |
getTokenizer()
|
void |
loadTrie(InputStream trieData,
Trie<CharSequence,Set<CharSequence>> trie)
Creates a Trie from the InputStream . |
protected CharSequence |
rebuildValue(CharSequence value)
Rebuilds a sequence of chars if the loader has a setted setTokenizer(ResettableTokenizer) and a setted
setTextBuilder(TextBuilder) . |
void |
setTextBuilder(TextBuilder builder)
Sets a builder. |
void |
setTokenizer(ResettableTokenizer tokenizer)
|
Methods inherited from class net.sf.eos.trie.AbstractTrieLoader |
---|
newInstance, newInstance |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlTrieLoader()
Method Detail |
---|
public void loadTrie(InputStream trieData, Trie<CharSequence,Set<CharSequence>> trie) throws Exception
Trie
from the InputStream
.
loadTrie
in interface TrieLoader<CharSequence,Set<CharSequence>>
loadTrie
in class AbstractTrieLoader<CharSequence,Set<CharSequence>>
trieData
- stream pointing to the trie structure data.trie
- the trie to fill with the trieData
Exception
- if the builder is unable to create the trie.public ResettableTokenizer getTokenizer()
public void setTokenizer(ResettableTokenizer tokenizer)
tokenizer
- the tokenizer to setpublic void setTextBuilder(TextBuilder builder)
TextBuilder.SPACE_BUILDER
setted at construction time.
builder
- a builder to set or null
.public TextBuilder getTextBuilder()
null
.protected CharSequence rebuildValue(CharSequence value)
setTokenizer(ResettableTokenizer)
and a setted
setTextBuilder(TextBuilder)
.
value
- the value to rebuild.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |