jess.xml
Class JessSAXParser

java.lang.Object
  extended by jess.xml.JessSAXParser

public class JessSAXParser
extends java.lang.Object

A SAX-based parser for JessML. Construct a JessSAXParser with a Rete object as an argument, then pass an InputSource to the parse() method. All the constructs and other code in the file will be installed into the Rete object.

 JessSAXParser parser = new JessSAXParser(engine);
 parser.parse(new org.xml.sax.InputSource(new FileInputStream(filename));
 
(C) 2013 Sandia Corporation

See Also:
Rete.batch(java.lang.String)

Constructor Summary
JessSAXParser(Rete sink)
          Constructor.
JessSAXParser(Rete sink, java.lang.String topLevelElement)
          Constructor.
 
Method Summary
 void parse(org.xml.sax.InputSource source)
          Parse a document full of JessML code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JessSAXParser

public JessSAXParser(Rete sink,
                     java.lang.String topLevelElement)
              throws JessException
Constructor. This parser object will read JessML code and install the results into the given Rete object. The parsed document must start with the named top level element, one of JessSAXHandler.RULEBASE or JessSAXHandler.FACTLIST.

Parameters:
sink - the Rete object to receive any parsed constructs
topLevelElement - the name of the top-level element to expect
Throws:
JessException - if anything goes wrong

JessSAXParser

public JessSAXParser(Rete sink)
              throws JessException
Constructor. This parser object will read JessML code and install the results into the given Rete object. The parse document must start with a JessSAXHandler.RULEBASE element.

Parameters:
sink - the Rete object to receive any parsed constructs
Throws:
JessException - if anything goes wrong
Method Detail

parse

public void parse(org.xml.sax.InputSource source)
           throws JessException
Parse a document full of JessML code. This should be a well-formed XML document including the <?xml?> entity line. The document root element should be either a <rulebase> element or a <fact-list> element.

Parameters:
source - the input source
Throws:
JessException - if anything goes wrong

2013 Sandia Corporation