[Htmlparser-cvs] htmlparser/src/org/htmlparser/tags BaseHrefTag.java,1.39,1.40 BodyTag.java,1.21,1.2
Brought to you by:
derrickoswald
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30655/htmlparser/src/org/htmlparser/tags Modified Files: BaseHrefTag.java BodyTag.java CompositeTag.java DoctypeTag.java FormTag.java FrameSetTag.java FrameTag.java HeadTag.java ImageTag.java JspTag.java LabelTag.java LinkTag.java MetaTag.java OptionTag.java ScriptTag.java SelectTag.java TableRow.java TableTag.java TextareaTag.java TitleTag.java package.html Log Message: Documentation revamp part one. Deprecated node decorators. Added doSemanticAction for Text and Comment nodes. Added missing sitecapturer scripts. Fixed DOS batch files to work when called from any location. Index: BaseHrefTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/BaseHrefTag.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** BaseHrefTag.java 2 Jul 2004 00:49:28 -0000 1.39 --- BaseHrefTag.java 10 Apr 2005 23:20:45 -0000 1.40 *************** *** 61,66 **** /** ! * Get the value of the HREF attribute, if any. ! * @return The HREF value, with the last slash removed, if any. */ public String getBaseUrl() --- 61,66 ---- /** ! * Get the value of the <code>HREF</code> attribute, if any. ! * @return The <code>HREF</code> value, with the leading and trailing whitespace removed, if any. */ public String getBaseUrl() *************** *** 76,79 **** --- 76,83 ---- } + /** + * Set the value of the <code>HREF</code> attribute. + * @param base The new <code>HREF</code> value. + */ public void setBaseUrl (String base) { *************** *** 84,87 **** --- 88,92 ---- * Perform the meaning of this tag. * This sets the base URL to use for the rest of the page. + * @exception ParserException If setting the base URL fails. */ public void doSemanticAction () throws ParserException *************** *** 91,97 **** page = getPage (); if (null != page) - { page.setBaseUrl (getBaseUrl ()); - } } } --- 96,100 ---- Index: OptionTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/OptionTag.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** OptionTag.java 2 Jan 2004 16:24:55 -0000 1.36 --- OptionTag.java 10 Apr 2005 23:20:45 -0000 1.37 *************** *** 82,96 **** /** ! * Get the value of the value attribute. */ ! public String getValue() { ! return (getAttribute("VALUE")); } /** * Set the value of the value attribute. */ ! public void setValue(String value) { this.setAttribute("VALUE",value); --- 82,99 ---- /** ! * Get the <code>VALUE</code> attribute, if any. ! * @return The value of the <code>VALUE</code> attribute, ! * or <code>null</code> if the attribute doesn't exist. */ ! public String getValue () { ! return (getAttribute ("VALUE")); } /** * Set the value of the value attribute. + * @param value The new value of the <code>VALUE</code> attribute. */ ! public void setValue (String value) { this.setAttribute("VALUE",value); *************** *** 98,102 **** /** ! * Get the text of this optin. */ public String getOptionText() --- 101,106 ---- /** ! * Get the text of this option. ! * @return The textual contents of this <code>OPTION</code> tag. */ public String getOptionText() *************** *** 105,108 **** --- 109,116 ---- } + /** + * Return a string representation of this node suitable for debugging. + * @return The value and text of this tag in a string. + */ public String toString() { Index: ScriptTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/ScriptTag.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** ScriptTag.java 29 Feb 2004 01:38:36 -0000 1.37 --- ScriptTag.java 10 Apr 2005 23:20:45 -0000 1.38 *************** *** 78,86 **** /** ! * Get the language attribute value. */ public String getLanguage() { ! return (getAttribute("LANGUAGE")); } --- 78,87 ---- /** ! * Get the <code>LANGUAGE</code> attribute, if any. ! * @return The scripting language. */ public String getLanguage() { ! return (getAttribute ("LANGUAGE")); } *************** *** 113,121 **** /** ! * Get the type attribute value. */ public String getType() { ! return (getAttribute("TYPE")); } --- 114,123 ---- /** ! * Get the <code>TYPE</code> attribute, if any. ! * @return The script mime type. */ public String getType() { ! return (getAttribute ("TYPE")); } *************** *** 130,135 **** /** ! * Set the type of the script tag. ! * @param type The new type value. */ public void setType (String type) --- 132,137 ---- /** ! * Set the mime type of the script tag. ! * @param type The new mime type. */ public void setType (String type) *************** *** 138,142 **** } ! protected void putChildrenInto(StringBuffer sb) { Node node; --- 140,148 ---- } ! /** ! * Places the script contents into the provided buffer. ! * @param sb The buffer to add the script to. ! */ ! protected void putChildrenInto (StringBuffer sb) { Node node; *************** *** 155,159 **** /** ! * Print the contents of the script tag. */ public String toString() --- 161,166 ---- /** ! * Print the contents of the script tag suitable for debugging display. ! * @return The script language or type and code as a string. */ public String toString() Index: SelectTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/SelectTag.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** SelectTag.java 24 Jan 2004 23:57:52 -0000 1.38 --- SelectTag.java 10 Apr 2005 23:20:45 -0000 1.39 *************** *** 83,86 **** --- 83,90 ---- } + /** + * Get the list of options in this <code>SELECT</code> tag. + * @return The {@.html <OPTION>} tags contained by this tag. + */ public OptionTag [] getOptionTags () { Index: TableTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/TableTag.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** TableTag.java 13 Feb 2005 20:36:00 -0000 1.40 --- TableTag.java 10 Apr 2005 23:20:45 -0000 1.41 *************** *** 117,120 **** --- 117,123 ---- /** * Get the number of rows in this table. + * @return The number of rows in this table. + * <em>Note: this is a a simple count of the number of {@.html <TR>} tags and + * may be incorrect if the {@.html <TR>} tags span multiple rows.</em> */ public int getRowCount () *************** *** 125,130 **** /** * Get the row at the given index. */ ! public TableRow getRow (int i) { TableRow[] rows; --- 128,135 ---- /** * Get the row at the given index. + * @param index The row number (zero based) to get. + * @return The row for the given index. */ ! public TableRow getRow (int index) { TableRow[] rows; *************** *** 132,137 **** rows = getRows (); ! if (i < rows.length) ! ret = rows[i]; else ret = null; --- 137,142 ---- rows = getRows (); ! if (index < rows.length) ! ret = rows[index]; else ret = null; *************** *** 140,143 **** --- 145,152 ---- } + /** + * Return a string suitable for debugging display. + * @return The table as HTML, sorry. + */ public String toString() { Index: FrameTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/FrameTag.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** FrameTag.java 2 Jul 2004 00:49:28 -0000 1.37 --- FrameTag.java 10 Apr 2005 23:20:45 -0000 1.38 *************** *** 83,86 **** --- 83,91 ---- } + /** + * Get the <code>NAME</code> attribute, if any. + * @return The value of the <code>NAME</code> attribute, + * or <code>null</code> if the attribute doesn't exist. + */ public String getFrameName() { *************** *** 89,93 **** /** ! * Print the contents of the FrameTag. */ public String toString() --- 94,99 ---- /** ! * Return a string representation of the contents of this <code>FRAME</code> tag suitable for debugging. ! * @return A string with this tag's contents. */ public String toString() Index: LabelTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/LabelTag.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** LabelTag.java 2 Jan 2004 16:24:55 -0000 1.35 --- LabelTag.java 10 Apr 2005 23:20:45 -0000 1.36 *************** *** 62,65 **** --- 62,69 ---- } + /** + * Returns the text contained inside this label tag. + * @return The textual contents between the {@.html <LABEL></LABEL>} pair. + */ public String getLabel() { *************** *** 67,73 **** } public String toString() { ! return "LABEL: "+getLabel(); } } --- 71,81 ---- } + /** + * Returns a string representation of this label tag suitable for debugging. + * @return A string representing this label. + */ public String toString() { ! return "LABEL: "+ getLabel(); } } Index: CompositeTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/CompositeTag.java,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** CompositeTag.java 31 Jul 2004 16:42:34 -0000 1.79 --- CompositeTag.java 10 Apr 2005 23:20:45 -0000 1.80 *************** *** 59,62 **** --- 59,65 ---- protected final static CompositeTagScanner mDefaultCompositeScanner = new CompositeTagScanner (); + /** + * Create a composite tag. + */ public CompositeTag () { *************** *** 125,128 **** --- 128,135 ---- } + /** + * Return the textual contents of this tag and it's children. + * @return The 'browser' text contents of this tag. + */ public String toPlainTextString() { StringBuffer stringRepresentation = new StringBuffer(); *************** *** 133,136 **** --- 140,147 ---- } + /** + * Add the textual contents of the children of this node to the buffer. + * @param sb The buffer to append to. + */ protected void putChildrenInto(StringBuffer sb) { *************** *** 145,148 **** --- 156,163 ---- } + /** + * Add the textual contents of the end tag of this node to the buffer. + * @param sb The buffer to append to. + */ protected void putEndTagInto(StringBuffer sb) { *************** *** 152,155 **** --- 167,175 ---- } + /** + * Return this tag as HTML code. + * @return This tag and it's contents (children) and the end tag + * as HTML code. + */ public String toHtml() { StringBuffer sb = new StringBuffer(); *************** *** 158,162 **** { putChildrenInto(sb); ! if (null != getEndTag ()) // this test if for link tags that refuse to scan because there's no HREF attribute putEndTagInto(sb); } --- 178,182 ---- { putChildrenInto(sb); ! if (null != getEndTag ()) putEndTagInto(sb); } *************** *** 290,293 **** --- 310,314 ---- * @return int The node index in the children list of the node containing * the text or -1 if not found. + * @see #findPositionOf (String, Locale) */ public int findPositionOf (String text) *************** *** 301,307 **** * Text is compared without case sensitivity and conversion to uppercase * uses the supplied locale. - * @param text The text to search for. * @return int The node index in the children list of the node containing * the text or -1 if not found. */ public int findPositionOf (String text, Locale locale) --- 322,329 ---- * Text is compared without case sensitivity and conversion to uppercase * uses the supplied locale. * @return int The node index in the children list of the node containing * the text or -1 if not found. + * @param locale The locale to use in converting to uppercase. + * @param text The text to search for. */ public int findPositionOf (String text, Locale locale) *************** *** 358,365 **** /** ! * Collect this node and its child nodes (if-applicable) into the collectionList parameter, provided the node ! * satisfies the filtering criteria.<P> ! * ! * This mechanism allows powerful filtering code to be written very easily, * without bothering about collection of embedded tags separately. * e.g. when we try to get all the links on a page, it is not possible to --- 380,386 ---- /** ! * Collect this node and its child nodes (if-applicable) into the list parameter, ! * provided the node satisfies the filtering criteria. ! * <p>This mechanism allows powerful filtering code to be written very easily, * without bothering about collection of embedded tags separately. * e.g. when we try to get all the links on a page, it is not possible to *************** *** 367,392 **** * links embedded in them. We could get the links out by checking if the * current node is a {@link CompositeTag}, and going through its children. ! * So this method provides a convenient way to do this.<P> ! * ! * Using collectInto(), programs get a lot shorter. Now, the code to * extract all links from a page would look like: * <pre> ! * NodeList collectionList = new NodeList(); * NodeFilter filter = new TagNameFilter ("A"); * for (NodeIterator e = parser.elements(); e.hasMoreNodes();) ! * e.nextNode().collectInto(collectionList, filter); * </pre> ! * Thus, collectionList will hold all the link nodes, irrespective of how ! * deep the links are embedded.<P> ! * ! * Another way to accomplish the same objective is: * <pre> ! * NodeList collectionList = new NodeList(); * NodeFilter filter = new TagClassFilter (LinkTag.class); * for (NodeIterator e = parser.elements(); e.hasMoreNodes();) ! * e.nextNode().collectInto(collectionList, filter); * </pre> * This is slightly less specific because the LinkTag class may be ! * registered for more than one node name, e.g. <LINK> tags too. */ public void collectInto (NodeList list, NodeFilter filter) --- 388,414 ---- * links embedded in them. We could get the links out by checking if the * current node is a {@link CompositeTag}, and going through its children. ! * So this method provides a convenient way to do this.</p> ! * <p>Using collectInto(), programs get a lot shorter. Now, the code to * extract all links from a page would look like: * <pre> ! * NodeList list = new NodeList(); * NodeFilter filter = new TagNameFilter ("A"); * for (NodeIterator e = parser.elements(); e.hasMoreNodes();) ! * e.nextNode().collectInto(list, filter); * </pre> ! * Thus, <code>list</code> will hold all the link nodes, irrespective of how ! * deep the links are embedded.</p> ! * <p>Another way to accomplish the same objective is: * <pre> ! * NodeList list = new NodeList(); * NodeFilter filter = new TagClassFilter (LinkTag.class); * for (NodeIterator e = parser.elements(); e.hasMoreNodes();) ! * e.nextNode().collectInto(list, filter); * </pre> * This is slightly less specific because the LinkTag class may be ! * registered for more than one node name, e.g. <LINK> tags too.</p> ! * @param list The list to add nodes to. ! * @param filter The filter to apply. ! * @see org.htmlparser.filters */ public void collectInto (NodeList list, NodeFilter filter) *************** *** 399,402 **** --- 421,428 ---- } + /** + * Return the HTML code for the children of this tag. + * @return A string with the HTML code for the contents of this tag. + */ public String getChildrenHTML() { StringBuffer buff = new StringBuffer(); *************** *** 441,444 **** --- 467,474 ---- } + /** + * Return the number of child nodes in this tag. + * @return The child node count. + */ public int getChildCount() { *************** *** 450,453 **** --- 480,491 ---- } + /** + * Get the end tag for this tag. + * For example, if the node is {@.html <LABEL>The label</LABLE>}, then + * this method would return the {@.html </LABLE>} end tag. + * @return The end tag for this node. + * <em>Note: If the start and end position of the end tag is the same, + * then the end tag was injected (it's a virtual end tag).</em> + */ public Tag getEndTag() { *************** *** 455,461 **** } ! public void setEndTag (Tag end) { ! mEndTag = end; } --- 493,506 ---- } ! /** ! * Set the end tag for this tag. ! * @param tag The new end tag for this tag. ! * Note: no checking is perfromed so you can generate bad HTML by setting ! * the end tag with a name not equal to the name of the start tag, ! * i.e. {@.html <LABEL>The label</TITLE>} ! */ ! public void setEndTag (Tag tag) { ! mEndTag = tag; } *************** *** 464,468 **** * it. The text node will retain links to its parents, so * further navigation is possible. ! * @param searchText * @return The list of text nodes (recursively) found. */ --- 509,513 ---- * it. The text node will retain links to its parents, so * further navigation is possible. ! * @param searchText The text to search for. * @return The list of text nodes (recursively) found. */ *************** *** 490,493 **** --- 535,542 ---- } + /** + * Return a string representation of the contents of this tag, it's children and it's end tag suitable for debugging. + * @return A textual representation of the tag. + */ public String toString () { *************** *** 528,531 **** --- 577,585 ---- } + /** + * Return a string representation of the contents of this tag, it's children and it's end tag suitable for debugging. + * @param level The indentation level to use. + * @param buffer The buffer to append to. + */ public void toString (int level, StringBuffer buffer) { Index: DoctypeTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/DoctypeTag.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** DoctypeTag.java 2 Jul 2004 00:49:28 -0000 1.38 --- DoctypeTag.java 10 Apr 2005 23:20:45 -0000 1.39 *************** *** 58,62 **** /** ! * Print the contents of the document declaration tag. */ public String toString() --- 58,63 ---- /** ! * Return a string representation of the contents of this <code>!DOCTYPE</code> tag suitable for debugging. ! * @return The contents of the document declaration tag as a string. */ public String toString() Index: HeadTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/HeadTag.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** HeadTag.java 2 Jan 2004 16:24:54 -0000 1.21 --- HeadTag.java 10 Apr 2005 23:20:45 -0000 1.22 *************** *** 81,84 **** --- 81,88 ---- } + /** + * Returns a string representation of this <code>HEAD</code> tag suitable for debugging. + * @return A string representing this tag. + */ public String toString() { Index: package.html =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/package.html,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** package.html 2 Jan 2004 16:24:55 -0000 1.19 --- package.html 10 Apr 2005 23:20:45 -0000 1.20 *************** *** 30,43 **** </head> <body bgcolor="white"> ! The tags package contains tag types that are created mostly by the scanners. ! Developers should familiarize themselves with this package as well. Custom scanners would need to create custom tags (Factory + Template Method). ! ! <h2>Related Documentation</h2> ! ! For overviews, tutorials, examples, guides, and tool documentation, please see: ! <ul> ! <li><a href="http://htmlparser.sourceforge.net">HTML Parser Home Page</a> ! </ul> ! <!-- Put @see and @since tags down here. --> --- 30,59 ---- </head> <body bgcolor="white"> ! The tags package contains specific tags. ! <p>This package has implementations of tags that have functionality beyond the ! capability of a generic tag. For example, the {@.html <META>} tag has methods ! to get the {@link org.htmlparser.tags.MetaTag#getMetaContent CONTENT} and ! {@link org.htmlparser.tags.MetaTag#getMetaTagName NAME} ! attributes (although this could be done with generic attribute manipulation) ! and an implementation of ! {@link org.htmlparser.tags.MetaTag#doSemanticAction doSemanticAction} ! that alters the lexer's encoding.</p> ! <p>The classes in this package have been added in an ad-hoc fashion, with the ! most useful ones having existed a long time, while some obvious ones are rather ! new. Please feel free to add your own, and register them with the ! {@link org.htmlparser.PrototypicalNodeFactory PrototypicalNodeFactory}, ! and they will be treated like any other in-built tag. In fact tags do not need ! to reside in this package.</p> ! <p>If the tag can contain other nodes, i.e. {@.html <h1>My Heading</h1>}, then ! it should derive from (i.e. be a subclass of) {@link org.htmlparser.tags.CompositeTag}. ! In this way it will inherit the ! {@link org.htmlparser.scanners.CompositeTagScanner CompositeTagScanner} ! and nodes between the start and end tag will be gathered into the list of ! children. Most of the tags in this package derive from CompositeTag, and that ! why the nodes returned from the Parser are nested.</p> ! <p>If it is a simple tag, i.e. {@.html <br>}, then it should derive from ! {@link org.htmlparser.nodes.TagNode TagNode}. See for example ! {@link org.htmlparser.tags.MetaTag} ! or {@link org.htmlparser.tags.ImageTag}.</p> <!-- Put @see and @since tags down here. --> Index: LinkTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/LinkTag.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** LinkTag.java 13 Feb 2005 22:45:48 -0000 1.53 --- LinkTag.java 10 Apr 2005 23:20:45 -0000 1.54 *************** *** 118,122 **** /** ! * Returns the accesskey attribute value, if any. */ public String getAccessKey() --- 118,124 ---- /** ! * Get the <code>ACCESSKEY</code> attribute, if any. ! * @return The value of the <code>ACCESSKEY</code> attribute, ! * or <code>null</code> if the attribute doesn't exist. */ public String getAccessKey() *************** *** 130,133 **** --- 132,136 ---- * off the front (if those predicates return <code>true</code>) but not * for other protocols. Don't ask me why, it's a legacy thing. + * @return The URL for this <code>A</code> tag. */ public String getLink() *************** *** 158,162 **** /** ! * Returns the text contained inside this link tag */ public String getLinkText() --- 161,166 ---- /** ! * Returns the text contained inside this link tag. ! * @return The textual contents between the {@.html <A></A>} pair. */ public String getLinkText() *************** *** 259,263 **** /** ! * Print the contents of this Link Node */ public String toString() --- 263,268 ---- /** ! * Return the contents of this link node as a string suitable for debugging. ! * @return A string representation of this node. */ public String toString() *************** *** 287,290 **** --- 292,299 ---- } + /** + * Set the <code>HREF</code> attribute. + * @param link The new value of the <code>HREF</code> attribute. + */ public void setLink(String link) { Index: TableRow.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/TableRow.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** TableRow.java 13 Feb 2005 20:36:00 -0000 1.41 --- TableRow.java 10 Apr 2005 23:20:45 -0000 1.42 *************** *** 86,90 **** /** ! * Get the column tags within this row. */ public TableColumn[] getColumns () --- 86,91 ---- /** ! * Get the column tags within this <code>TR</code> (table row) tag. ! * @return The {@.html <TD>} tags contained by this tag. */ public TableColumn[] getColumns () *************** *** 125,128 **** --- 126,132 ---- /** * Get the number of columns in this row. + * @return The number of columns in this row. + * <em>Note: this is a a simple count of the number of {@.html <TD>} tags and + * may be incorrect if the {@.html <TD>} tags span multiple columns.</em> */ public int getColumnCount () Index: TextareaTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/TextareaTag.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** TextareaTag.java 14 Jan 2004 02:53:46 -0000 1.34 --- TextareaTag.java 10 Apr 2005 23:20:45 -0000 1.35 *************** *** 81,84 **** --- 81,88 ---- } + /** + * Return the plain text contents from this text area. + * @return The text of the children of this <code>TEXTAREA</code> tag. + */ public String getValue() { return toPlainTextString(); Index: TitleTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/TitleTag.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** TitleTag.java 17 Jul 2004 13:45:04 -0000 1.35 --- TitleTag.java 10 Apr 2005 23:20:45 -0000 1.36 *************** *** 83,86 **** --- 83,87 ---- /** * Get the title text. + * @return The title. */ public String getTitle() *************** *** 89,92 **** --- 90,97 ---- } + /** + * Return a string representation of this tag for debugging. + * @return A string with the text of the title. + */ public String toString() { Index: JspTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/JspTag.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** JspTag.java 2 Jul 2004 00:49:29 -0000 1.40 --- JspTag.java 10 Apr 2005 23:20:45 -0000 1.41 *************** *** 58,62 **** /** ! * Print the contents of the jsp tag. */ public String toString() --- 58,63 ---- /** ! * Returns a string representation of this jsp tag suitable for debugging. ! * @return A string representing this tag. */ public String toString() Index: FrameSetTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/FrameSetTag.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** FrameSetTag.java 25 Jan 2004 21:33:12 -0000 1.36 --- FrameSetTag.java 10 Apr 2005 23:20:45 -0000 1.37 *************** *** 74,78 **** /** ! * Print the contents of the FrameSetTag */ public String toString() --- 74,79 ---- /** ! * Return a string representation of the contents of this <code>FRAMESET</code> tag suitable for debugging. ! * @return A string with this tag's contents. */ public String toString() Index: ImageTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/ImageTag.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** ImageTag.java 17 Jul 2004 13:45:04 -0000 1.48 --- ImageTag.java 10 Apr 2005 23:20:45 -0000 1.49 *************** *** 81,84 **** --- 81,85 ---- * <IMG SRC = http://www.redgreen.com> - space both sides of equals sign * </pre> + * @return The relative URL for the image. */ public String extractImageLocn () *************** *** 181,185 **** /** ! * Returns the location of the image */ public String getImageURL() --- 182,187 ---- /** ! * Returns the location of the image. ! * @return The absolute URL for this image. */ public String getImageURL() *************** *** 192,195 **** --- 194,201 ---- } + /** + * Set the <code>SRC</code> attribute. + * @param url The new value of the <code>SRC</code> attribute. + */ public void setImageURL (String url) { Index: FormTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/FormTag.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** FormTag.java 18 Jul 2004 21:31:20 -0000 1.49 --- FormTag.java 10 Apr 2005 23:20:45 -0000 1.50 *************** *** 36,41 **** public class FormTag extends CompositeTag { ! public static final String POST="POST"; ! public static final String GET="GET"; /** --- 36,50 ---- public class FormTag extends CompositeTag { ! /** ! * The {@value} method. ! * @see #getFormMethod ! */ ! public static final String POST = "POST"; ! ! /** ! * The {@value} method. ! * @see #getFormMethod ! */ ! public static final String GET = "GET"; /** *************** *** 183,187 **** /** * Find the textarea tag matching the given name ! * @param name Name of the textarea tag to be found within the form */ public TextareaTag getTextAreaTag(String name) --- 192,197 ---- /** * Find the textarea tag matching the given name ! * @param name Name of the textarea tag to be found within the form. ! * @return The <code>TEXTAREA</code> tag with the matching name. */ public TextareaTag getTextAreaTag(String name) *************** *** 203,206 **** --- 213,217 ---- /** + * Return a string representation of the contents of this <code>FORM</code> tag suitable for debugging. * @return A textual representation of the form tag. */ *************** *** 211,216 **** /** ! * Extract the location of the image, given the tag, and the url ! * of the html page in which this tag exists. */ public String extractFormLocn () --- 222,227 ---- /** ! * Extract the <code>ACTION</code> attribute as an absolute URL. ! * @return The URL the form is to be submitted to. */ public String extractFormLocn () Index: MetaTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/MetaTag.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** MetaTag.java 6 Sep 2004 17:12:59 -0000 1.38 --- MetaTag.java 10 Apr 2005 23:20:45 -0000 1.39 *************** *** 60,63 **** --- 60,68 ---- } + /** + * Get the <code>HTTP-EQUIV</code> attribute, if any. + * @return The value of the <code>HTTP-EQUIV</code> attribute, + * or <code>null</code> if the attribute doesn't exist. + */ public String getHttpEquiv () { *************** *** 65,68 **** --- 70,78 ---- } + /** + * Get the <code>CONTENT</code> attribute, if any. + * @return The value of the <code>CONTENT</code> attribute, + * or <code>null</code> if the attribute doesn't exist. + */ public String getMetaContent () { *************** *** 70,73 **** --- 80,88 ---- } + /** + * Get the <code>NAME</code> attribute, if any. + * @return The value of the <code>NAME</code> attribute, + * or <code>null</code> if the attribute doesn't exist. + */ public String getMetaTagName () { *************** *** 75,79 **** } ! public void setHttpEquiv(String httpEquiv) { Attribute equiv; --- 90,98 ---- } ! /** ! * Set the <code>HTTP-EQUIV</code> attribute. ! * @param httpEquiv The new value of the <code>HTTP-EQUIV</code> attribute. ! */ ! public void setHttpEquiv (String httpEquiv) { Attribute equiv; *************** *** 85,89 **** } ! public void setMetaTagContents(String metaTagContents) { Attribute content; --- 104,112 ---- } ! /** ! * Set the <code>CONTENT</code> attribute. ! * @param metaTagContents The new value of the <code>CONTENT</code> attribute. ! */ ! public void setMetaTagContents (String metaTagContents) { Attribute content; *************** *** 95,99 **** } ! public void setMetaTagName(String metaTagName) { Attribute name; --- 118,126 ---- } ! /** ! * Set the <code>NAME</code> attribute. ! * @param metaTagName The new value of the <code>NAME</code> attribute. ! */ ! public void setMetaTagName (String metaTagName) { Attribute name; *************** *** 106,112 **** /** * Check for a charset directive, and if found, set the charset for the page. */ ! public void doSemanticAction () throws ParserException { String httpEquiv; --- 133,143 ---- /** + * Perform the META tag semantic action. * Check for a charset directive, and if found, set the charset for the page. + * @exception ParserException If setting the encoding fails. */ ! public void doSemanticAction () ! throws ! ParserException { String httpEquiv; Index: BodyTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/BodyTag.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** BodyTag.java 2 Jan 2004 16:24:54 -0000 1.21 --- BodyTag.java 10 Apr 2005 23:20:45 -0000 1.22 *************** *** 77,80 **** --- 77,85 ---- } + /** + * Returns the textual contents of this <code>BODY</code> tag. + * Equivalent to <code>toPlainTextString()</code>. + * @return The 'browser' text in this tag. + */ public String getBody() { *************** *** 82,85 **** --- 87,94 ---- } + /** + * Return a string representation of this <code>BODY</code> tag suitable for debugging. + * @return A string representing this <code>BODY</code> tag. + */ public String toString() { |