|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.dfki.lt.tools.tokenizer.Description
Description
is an abstract class that provides common
methods to manage the content of description files.
Field Summary | |
protected static java.lang.String |
DEF_CLASS
This is the attribute of a definition or list element that contains the class name. |
protected static java.lang.String |
DEF_REGEXP
This is the attribute of a definition element that contains the regular expression. |
protected java.util.HashMap |
definitionsMap
This maps a class to a regular expression that matches all tokens of this class. |
protected static java.lang.String |
DEFS
This is the name of the element with the definitions in the description files. |
protected static RegExpFactory |
FACTORY
This is the factory for creating regular expressions. |
protected static java.lang.String |
LIST_ENCODING
This is the attribute of a list element that contains the encoding of the list file. |
protected static java.lang.String |
LIST_FILE
This is the attribute of a list element that point to the list file. |
protected static java.lang.String |
LISTS
This is the name of the element with the lists in the description files. |
protected java.util.HashMap |
listsMap
This maps a class to a hash map that contains members of this class. |
protected java.util.HashMap |
regExpMap
This maps regular expressions of rules to class names of the matched expression. |
protected static java.lang.String |
RULES
This is the name of the element with the rules in the description files. |
protected java.util.HashMap |
rulesMap
This maps the rule names to regular expressions that match the tokens as described by the rule. |
Constructor Summary | |
Description()
|
Method Summary | |
protected java.util.HashMap |
getDefinitionsMap()
This returns the field definitionsMap . |
protected java.util.HashMap |
getListsMap()
This returns the field listsMap . |
protected java.util.HashMap |
getRegExpMap()
This returns the field regExpMap . |
protected java.util.HashMap |
getRulesMap()
This returns the field rulesMap . |
protected void |
loadDefinitions(org.w3c.dom.Document aDescr,
java.util.Set classes)
This uses the definitions section in a description file to map each token class from the definitions to a regular expression that matches all tokens of that class. |
protected void |
loadLists(org.w3c.dom.Document aDescr,
java.util.Set classes,
java.lang.String aResourceDir)
This uses the lists section in a description file to map each token class from the lists to a hashmap that contains all members of that class. |
protected void |
loadRules(org.w3c.dom.Document aDescr)
This maps each rule from the description to a regular expression that matches all tokens from that rule. |
protected void |
setDefinitionsMap(java.util.HashMap aDefinitionsMap)
This sets the field definitionsMap to
aDefinitionsMap . |
protected void |
setListsMap(java.util.HashMap aListsMap)
This sets the field listsMap to
aListsMap . |
protected void |
setRegExpMap(java.util.HashMap aRegExpMap)
This sets the field regExpMap to
aRegExpMap . |
protected void |
setRulesMap(java.util.HashMap aRulesMap)
This sets the field rulesMap to
aRulesMap . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.String DEFS
protected static final java.lang.String DEF_REGEXP
protected static final java.lang.String DEF_CLASS
protected static final java.lang.String LISTS
protected static final java.lang.String LIST_FILE
protected static final java.lang.String LIST_ENCODING
protected static final java.lang.String RULES
protected static RegExpFactory FACTORY
protected java.util.HashMap definitionsMap
protected java.util.HashMap rulesMap
protected java.util.HashMap regExpMap
protected java.util.HashMap listsMap
Constructor Detail |
public Description()
Method Detail |
protected java.util.HashMap getDefinitionsMap()
definitionsMap
.
HashMap
protected void setDefinitionsMap(java.util.HashMap aDefinitionsMap)
definitionsMap
to
aDefinitionsMap
.
aDefinitionsMap
- a HashMap
protected java.util.HashMap getRulesMap()
rulesMap
.
HashMap
protected void setRulesMap(java.util.HashMap aRulesMap)
rulesMap
to
aRulesMap
.
aRulesMap
- a HashMap
protected java.util.HashMap getRegExpMap()
regExpMap
.
HashMap
protected void setRegExpMap(java.util.HashMap aRegExpMap)
regExpMap
to
aRegExpMap
.
aRegExpMap
- a HashMap
protected java.util.HashMap getListsMap()
listsMap
.
HashMap
protected void setListsMap(java.util.HashMap aListsMap)
listsMap
to
aListsMap
.
aListsMap
- a HashMap
protected void loadDefinitions(org.w3c.dom.Document aDescr, java.util.Set classes)
aDescr
- a dom Document
with a descriptionclasses
- a Set
with the defined classes, used
for validation
InitializationException
- if definitions description
contains illegal regular expression or undefined classesprotected void loadRules(org.w3c.dom.Document aDescr)
aDescr
- a dom Document
with the description
InitializationException
- if rules description
contains illegal regular expressionprotected void loadLists(org.w3c.dom.Document aDescr, java.util.Set classes, java.lang.String aResourceDir)
aDescr
- a dom Document
with a descriptionclasses
- a Set
with the defined classes, used
for validationaResourceDir
- a String
with the name of the
resource directory
InitializationException
- if lists description contains
undefined classes or file
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |