|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectbyucc.jhdl.util.xmac.TagParser
This is the generic xmac tag parser. The idea is to make xmac as open and extensible as possible. If you have a custom tag that needs to be processed then extend this class. In particular, the parse method needs to be overridden with your custom parsing proceedures.
| Field Summary | |
protected DocInfo |
docInfo
This object is passed back and forth between all the classes. |
| Constructor Summary | |
TagParser(DocInfo docInfo)
Constructor. |
|
| Method Summary | |
protected boolean |
checkParent(org.w3c.dom.Node node,
java.lang.String name)
Check a tag to see if it has the right parent. |
protected int |
countLines(java.lang.String text)
Count the number of lines in a given text block. |
protected void |
decreaseIndent()
Decrease the indent level of the output java code. |
protected void |
increaseIndent()
Increase the indent level of the output java code. |
protected java.lang.String[] |
indentBlock(java.lang.String text)
This takes a large block of text, possibly containing multiple lines, splits it up, then attempts to indent of of the lines to make good looking code. |
protected java.lang.String |
indentLine(java.lang.String text)
Take a single line of text and indent it to the proper lever for the code. |
protected java.lang.String |
indentLine(java.lang.String text,
int level,
int spacesPerLevel)
Take a single line of text and indent it to the proper lever for the code. |
protected void |
outmsg(java.lang.String text)
Output a string to the user. |
void |
parse(org.w3c.dom.Node docRoot)
This is the parser method to override. |
void |
parse(java.lang.String text)
An alternate parse method if needed. |
protected java.lang.String[] |
strBlockToArray(java.lang.String text)
Take a single long string containing multiple lines and turn it into an array of strings. |
protected void |
writeOutput(java.lang.String text)
Write some text to the output file. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected DocInfo docInfo
| Constructor Detail |
public TagParser(DocInfo docInfo)
throws java.lang.Exception
docInfo - The DocInfo object the holds data about the current class.| Method Detail |
public void parse(org.w3c.dom.Node docRoot)
throws java.lang.Exception
docRoot - The Node of the little tree to process.
java.lang.Exception
public void parse(java.lang.String text)
throws java.lang.Exception
text - A String that the particular parser needs.
java.lang.Exceptionprotected java.lang.String[] strBlockToArray(java.lang.String text)
text - The large String to chop into lines.
protected java.lang.String[] indentBlock(java.lang.String text)
text - A String to break apart and indent.
protected int countLines(java.lang.String text)
text - The text block to count.
int represnting the number of lines.
protected java.lang.String indentLine(java.lang.String text,
int level,
int spacesPerLevel)
text - A String to indent.level - An int representing the indent level.spacesPerLevel - An int representing the number of spaces per indent level.
protected java.lang.String indentLine(java.lang.String text)
DocInfo object.
text - The String to indent.
protected void outmsg(java.lang.String text)
throws java.lang.Exception
text - The String to dump out.
java.lang.Exception
protected void writeOutput(java.lang.String text)
throws java.lang.Exception
text - A String to dump to the output file.
java.lang.Exception
protected boolean checkParent(org.w3c.dom.Node node,
java.lang.String name)
node - The Node of the tag that we are checking.name - The name of the parent that is the right one.
protected void increaseIndent()
protected void decreaseIndent()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||