|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.htmlparser.visitors.NodeVisitor
net.sourceforge.scopes.rewriters.NodeVisitorWithResult
net.sourceforge.scopes.rewriters.impl.SimpleWriteNodeVisitor
public class SimpleWriteNodeVisitor
Node visitor that can write original, additional and rewritten code.
| Field Summary | |
|---|---|
protected java.io.ByteArrayOutputStream |
afterBaos
OutputStreams |
protected java.io.PrintWriter |
afterVisitWriter
PrintWriters |
protected java.io.ByteArrayOutputStream |
baos
OutputStreams |
protected java.io.ByteArrayOutputStream |
beforeBaos
OutputStreams |
protected java.io.PrintWriter |
beforeVisitWriter
PrintWriters |
protected java.lang.String |
charset
|
protected java.io.PrintWriter |
writer
PrintWriters |
| Constructor Summary | |
|---|---|
SimpleWriteNodeVisitor()
Constructor. |
|
SimpleWriteNodeVisitor(boolean recurseChildren)
Constructor. |
|
SimpleWriteNodeVisitor(boolean recurseChildren,
boolean recurseSelf)
Constructor. |
|
| Method Summary | |
|---|---|
void |
beginParsing()
|
void |
finishedParsing()
|
java.io.PrintWriter |
getAfterVisitWriter()
Returns a writer that can be used to add code after the currently visited node. |
java.io.PrintWriter |
getBeforeVisitWriter()
Returns a writer that can be used to add code before the currently visited node. |
byte[] |
getResult()
Returns the result as an array of byte, encoded with the given character set. |
void |
setCharset(java.lang.String charset)
Sets the character set to use. |
void |
setContextPath(java.lang.String contextPath)
Sets the context path to refer to. |
boolean |
shouldRecurseChildren()
|
boolean |
shouldRecurseSelf()
|
void |
visitEndTag(org.htmlparser.Tag tag)
|
void |
visitRemarkNode(org.htmlparser.Remark remark)
|
void |
visitStringNode(org.htmlparser.Text string)
|
void |
visitTag(org.htmlparser.Tag tag)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.io.ByteArrayOutputStream baos
protected java.io.ByteArrayOutputStream beforeBaos
protected java.io.ByteArrayOutputStream afterBaos
protected java.io.PrintWriter writer
protected java.io.PrintWriter beforeVisitWriter
protected java.io.PrintWriter afterVisitWriter
protected java.lang.String charset
| Constructor Detail |
|---|
public SimpleWriteNodeVisitor()
public SimpleWriteNodeVisitor(boolean recurseChildren,
boolean recurseSelf)
recurseChildren - true to recurse children.recurseSelf - true to recurse itself.public SimpleWriteNodeVisitor(boolean recurseChildren)
recurseChildren - true to recurse children.| Method Detail |
|---|
public void beginParsing()
beginParsing in class org.htmlparser.visitors.NodeVisitorpublic void finishedParsing()
finishedParsing in class org.htmlparser.visitors.NodeVisitorpublic boolean shouldRecurseChildren()
shouldRecurseChildren in class org.htmlparser.visitors.NodeVisitorpublic boolean shouldRecurseSelf()
shouldRecurseSelf in class org.htmlparser.visitors.NodeVisitorpublic void visitEndTag(org.htmlparser.Tag tag)
visitEndTag in class org.htmlparser.visitors.NodeVisitorpublic void visitRemarkNode(org.htmlparser.Remark remark)
visitRemarkNode in class org.htmlparser.visitors.NodeVisitorpublic void visitStringNode(org.htmlparser.Text string)
visitStringNode in class org.htmlparser.visitors.NodeVisitorpublic void visitTag(org.htmlparser.Tag tag)
visitTag in class org.htmlparser.visitors.NodeVisitorpublic void setContextPath(java.lang.String contextPath)
ContextPathUser
setContextPath in interface ContextPathUsersetContextPath in class NodeVisitorWithResultcontextPath - The context path.public void setCharset(java.lang.String charset)
NodeVisitorWithResult
setCharset in class NodeVisitorWithResultcharset - The character set.public java.io.PrintWriter getBeforeVisitWriter()
NodeVisitorWithResult
getBeforeVisitWriter in class NodeVisitorWithResultpublic java.io.PrintWriter getAfterVisitWriter()
NodeVisitorWithResult
getAfterVisitWriter in class NodeVisitorWithResultpublic byte[] getResult()
NodeVisitorWithResult
getResult in class NodeVisitorWithResult
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||