[Htmlparser-cvs] htmlparser/src/org/htmlparser/nodes TagNode.java,1.6,1.7 RemarkNode.java,1.5,1.6 Ab
Brought to you by:
derrickoswald
From: Derrick O. <der...@us...> - 2006-05-31 02:10:20
|
Update of //cvsroot/htmlparser/htmlparser/src/org/htmlparser/nodes In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv27353/nodes Modified Files: TagNode.java RemarkNode.java AbstractNode.java TextNode.java Log Message: implement task #93148 toHtml(boolean verbatim) To avoid printing generated end tags use toHtml(true). Index: RemarkNode.java =================================================================== RCS file: //cvsroot/htmlparser/htmlparser/src/org/htmlparser/nodes/RemarkNode.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RemarkNode.java 27 May 2006 14:03:52 -0000 1.5 --- RemarkNode.java 31 May 2006 02:10:15 -0000 1.6 *************** *** 120,126 **** /** * Return The full HTML remark. * @return The comment, i.e. {@.html <!-- this is a comment -->}. */ ! public String toHtml () { StringBuffer buffer; --- 120,128 ---- /** * Return The full HTML remark. + * @param verbatim If <code>true</code> return as close to the original + * page text as possible. * @return The comment, i.e. {@.html <!-- this is a comment -->}. */ ! public String toHtml (boolean verbatim) { StringBuffer buffer; Index: TextNode.java =================================================================== RCS file: //cvsroot/htmlparser/htmlparser/src/org/htmlparser/nodes/TextNode.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TextNode.java 4 Nov 2005 15:49:45 -0000 1.5 --- TextNode.java 31 May 2006 02:10:15 -0000 1.6 *************** *** 103,109 **** /** * Returns the text of the node. * @return The contents of this text node. */ ! public String toHtml () { String ret; --- 103,111 ---- /** * Returns the text of the node. + * @param verbatim If <code>true</code> return as close to the original + * page text as possible. * @return The contents of this text node. */ ! public String toHtml (boolean verbatim) { String ret; *************** *** 111,115 **** ret = mText; if (null == ret) ! ret = mPage.getText (getStartPosition (), getEndPosition ()); return (ret); --- 113,117 ---- ret = mText; if (null == ret) ! ret = mPage.getText (getStartPosition (), getEndPosition ()); return (ret); Index: AbstractNode.java =================================================================== RCS file: //cvsroot/htmlparser/htmlparser/src/org/htmlparser/nodes/AbstractNode.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AbstractNode.java 26 Oct 2005 22:01:23 -0000 1.5 --- AbstractNode.java 31 May 2006 02:10:15 -0000 1.6 *************** *** 117,128 **** /** ! * Return the HTML that generated this node. ! * This method will make it easier when using html parser to reproduce html ! * pages (with or without modifications). * Applications reproducing html can use this method on nodes which are to ! * be used or transferred as they were recieved, with the original html. ! * @return The HTML code for this node. */ ! public abstract String toHtml (); /** --- 117,147 ---- /** ! * Return the HTML for this node. ! * This should be the sequence of characters that were encountered by ! * the parser that caused this node to be created. Where this breaks down is ! * where broken nodes (tags and remarks) have been encountered and fixed. * Applications reproducing html can use this method on nodes which are to ! * be used or transferred as they were received or created. ! * @return The sequence of characters that would cause this node ! * to be returned by the parser or lexer. */ ! public String toHtml () ! { ! return (toHtml (false)); ! } ! ! /** ! * Return the HTML for this node. ! * This should be the exact sequence of characters that were encountered by ! * the parser that caused this node to be created. Where this breaks down is ! * where broken nodes (tags and remarks) have been encountered and fixed. ! * Applications reproducing html can use this method on nodes which are to ! * be used or transferred as they were received or created. ! * @param verbatim If <code>true</code> return as close to the original ! * page text as possible. ! * @return The (exact) sequence of characters that would cause this node ! * to be returned by the parser or lexer. ! */ ! public abstract String toHtml (boolean verbatim); /** Index: TagNode.java =================================================================== RCS file: //cvsroot/htmlparser/htmlparser/src/org/htmlparser/nodes/TagNode.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TagNode.java 10 Apr 2005 23:20:44 -0000 1.6 --- TagNode.java 31 May 2006 02:10:15 -0000 1.7 *************** *** 660,667 **** * Render the tag as HTML. * A call to a tag's <code>toHtml()</code> method will render it in HTML. * @return The tag as an HTML fragment. * @see org.htmlparser.Node#toHtml() */ ! public String toHtml () { int length; --- 660,669 ---- * Render the tag as HTML. * A call to a tag's <code>toHtml()</code> method will render it in HTML. + * @param verbatim If <code>true</code> return as close to the original + * page text as possible. * @return The tag as an HTML fragment. * @see org.htmlparser.Node#toHtml() */ ! public String toHtml (boolean verbatim) { int length; |