net.sourceforge.scopes.rewriters
Class NodeVisitorWithResult

java.lang.Object
  extended by org.htmlparser.visitors.NodeVisitor
      extended by net.sourceforge.scopes.rewriters.NodeVisitorWithResult
All Implemented Interfaces:
ContextPathUser
Direct Known Subclasses:
SimpleWriteNodeVisitor

public abstract class NodeVisitorWithResult
extends org.htmlparser.visitors.NodeVisitor
implements ContextPathUser

It is a node visitor that can add additional code and can output the final code after visiting sequence has finished.


Constructor Summary
NodeVisitorWithResult()
          Constructor.
NodeVisitorWithResult(boolean recurseChildren)
          Constructor.
NodeVisitorWithResult(boolean recurseChildren, boolean recurseSelf)
          Constructor.
 
Method Summary
abstract  java.io.PrintWriter getAfterVisitWriter()
          Returns a writer that can be used to add code after the currently visited node.
abstract  java.io.PrintWriter getBeforeVisitWriter()
          Returns a writer that can be used to add code before the currently visited node.
abstract  byte[] getResult()
          Returns the result as an array of byte, encoded with the given character set.
abstract  void setCharset(java.lang.String charset)
          Sets the character set to use.
abstract  void setContextPath(java.lang.String contextPath)
          Sets the context path to refer to.
 
Methods inherited from class org.htmlparser.visitors.NodeVisitor
beginParsing, finishedParsing, shouldRecurseChildren, shouldRecurseSelf, visitEndTag, visitRemarkNode, visitStringNode, visitTag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeVisitorWithResult

public NodeVisitorWithResult()
Constructor.


NodeVisitorWithResult

public NodeVisitorWithResult(boolean recurseChildren,
                             boolean recurseSelf)
Constructor.

Parameters:
recurseChildren - true to recurse children.
recurseSelf - true to recurse itself.

NodeVisitorWithResult

public NodeVisitorWithResult(boolean recurseChildren)
Constructor.

Parameters:
recurseChildren - true to recurse children.
Method Detail

setContextPath

public abstract void setContextPath(java.lang.String contextPath)
Description copied from interface: ContextPathUser
Sets the context path to refer to.

Specified by:
setContextPath in interface ContextPathUser
Parameters:
contextPath - The context path.

setCharset

public abstract void setCharset(java.lang.String charset)
Sets the character set to use.

Parameters:
charset - The character set.

getBeforeVisitWriter

public abstract java.io.PrintWriter getBeforeVisitWriter()
Returns a writer that can be used to add code before the currently visited node.

Returns:
The writer to write before the node.

getAfterVisitWriter

public abstract java.io.PrintWriter getAfterVisitWriter()
Returns a writer that can be used to add code after the currently visited node.

Returns:
The writer to write after the node.

getResult

public abstract byte[] getResult()
Returns the result as an array of byte, encoded with the given character set.

Returns:
The result.