[Htmlparser-cvs] htmlparser/src/org/htmlparser/lexer/nodes TagNode.java,1.34,1.35 RemarkNode.java,1.
Brought to you by:
derrickoswald
From: Derrick O. <der...@us...> - 2004-05-24 00:38:58
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexer/nodes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31556/lexer/nodes Modified Files: TagNode.java Removed Files: RemarkNode.java StringNode.java Log Message: Part two of a multiphase refactoring. Part one added the Tag interface. This submission eliminates some of the duplication between the lexer.nodes package and the htmlparser package by removing the tag specific signatures, visitTitleTag, visitLinkTag and visitImageTag, from the NodeVisitor class. This allows the lexer to return htmlparser level classes for StringNode and RemarkNode. The TagNode is still present in the lexer.nodes package, but will move next. This means that classes derived from NodeVisitor *will not* work using the above signatures; instead a check for tag class (or name) should be performed in visitTag. A document will be added to the visitors package with comprehensive porting instructions. --- StringNode.java DELETED --- --- RemarkNode.java DELETED --- Index: TagNode.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexer/nodes/TagNode.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** TagNode.java 6 Apr 2004 10:51:57 -0000 1.34 --- TagNode.java 24 May 2004 00:38:16 -0000 1.35 *************** *** 40,43 **** --- 40,44 ---- import org.htmlparser.util.SpecialHashtable; import org.htmlparser.util.Translate; + import org.htmlparser.visitors.NodeVisitor; /** *************** *** 717,722 **** } ! public void accept (Object visitor) { } --- 718,732 ---- } ! /** ! * Default tag visiting code. ! * Based on <code>isEndTag()</code>, calls either <code>visitTag()</code> or ! * <code>visitEndTag()</code>. ! */ ! public void accept (NodeVisitor visitor) { + if (isEndTag ()) + visitor.visitEndTag (this); + else + visitor.visitTag (this); } |