[Htmlparser-cvs] htmlparser/src/org/htmlparser/tags AppletTag.java,1.40,1.41 BaseHrefTag.java,1.38,1
Brought to you by:
derrickoswald
From: Derrick O. <der...@us...> - 2004-07-02 00:50:09
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32670/src/org/htmlparser/tags Modified Files: AppletTag.java BaseHrefTag.java CompositeTag.java DoctypeTag.java FrameTag.java ImageTag.java InputTag.java JspTag.java MetaTag.java ObjectTag.java Removed Files: Tag.java Log Message: Part four of a multiphase refactoring. Most internals now use the Tag interface. This interface has been broadened to add set/get scanner and set/get endtag. Removed the org.htmlparser.tags.Tag class and moved the remaining (minor) functionality to the TagNode class. So now tags inherit directly from TagNode or CompositeTag. ** NOTE: If you have subclassed org.htmlparser.tags.Tag, use org.htmlparser.nodes.TagNode now.** Removed deprecated methods getTagBegin/getTagEnd and deleted unused classes: PeekingIterator and it's Implementation. Index: ObjectTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/ObjectTag.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ObjectTag.java 26 Jun 2004 11:25:01 -0000 1.1 --- ObjectTag.java 2 Jul 2004 00:49:29 -0000 1.2 *************** *** 31,37 **** import java.util.Vector; import org.htmlparser.Node; import org.htmlparser.nodes.TextNode; ! import org.htmlparser.Attribute; import org.htmlparser.util.NodeList; import org.htmlparser.util.SimpleNodeIterator; --- 31,39 ---- import java.util.Vector; + import org.htmlparser.Attribute; import org.htmlparser.Node; + import org.htmlparser.Tag; import org.htmlparser.nodes.TextNode; ! import org.htmlparser.nodes.TagNode; import org.htmlparser.util.NodeList; import org.htmlparser.util.SimpleNodeIterator; *************** *** 343,347 **** attributes.addElement (new Attribute (" ")); attributes.addElement (new Attribute ("NAME", paramName.toUpperCase (), '"')); ! tag = new Tag (null, 0, 0, attributes); kids.add (tag); } --- 345,349 ---- attributes.addElement (new Attribute (" ")); attributes.addElement (new Attribute ("NAME", paramName.toUpperCase (), '"')); ! tag = new TagNode (null, 0, 0, attributes); kids.add (tag); } Index: BaseHrefTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/BaseHrefTag.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** BaseHrefTag.java 18 Mar 2004 04:04:08 -0000 1.38 --- BaseHrefTag.java 2 Jul 2004 00:49:28 -0000 1.39 *************** *** 28,31 **** --- 28,32 ---- import org.htmlparser.lexer.Page; + import org.htmlparser.nodes.TagNode; import org.htmlparser.util.ParserException; *************** *** 34,38 **** * It extends a basic tag by providing an accessor to the HREF attribute. */ ! public class BaseHrefTag extends Tag { /** --- 35,41 ---- * It extends a basic tag by providing an accessor to the HREF attribute. */ ! public class BaseHrefTag ! extends ! TagNode { /** Index: InputTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/InputTag.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** InputTag.java 14 Jan 2004 02:58:06 -0000 1.35 --- InputTag.java 2 Jul 2004 00:49:29 -0000 1.36 *************** *** 27,34 **** package org.htmlparser.tags; /** * An input tag in a form. */ ! public class InputTag extends Tag { /** --- 27,38 ---- package org.htmlparser.tags; + import org.htmlparser.nodes.TagNode; + /** * An input tag in a form. */ ! public class InputTag ! extends ! TagNode { /** Index: AppletTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/AppletTag.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** AppletTag.java 24 May 2004 16:18:30 -0000 1.40 --- AppletTag.java 2 Jul 2004 00:49:28 -0000 1.41 *************** *** 33,37 **** --- 33,39 ---- import org.htmlparser.Attribute; import org.htmlparser.Node; + import org.htmlparser.Tag; import org.htmlparser.Text; + import org.htmlparser.nodes.TagNode; import org.htmlparser.util.NodeList; import org.htmlparser.util.SimpleNodeIterator; *************** *** 238,242 **** attributes.addElement (new Attribute (" ")); attributes.addElement (new Attribute ("NAME", paramName, '"')); ! tag = new Tag (null, 0, 0, attributes); kids.add (tag); } --- 240,244 ---- attributes.addElement (new Attribute (" ")); attributes.addElement (new Attribute ("NAME", paramName, '"')); ! tag = new TagNode (null, 0, 0, attributes); kids.add (tag); } Index: CompositeTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/CompositeTag.java,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** CompositeTag.java 24 May 2004 16:18:30 -0000 1.77 --- CompositeTag.java 2 Jul 2004 00:49:28 -0000 1.78 *************** *** 34,37 **** --- 34,38 ---- import org.htmlparser.nodes.AbstractNode; import org.htmlparser.nodes.TagNode; + import org.htmlparser.Tag; import org.htmlparser.scanners.CompositeTagScanner; import org.htmlparser.util.NodeList; *************** *** 45,49 **** * the {@link #toHtml toHtml} method. */ ! public class CompositeTag extends Tag { /** --- 46,50 ---- * the {@link #toHtml toHtml} method. */ ! public class CompositeTag extends TagNode { /** *************** *** 51,55 **** * May be a virtual tag generated by the scanning logic. */ ! protected TagNode mEndTag; /** --- 52,56 ---- * May be a virtual tag generated by the scanning logic. */ ! protected Tag mEndTag; /** *************** *** 170,178 **** public Tag searchByName(String name) { Node node; ! Tag tag=null; boolean found = false; for (SimpleNodeIterator e = children();e.hasMoreNodes() && !found;) { node = (Node)e.nextNode(); ! if (node instanceof TagNode) { tag = (Tag)node; String nameAttribute = tag.getAttribute("NAME"); --- 171,180 ---- public Tag searchByName(String name) { Node node; ! Tag tag = null; boolean found = false; for (SimpleNodeIterator e = children();e.hasMoreNodes() && !found;) { node = (Node)e.nextNode(); ! if (node instanceof Tag) ! { tag = (Tag)node; String nameAttribute = tag.getAttribute("NAME"); *************** *** 448,474 **** } ! /** ! * @deprecated The tag *is* ths start tag. ! */ ! public TagNode getStartTag() ! { ! return (this); ! } ! ! /** ! * @deprecated The tag *is* ths start tag. ! */ ! public void setStartTag (TagNode start) ! { ! if (null != start) ! throw new IllegalStateException ("the tag *is* ths start tag"); ! } ! ! public TagNode getEndTag() { return (mEndTag); } ! public void setEndTag(TagNode end) { mEndTag = end; --- 450,459 ---- } ! public Tag getEndTag() { return (mEndTag); } ! public void setEndTag (Tag end) { mEndTag = end; Index: DoctypeTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/DoctypeTag.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** DoctypeTag.java 2 Jan 2004 16:24:54 -0000 1.37 --- DoctypeTag.java 2 Jul 2004 00:49:28 -0000 1.38 *************** *** 27,34 **** package org.htmlparser.tags; /** * The HTML Document Declaration Tag can identify <!DOCTYPE> tags. */ ! public class DoctypeTag extends Tag { /** --- 27,38 ---- package org.htmlparser.tags; + import org.htmlparser.nodes.TagNode; + /** * The HTML Document Declaration Tag can identify <!DOCTYPE> tags. */ ! public class DoctypeTag ! extends ! TagNode { /** Index: MetaTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/MetaTag.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** MetaTag.java 24 May 2004 16:18:30 -0000 1.36 --- MetaTag.java 2 Jul 2004 00:49:29 -0000 1.37 *************** *** 28,31 **** --- 28,32 ---- import org.htmlparser.Attribute; + import org.htmlparser.nodes.TagNode; import org.htmlparser.util.ParserException; *************** *** 35,39 **** public class MetaTag extends ! Tag { /** --- 36,40 ---- public class MetaTag extends ! TagNode { /** Index: JspTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/JspTag.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** JspTag.java 14 Jan 2004 02:53:46 -0000 1.39 --- JspTag.java 2 Jul 2004 00:49:29 -0000 1.40 *************** *** 27,34 **** package org.htmlparser.tags; /** * The JSP/ASP tags like <%...%> can be identified by this class. */ ! public class JspTag extends Tag { /** --- 27,38 ---- package org.htmlparser.tags; + import org.htmlparser.nodes.TagNode; + /** * The JSP/ASP tags like <%...%> can be identified by this class. */ ! public class JspTag ! extends ! TagNode { /** Index: ImageTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/ImageTag.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** ImageTag.java 24 May 2004 16:18:30 -0000 1.46 --- ImageTag.java 2 Jul 2004 00:49:28 -0000 1.47 *************** *** 31,34 **** --- 31,35 ---- import org.htmlparser.Attribute; + import org.htmlparser.nodes.TagNode; import org.htmlparser.util.ParserUtils; import org.htmlparser.visitors.NodeVisitor; *************** *** 39,43 **** public class ImageTag extends ! Tag { /** --- 40,44 ---- public class ImageTag extends ! TagNode { /** --- Tag.java DELETED --- Index: FrameTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/FrameTag.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** FrameTag.java 18 Mar 2004 04:04:08 -0000 1.36 --- FrameTag.java 2 Jul 2004 00:49:28 -0000 1.37 *************** *** 27,34 **** package org.htmlparser.tags; /** * Identifies a frame tag */ ! public class FrameTag extends Tag { /** --- 27,38 ---- package org.htmlparser.tags; + import org.htmlparser.nodes.TagNode; + /** * Identifies a frame tag */ ! public class FrameTag ! extends ! TagNode { /** |