|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnenok.parser.XmlParser
public abstract class XmlParser
This class parses XML input files. It processes their static skeleton and delegates the generic parts to the user's subclass implementation. This class uses the JDOM framework and demands the XML file to reference a XML schema instance.
Constructor Summary | |
---|---|
XmlParser()
Constructor: |
Method Summary | |
---|---|
boolean |
accept(File file)
Verifies that this file type can be used together with this parser instance. |
ResultSet |
parse(File file)
Parses the content of the given file and builds a result set, i.e. a wrapper class that bundles valuations and queries (domains) converted from the file content. |
Node |
parse(File file,
JoinTree.Construction data)
Rebuilds a jointree which is serialized in the given file. |
Domain |
parseDomain(org.jdom.Element domain,
Hashtable<String,Variable> variables)
This method converts the informations representing a domain read from an XML file to a domain object. |
abstract Valuation |
parseValuation(List<org.jdom.Element> content,
Hashtable<String,Variable> variables)
This method converts the informations representing a valuation read from an XML file to a valuation object. |
abstract Variable |
parseVariable(String name,
List<org.jdom.Element> content)
This method converts the informations representing a variable read from an XML file to a variable object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlParser()
Method Detail |
---|
public boolean accept(File file)
Parser
accept
in interface Parser
file
- The file to verify.
true
if the file extension satisfies the precondition of this parser.Parser.accept(java.io.File)
public ResultSet parse(File file) throws ParserException
KB_Parser
parse
in interface KB_Parser
file
- The file whose content is parsed.
ParserException
- Exceptions that are thrown during the parsing process.KB_Parser.parse(java.io.File)
public Node parse(File file, JoinTree.Construction data) throws ParserException
JT_Parser
parse
in interface JT_Parser
file
- The file containing a serialized jointree.data
- Object that contains all necessary information to build join trees.
ParserException
- Exceptions that are thrown during the parsing process.JT_Parser.parse(java.io.File, nenok.lc.JoinTree.Construction)
public Domain parseDomain(org.jdom.Element domain, Hashtable<String,Variable> variables) throws ParserException
org.jdom.Element
object.
domain
- The content of the "domain" tag read from the XML file.variables
- A hashtable that maps variable names on variable objects.
ParserException
- Exceptions caused by the parsing process.public abstract Variable parseVariable(String name, List<org.jdom.Element> content) throws ParserException
org.jdom.Element
objects.
name
- The variable's name (this is part of the file's skeleton).content
- All sub-elements of the "variable" element read from the XML file.
ParserException
- Exceptions caused by the parsing process.public abstract Valuation parseValuation(List<org.jdom.Element> content, Hashtable<String,Variable> variables) throws ParserException
org.jdom.Element
objects.
content
- All sub-elements of the "valuation" element read from the XML file.variables
- A hashtable that maps variable names on variable objects.
ParserException
- Exceptions caused by the parsing process.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |