[Htmlparser-cvs] htmlparser/src/org/htmlparser/lexer/nodes TagNode.java,1.21,1.22
Brought to you by:
derrickoswald
From: <der...@us...> - 2003-11-01 21:55:46
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexer/nodes In directory sc8-pr-cvs1:/tmp/cvs-serv2656/lexer/nodes Modified Files: TagNode.java Log Message: Create nodes by cloning from a list of prototypes in the Parser (NodeFactory). So now, the startTag() is the CompositeTag, and the CompositeTagScanner just adds children. This is an intermediate code drop on the way to integrating the scanners with the tags; the scanners no longer create the tags (but they still create the prototypical ones). Index: TagNode.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexer/nodes/TagNode.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** TagNode.java 1 Nov 2003 01:36:56 -0000 1.21 --- TagNode.java 1 Nov 2003 21:55:42 -0000 1.22 *************** *** 257,269 **** attributes = getAttributesEx (); ! size = attributes.size (); ! for (int i = 0; i < size; i++) { ! attribute = (Attribute)attributes.elementAt (i); ! string = attribute.getName (); ! if ((null != string) && name.equalsIgnoreCase (string)) { ! ret = attribute; ! i = size; // exit fast } } --- 257,272 ---- attributes = getAttributesEx (); ! if (null != attributes) { ! size = attributes.size (); ! for (int i = 0; i < size; i++) { ! attribute = (Attribute)attributes.elementAt (i); ! string = attribute.getName (); ! if ((null != string) && name.equalsIgnoreCase (string)) ! { ! ret = attribute; ! i = size; // exit fast ! } } } *************** *** 809,812 **** --- 812,833 ---- return ((null == raw) ? false : ('/' == raw.charAt (0))); + } + + /** + * Get the line number where this tag starts. + * @return The (zero based) line number in the page where this tag starts. + */ + public int getStartingLineNumber () + { + return (getPage ().row (getStartPosition ())); + } + + /** + * Get the line number where this tag ends. + * @return The (zero based) line number in the page where this tag ends. + */ + public int getEndingLineNumber () + { + return (getPage ().row (getEndPosition ())); } } |