|
||||||||||
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.NodeVisitor
public void finishedParsing()
finishedParsing
in class org.htmlparser.visitors.NodeVisitor
public boolean shouldRecurseChildren()
shouldRecurseChildren
in class org.htmlparser.visitors.NodeVisitor
public boolean shouldRecurseSelf()
shouldRecurseSelf
in class org.htmlparser.visitors.NodeVisitor
public void visitEndTag(org.htmlparser.Tag tag)
visitEndTag
in class org.htmlparser.visitors.NodeVisitor
public void visitRemarkNode(org.htmlparser.Remark remark)
visitRemarkNode
in class org.htmlparser.visitors.NodeVisitor
public void visitStringNode(org.htmlparser.Text string)
visitStringNode
in class org.htmlparser.visitors.NodeVisitor
public void visitTag(org.htmlparser.Tag tag)
visitTag
in class org.htmlparser.visitors.NodeVisitor
public void setContextPath(java.lang.String contextPath)
ContextPathUser
setContextPath
in interface ContextPathUser
setContextPath
in class NodeVisitorWithResult
contextPath
- The context path.public void setCharset(java.lang.String charset)
NodeVisitorWithResult
setCharset
in class NodeVisitorWithResult
charset
- The character set.public java.io.PrintWriter getBeforeVisitWriter()
NodeVisitorWithResult
getBeforeVisitWriter
in class NodeVisitorWithResult
public java.io.PrintWriter getAfterVisitWriter()
NodeVisitorWithResult
getAfterVisitWriter
in class NodeVisitorWithResult
public byte[] getResult()
NodeVisitorWithResult
getResult
in class NodeVisitorWithResult
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |