Package org.omegat.filters2.html2
Class FilterVisitor
- java.lang.Object
-
- org.htmlparser.visitors.NodeVisitor
-
- org.omegat.filters2.html2.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/).
-
-
Constructor Summary
Constructors Constructor Description FilterVisitor(HTMLFilter2 htmlfilter, java.io.BufferedWriter bufwriter, HTMLOptions opts)
-
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 endTag
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 eachTag
visited.
-
-
-
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 classorg.htmlparser.visitors.NodeVisitor
- Returns:
true
if a node itself is to be visited.
-
shouldRecurseChildren
public boolean shouldRecurseChildren()
Depth traversal predicate.- Overrides:
shouldRecurseChildren
in classorg.htmlparser.visitors.NodeVisitor
- Returns:
true
if children are to be visited.
-
visitTag
public void visitTag(org.htmlparser.Tag tag)
Called for eachTag
visited.- Overrides:
visitTag
in classorg.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 classorg.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 classorg.htmlparser.visitors.NodeVisitor
- Parameters:
remark
- The remark node being visited.
-
visitEndTag
public void visitEndTag(org.htmlparser.Tag tag)
Called for each endTag
visited.- Overrides:
visitEndTag
in classorg.htmlparser.visitors.NodeVisitor
- Parameters:
tag
- The end tag being visited.
-
beginParsing
public void beginParsing()
This method is called before the parsing.- Overrides:
beginParsing
in classorg.htmlparser.visitors.NodeVisitor
-
finishedParsing
public void finishedParsing()
Called upon parsing completion.- Overrides:
finishedParsing
in classorg.htmlparser.visitors.NodeVisitor
-
-