|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.drools.eclipse.editors.completion.DSLTree
public class DSLTree
| Field Summary | |
|---|---|
static String |
separator
|
static String |
tab
|
| Constructor Summary | |
|---|---|
DSLTree()
|
|
| Method Summary | |
|---|---|
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. |
void |
addObjToNLMap(String objname,
String nl)
|
void |
addTokens(String[] tokens,
Node rootNode)
method adds the token to root |
void |
addTokens(String metadata,
StringTokenizer tokens)
The method is different than addTokens(StringTokenizer). this method expects additional metadata. |
void |
buildTree(org.drools.lang.dsl.DSLMapping mapping)
|
void |
buildTree(Reader dslcontents)
the method uses the DSLAdapter to get the contents of the DSL mapping file. |
void |
buildTree(String dslFile)
the method will take the dsl file and build a DSLTree using the Node class. |
protected BufferedReader |
createBufferedReader(Reader reader)
Create a buffered reader for the reader created by the DSLAdapater |
Node[] |
getChildren(String obj,
String text)
the method expects the caller to pass the object |
ArrayList |
getChildrenList(String obj,
String text,
boolean addChildren,
boolean firstLine)
|
Node[] |
getConditionChildren(String text)
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. |
ArrayList |
getConditionChildrenList(String text,
boolean addChildren)
for convienance, the method will return a list of strings that are children of the last node found. |
Node[] |
getConsequenceChildren(String text)
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. |
ArrayList |
getConsequenceChildrenList(String text,
boolean addChildren)
for convienance, the method will return a list of strings that are children of the last node found. |
Node |
getCurrent()
|
Node |
getLast()
|
protected String |
getObjMetadata(String text)
Method will return just the object metadata |
protected org.drools.lang.dsl.DSLMappingEntry.Section |
getSection(String text)
|
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)
method will print the node and then iterate over the children |
protected void |
printTabs(int count)
Method will print n number of tabs |
void |
printTree()
The method will print the DSLTree to System.out in text format. |
void |
setCurrent(Node current)
|
void |
setLast(Node last)
|
protected String |
stripHeadingAndCode(String text)
method will strip out the when, then, * at the beginning of each line and the mapped drl expression |
protected String |
stripObjMetadata(String text)
method will strip the metadata from the text string |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String separator
public static final String tab
| Constructor Detail |
|---|
public DSLTree()
| Method Detail |
|---|
public void buildTree(String dslFile)
dslFile - public void buildTree(Reader dslcontents)
dslcontents - protected BufferedReader openDSLFile(String filename)
filename -
protected BufferedReader createBufferedReader(Reader reader)
reader -
public boolean isEmpty()
protected void parseFile(BufferedReader reader)
reader - public void buildTree(org.drools.lang.dsl.DSLMapping mapping)
public void addObjToNLMap(String objname,
String nl)
protected org.drools.lang.dsl.DSLMappingEntry.Section getSection(String text)
protected String stripHeadingAndCode(String text)
text -
protected String getObjMetadata(String text)
text -
protected String stripObjMetadata(String text)
text -
public void addTokens(String metadata,
StringTokenizer tokens)
metadata - tokens -
public void addTokens(String[] tokens,
Node rootNode)
tokens - public Node[] getConditionChildren(String text)
text -
public Node[] getConsequenceChildren(String text)
text -
public Node[] getChildren(String obj,
String text)
obj - text -
public ArrayList getConditionChildrenList(String text,
boolean addChildren)
text -
public ArrayList getConsequenceChildrenList(String text,
boolean addChildren)
text -
public ArrayList getChildrenList(String obj,
String text,
boolean addChildren,
boolean firstLine)
obj - text - addChildren -
public void addChildToList(Node n,
String prefix,
ArrayList list)
n - prefix - list - public Node getCurrent()
public void setCurrent(Node current)
public Node getLast()
public void setLast(Node last)
public void printTree()
protected void printNode(Node n)
n - protected void printTabs(int count)
count -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||