Class FilterVisitor


  • public class FilterVisitor
    extends org.htmlparser.visitors.NodeVisitor
    The part of HTML filter that actually does the job. This class is called back by HTMLParser (http://sf.net/projects/htmlparser/).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void beginParsing()
      This method is called before the parsing.
      void finishedParsing()
      Called upon parsing completion.
      boolean shouldRecurseChildren()
      Depth traversal predicate.
      boolean shouldRecurseSelf()
      Self traversal predicate.
      void visitEndTag​(org.htmlparser.Tag tag)
      Called for each end Tag visited.
      void visitRemarkNode​(org.htmlparser.Remark remark)
      Called for each comment (RemarkNode) visited.
      void visitStringNode​(org.htmlparser.Text string)
      Called for each chunk of text (StringNode) visited.
      void visitTag​(org.htmlparser.Tag tag)
      Called for each Tag visited.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FilterVisitor

        public FilterVisitor​(HTMLFilter2 htmlfilter,
                             java.io.BufferedWriter bufwriter,
                             HTMLOptions opts)
    • Method Detail

      • shouldRecurseSelf

        public boolean shouldRecurseSelf()
        Self traversal predicate.
        Overrides:
        shouldRecurseSelf in class org.htmlparser.visitors.NodeVisitor
        Returns:
        true if a node itself is to be visited.
      • shouldRecurseChildren

        public boolean shouldRecurseChildren()
        Depth traversal predicate.
        Overrides:
        shouldRecurseChildren in class org.htmlparser.visitors.NodeVisitor
        Returns:
        true if children are to be visited.
      • visitTag

        public void visitTag​(org.htmlparser.Tag tag)
        Called for each Tag visited.
        Overrides:
        visitTag in class org.htmlparser.visitors.NodeVisitor
        Parameters:
        tag - The tag being visited.
      • visitStringNode

        public void visitStringNode​(org.htmlparser.Text string)
        Called for each chunk of text (StringNode) visited.
        Overrides:
        visitStringNode in class org.htmlparser.visitors.NodeVisitor
        Parameters:
        string - The string node being visited.
      • visitRemarkNode

        public void visitRemarkNode​(org.htmlparser.Remark remark)
        Called for each comment (RemarkNode) visited.
        Overrides:
        visitRemarkNode in class org.htmlparser.visitors.NodeVisitor
        Parameters:
        remark - The remark node being visited.
      • visitEndTag

        public void visitEndTag​(org.htmlparser.Tag tag)
        Called for each end Tag visited.
        Overrides:
        visitEndTag in class org.htmlparser.visitors.NodeVisitor
        Parameters:
        tag - The end tag being visited.
      • beginParsing

        public void beginParsing()
        This method is called before the parsing.
        Overrides:
        beginParsing in class org.htmlparser.visitors.NodeVisitor
      • finishedParsing

        public void finishedParsing()
        Called upon parsing completion.
        Overrides:
        finishedParsing in class org.htmlparser.visitors.NodeVisitor