public class RUL2XML
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MOMA_CONVERTER |
Constructor and Description |
---|
RUL2XML() |
Modifier and Type | Method and Description |
---|---|
protected void |
addApplElem(org.w3c.dom.Document doc,
org.w3c.dom.Node parent,
int line,
java.lang.String[] arr,
java.util.HashMap<java.lang.String,java.lang.String> keyMap)
Add a applelem element to document.
|
protected void |
addAttribute(org.w3c.dom.Document doc,
org.w3c.dom.Node parent,
int line,
java.lang.String[] arr,
java.util.HashMap<java.lang.String,java.lang.String> keyMap)
Add a attribute element to document.
|
protected void |
addLiteral(org.w3c.dom.Document doc,
org.w3c.dom.Node parent,
int line,
java.lang.String[] arr,
java.util.HashMap<java.lang.String,java.lang.String> keyMap)
Add a lietral element to document.
|
protected void |
addMethod(org.w3c.dom.Document doc,
org.w3c.dom.Node parent,
int line,
java.lang.String[] arr,
java.util.HashMap<java.lang.String,java.lang.String> keyMap)
Add a method element to document.
|
protected void |
addPremethod(org.w3c.dom.Document doc,
org.w3c.dom.Node parent,
int line,
java.lang.String[] arr,
java.util.HashMap<java.lang.String,java.lang.String> keyMap)
Add a premethod element to document.
|
protected void |
addRule(org.w3c.dom.Document doc,
org.w3c.dom.Node parent,
int line,
java.lang.String[] arr,
java.util.HashMap<java.lang.String,java.lang.String> keyMap)
Add a rule element to document.
|
protected void |
addValues(org.w3c.dom.Document doc,
org.w3c.dom.Node parent,
int line,
java.lang.String[] arr,
java.util.HashMap<java.lang.String,java.lang.String> keyMap)
Add a premethod values to document.
|
protected java.lang.String |
getKey(int line,
java.lang.String[] arr,
java.util.HashMap<java.lang.String,java.lang.String> keyMap)
Get the ID of the rule components
|
protected java.lang.String |
getSourceLine(java.lang.String[] arr)
Get the original source line.
|
static void |
main(java.lang.String[] args)
The startup routine.
|
org.w3c.dom.Document |
parse(java.io.Reader reader)
Parse the RUL file.
|
static void |
printDocument(java.io.PrintStream out,
org.w3c.dom.Document doc)
Print the given document to the given output printer.
|
protected static void |
printElement(java.io.PrintStream out,
org.w3c.dom.Element elem,
java.lang.String prefix)
Print the given element to the given output printer using the given prefix string.
|
public static final java.lang.String MOMA_CONVERTER
public org.w3c.dom.Document parse(java.io.Reader reader) throws javax.xml.parsers.ParserConfigurationException, java.io.IOException, org.xml.sax.SAXException
reader
- the reader of the source.javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException
protected java.lang.String getSourceLine(java.lang.String[] arr)
arr
- The array of the components.protected void addRule(org.w3c.dom.Document doc, org.w3c.dom.Node parent, int line, java.lang.String[] arr, java.util.HashMap<java.lang.String,java.lang.String> keyMap) throws org.xml.sax.SAXException
doc
- the document.parent
- the parent node.line
- the actual line numberarr
- The array of the components.keyMap
- The map containing all keys.org.xml.sax.SAXException
- if something goes wrong.protected void addAttribute(org.w3c.dom.Document doc, org.w3c.dom.Node parent, int line, java.lang.String[] arr, java.util.HashMap<java.lang.String,java.lang.String> keyMap) throws org.xml.sax.SAXException
doc
- the document.parent
- the parent node.line
- the actual line numberarr
- The array of the components.keyMap
- The map containing all keys.org.xml.sax.SAXException
- if something goes wrong.protected void addApplElem(org.w3c.dom.Document doc, org.w3c.dom.Node parent, int line, java.lang.String[] arr, java.util.HashMap<java.lang.String,java.lang.String> keyMap) throws org.xml.sax.SAXException
doc
- the document.parent
- the parent node.line
- the actual line numberarr
- The array of the components.keyMap
- The map containing all keys.org.xml.sax.SAXException
- if something goes wrong.protected void addPremethod(org.w3c.dom.Document doc, org.w3c.dom.Node parent, int line, java.lang.String[] arr, java.util.HashMap<java.lang.String,java.lang.String> keyMap) throws org.xml.sax.SAXException
<pre> <common:method name="pre_kva6"> <common:classdef name="com.highqsoft.rule.Calculator"/> </common:method> </pre>
doc
- the document.parent
- the parent node.line
- the actual line numberarr
- The array of the components.keyMap
- The map containing all keys.org.xml.sax.SAXException
- if something goes wrong.protected void addLiteral(org.w3c.dom.Document doc, org.w3c.dom.Node parent, int line, java.lang.String[] arr, java.util.HashMap<java.lang.String,java.lang.String> keyMap) throws org.xml.sax.SAXException
doc
- the document.parent
- the parent node.line
- the actual line numberarr
- The array of the components.keyMap
- The map containing all keys.org.xml.sax.SAXException
- if something goes wrong.protected void addMethod(org.w3c.dom.Document doc, org.w3c.dom.Node parent, int line, java.lang.String[] arr, java.util.HashMap<java.lang.String,java.lang.String> keyMap) throws org.xml.sax.SAXException
doc
- the document.parent
- the parent node.line
- the actual line numberarr
- The array of the components.keyMap
- The map containing all keys.org.xml.sax.SAXException
- if something goes wrong.protected void addValues(org.w3c.dom.Document doc, org.w3c.dom.Node parent, int line, java.lang.String[] arr, java.util.HashMap<java.lang.String,java.lang.String> keyMap) throws org.xml.sax.SAXException
doc
- the document.parent
- the parent node.line
- the actual line numberarr
- The array of the components.keyMap
- The map containing all keys.org.xml.sax.SAXException
- if something goes wrong.protected java.lang.String getKey(int line, java.lang.String[] arr, java.util.HashMap<java.lang.String,java.lang.String> keyMap) throws org.xml.sax.SAXException
line
- the actual line numberarr
- The array of the components.keyMap
- The map containing all keys.org.xml.sax.SAXException
- if no key is defined for that component.public static void printDocument(java.io.PrintStream out, org.w3c.dom.Document doc)
out
- the printer.doc
- the document.protected static void printElement(java.io.PrintStream out, org.w3c.dom.Element elem, java.lang.String prefix)
out
- the printer.doc
- the document.prefix
- the prefix.public static void main(java.lang.String[] args)
args
- the commandline arguments.