| java.lang.Object org.drools.eclipse.editors.completion.DSLTree
DSLTree | public class DSLTree (Code) | | |
Constructor Summary | |
public | DSLTree() |
Method Summary | |
public void | addChildToList(Node n, String prefix, ArrayList list) method will prepend the parent text to the child and generate
the possible combinations in text format. | public void | addObjToNLMap(String objname, String nl) | public void | addTokens(String metadata, StringTokenizer tokens) The method is different than addTokens(StringTokenizer). | public void | addTokens(String[] tokens, Node rootNode) | public void | buildTree(String dslFile) the method will take the dsl file and build a DSLTree using
the Node class. | public void | buildTree(Reader dslcontents) the method uses the DSLAdapter to get the contents of the
DSL mapping file. | public void | buildTree(DSLMapping mapping) | protected BufferedReader | createBufferedReader(Reader reader) | public Node[] | getChildren(String obj, String text) | public ArrayList | getChildrenList(String obj, String text, boolean addChildren) | public Node[] | getConditionChildren(String text) the method will tokenize the text and try to find
the node that matches and return the children. | public ArrayList | getConditionChildrenList(String text, boolean addChildren) for convienance, the method will return a list of strings
that are children of the last node found. | public Node[] | getConsequenceChildren(String text) the method will tokenize the text and try to find
the node that matches and return the children. | public ArrayList | getConsequenceChildrenList(String text, boolean addChildren) for convienance, the method will return a list of strings
that are children of the last node found. | public Node | getCurrent() | public Node | getLast() | protected String | getObjMetadata(String text) | protected Section | getSection(String text) | public boolean | isEmpty() if the DSL mapping hasn't been loaded, the method will return
true. | protected BufferedReader | openDSLFile(String filename) method will create a BufferedReader to read the file. | protected void | parseFile(BufferedReader reader) method will use the BufferedReader to read the contents of the file. | protected void | printNode(Node n) | protected void | printTabs(int count) | public void | printTree() The method will print the DSLTree to System.out in text format. | public void | setCurrent(Node current) | public void | setLast(Node last) | protected String | stripHeadingAndCode(String text) | protected String | stripObjMetadata(String text) |
addChildToList | public void addChildToList(Node n, String prefix, ArrayList list)(Code) | | method will prepend the parent text to the child and generate
the possible combinations in text format.
Parameters: n - Parameters: prefix - Parameters: list - |
addTokens | public void addTokens(String metadata, StringTokenizer tokens)(Code) | | The method is different than addTokens(StringTokenizer). this method
expects additional metadata. It expects to get an object name or "*"
meaning all. If the metadata is a wildcard all, it will add the
tokens to all the top level nodes that are immediate child of root.
Parameters: metadata - Parameters: tokens - |
addTokens | public void addTokens(String[] tokens, Node rootNode)(Code) | | method adds the token to root
Parameters: tokens - |
buildTree | public void buildTree(String dslFile)(Code) | | the method will take the dsl file and build a DSLTree using
the Node class.
Parameters: dslFile - |
buildTree | public void buildTree(Reader dslcontents)(Code) | | the method uses the DSLAdapter to get the contents of the
DSL mapping file.
Parameters: dslcontents - |
createBufferedReader | protected BufferedReader createBufferedReader(Reader reader)(Code) | | Create a buffered reader for the reader created by the DSLAdapater
Parameters: reader - |
getChildren | public Node[] getChildren(String obj, String text)(Code) | | the method expects the caller to pass the object
Parameters: obj - Parameters: text - |
getChildrenList | public ArrayList getChildrenList(String obj, String text, boolean addChildren)(Code) | | Parameters: obj - Parameters: text - Parameters: addChildren - |
getConditionChildren | public Node[] getConditionChildren(String text)(Code) | | the method will tokenize the text and try to find
the node that matches and return the children. the method
will traverse down the network as far as it can and return
the children at that level.
Parameters: text - |
getConditionChildrenList | public ArrayList getConditionChildrenList(String text, boolean addChildren)(Code) | | for convienance, the method will return a list of strings
that are children of the last node found. If the editor
wants to generate the children strings, call the method
with true
Parameters: text - |
getConsequenceChildren | public Node[] getConsequenceChildren(String text)(Code) | | the method will tokenize the text and try to find
the node that matches and return the children. the method
will traverse down the network as far as it can and return
the children at that level.
Parameters: text - |
getConsequenceChildrenList | public ArrayList getConsequenceChildrenList(String text, boolean addChildren)(Code) | | for convienance, the method will return a list of strings
that are children of the last node found. If the editor
wants to generate the children strings, call the method
with true
Parameters: text - |
getObjMetadata | protected String getObjMetadata(String text)(Code) | | Method will return just the object metadata
Parameters: text - |
isEmpty | public boolean isEmpty()(Code) | | if the DSL mapping hasn't been loaded, the method will return
true. If the DSL mapping has been loaded, the method returns
false.
|
openDSLFile | protected BufferedReader openDSLFile(String filename)(Code) | | method will create a BufferedReader to read the file.
Parameters: filename - |
parseFile | protected void parseFile(BufferedReader reader)(Code) | | method will use the BufferedReader to read the contents of the file.
It calls other methods to parse the line and build the tree.
Parameters: reader - |
printNode | protected void printNode(Node n)(Code) | | method will print the node and then iterate over the children
Parameters: n - |
printTabs | protected void printTabs(int count)(Code) | | Method will print n number of tabs
Parameters: count - |
printTree | public void printTree()(Code) | | The method will print the DSLTree to System.out in text format.
|
setCurrent | public void setCurrent(Node current)(Code) | | |
stripHeadingAndCode | protected String stripHeadingAndCode(String text)(Code) | | method will strip out the when, then, * at the beginning of each
line and the mapped drl expression
Parameters: text - |
stripObjMetadata | protected String stripObjMetadata(String text)(Code) | | method will strip the metadata from the text string
Parameters: text - |
|
|