[Htmlparser-cvs] htmlparser/src/org/htmlparser/scanners AppletScanner.java,1.30,1.31 BaseHrefScanner
Brought to you by:
derrickoswald
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/scanners In directory sc8-pr-cvs1:/tmp/cvs-serv24483/src/org/htmlparser/scanners Modified Files: AppletScanner.java BaseHrefScanner.java BodyScanner.java BulletListScanner.java BulletScanner.java CompositeTagScanner.java DivScanner.java DoctypeScanner.java FormScanner.java FrameScanner.java FrameSetScanner.java HeadScanner.java HtmlScanner.java ImageScanner.java InputTagScanner.java JspScanner.java LabelScanner.java LinkScanner.java MetaTagScanner.java OptionTagScanner.java ScriptScanner.java SelectTagScanner.java SpanScanner.java StyleScanner.java TableColumnScanner.java TableRowScanner.java TableScanner.java TagScanner.java TextareaTagScanner.java TitleScanner.java package.html Log Message: Add style checking target to ant build script: ant checkstyle It uses a jar from http://checkstyle.sourceforge.net which is dropped in the lib directory. The rules are in the file htmlparser_checks.xml in the src directory. Added lexerapplications package with Tabby as the first app. It performs whitespace manipulation on source files to follow the style rules. This reduced the number of style violations to roughly 14,000. There are a few issues with the style checker that need to be resolved before it should be taken too seriously. For example: It thinks all method arguments should be final, even if they are modified by the code (which the compiler frowns on). It complains about long lines, even when there is no possibility of wrapping the line, i.e. a URL in a comment that's more than 80 characters long. It considers all naked integers as 'magic numbers', even when they are obvious, i.e. the 4 corners of a box. It complains about whitespace following braces, even in array initializers, i.e. X[][] = { {a, b} { } } But it points out some really interesting things, even if you don't agree with the style guidelines, so it's worth a look. Index: AppletScanner.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/scanners/AppletScanner.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** AppletScanner.java 8 Sep 2003 02:26:29 -0000 1.30 --- AppletScanner.java 10 Sep 2003 03:38:19 -0000 1.31 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,27 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 18,27 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 40,48 **** public class AppletScanner extends CompositeTagScanner { private static String [] MATCH_STRING = {"APPLET"}; ! public AppletScanner() { super(MATCH_STRING); } ! public AppletScanner(String filter) { super(filter,MATCH_STRING); --- 40,48 ---- public class AppletScanner extends CompositeTagScanner { private static String [] MATCH_STRING = {"APPLET"}; ! public AppletScanner() { super(MATCH_STRING); } ! public AppletScanner(String filter) { super(filter,MATCH_STRING); *************** *** 55,59 **** public Tag createTag(TagData tagData, CompositeTagData compositeTagData) throws ParserException { ! return new AppletTag(tagData,compositeTagData); } --- 55,59 ---- public Tag createTag(TagData tagData, CompositeTagData compositeTagData) throws ParserException { ! return new AppletTag(tagData,compositeTagData); } Index: BaseHrefScanner.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/scanners/BaseHrefScanner.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** BaseHrefScanner.java 8 Sep 2003 02:26:29 -0000 1.24 --- BaseHrefScanner.java 10 Sep 2003 03:38:19 -0000 1.25 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,27 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 18,27 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 60,64 **** absoluteBaseUrl = LinkProcessor.removeLastSlash(baseUrl.trim()); processor.setBaseUrl(absoluteBaseUrl); ! } return new BaseHrefTag(tagData,absoluteBaseUrl); } --- 60,64 ---- absoluteBaseUrl = LinkProcessor.removeLastSlash(baseUrl.trim()); processor.setBaseUrl(absoluteBaseUrl); ! } return new BaseHrefTag(tagData,absoluteBaseUrl); } Index: BodyScanner.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/scanners/BodyScanner.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** BodyScanner.java 8 Sep 2003 02:26:29 -0000 1.16 --- BodyScanner.java 10 Sep 2003 03:38:19 -0000 1.17 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,27 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 18,27 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 46,50 **** this(""); } ! public BodyScanner(String filter) { super(filter,MATCH_NAME,ENDERS,END_TAG_ENDERS,false); --- 46,50 ---- this(""); } ! public BodyScanner(String filter) { super(filter,MATCH_NAME,ENDERS,END_TAG_ENDERS,false); *************** *** 54,58 **** return MATCH_NAME; } ! public Tag createTag( TagData tagData, --- 54,58 ---- return MATCH_NAME; } ! public Tag createTag( TagData tagData, Index: BulletListScanner.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/scanners/BulletListScanner.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** BulletListScanner.java 8 Sep 2003 02:26:29 -0000 1.15 --- BulletListScanner.java 10 Sep 2003 03:38:19 -0000 1.16 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,27 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 18,27 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 43,47 **** private final static String ENDERS [] = { "BODY", "HTML" }; private Stack ulli = new Stack(); ! public BulletListScanner(Parser parser) { this("",parser); --- 43,47 ---- private final static String ENDERS [] = { "BODY", "HTML" }; private Stack ulli = new Stack(); ! public BulletListScanner(Parser parser) { this("",parser); *************** *** 61,65 **** return MATCH_STRING; } ! public void beforeScanningStarts() { ulli.push(this); --- 61,65 ---- return MATCH_STRING; } ! public void beforeScanningStarts() { ulli.push(this); Index: BulletScanner.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/scanners/BulletScanner.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** BulletScanner.java 8 Sep 2003 02:26:29 -0000 1.20 --- BulletScanner.java 10 Sep 2003 03:38:19 -0000 1.21 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,27 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 18,27 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 42,48 **** * [1] A <ul> can have <li> under it<br> * [2] A <li> can have <ul> under it<br> ! * [3] A <li> cannot have <li> under it<br> * <p> ! * These rules are implemented easily through the shared stack. */ public class BulletScanner extends CompositeTagScanner { --- 42,48 ---- * [1] A <ul> can have <li> under it<br> * [2] A <li> can have <ul> under it<br> ! * [3] A <li> cannot have <li> under it<br> * <p> ! * These rules are implemented easily through the shared stack. */ public class BulletScanner extends CompositeTagScanner { *************** *** 51,55 **** private final static String END_TAG_ENDERS [] = { "UL" }; private Stack ulli; ! public BulletScanner(Stack ulli) { this("",ulli); --- 51,55 ---- private final static String END_TAG_ENDERS [] = { "UL" }; private Stack ulli; ! public BulletScanner(Stack ulli) { this("",ulli); *************** *** 69,73 **** return MATCH_STRING; } ! /** * This is the logic that decides when a bullet tag can be allowed --- 69,73 ---- return MATCH_STRING; } ! /** * This is the logic that decides when a bullet tag can be allowed *************** *** 79,83 **** ulli.pop(); return true; ! } else return false; } --- 79,83 ---- ulli.pop(); return true; ! } else return false; } Index: CompositeTagScanner.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/scanners/CompositeTagScanner.java,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** CompositeTagScanner.java 8 Sep 2003 02:26:29 -0000 1.65 --- CompositeTagScanner.java 10 Sep 2003 03:38:19 -0000 1.66 *************** *** 1,27 **** // HTMLParser Library v1_4_20030907 - A java-based parser for HTML // Copyright (C) Dec 31, 2000 Somik Raha ! // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. ! // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! // // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 1,27 ---- // HTMLParser Library v1_4_20030907 - A java-based parser for HTML // Copyright (C) Dec 31, 2000 Somik Raha ! // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. ! // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! // // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 47,52 **** * <li>Tags which will trigger a match</li> * <li>Tags which when encountered before a legal end tag, should force a correction</li> ! * <li>Preventing more tags of its own type to appear as children ! * </ul> * Here are examples of each:<BR> * <B>Tags which will trigger a match</B> --- 47,52 ---- * <li>Tags which will trigger a match</li> * <li>Tags which when encountered before a legal end tag, should force a correction</li> ! * <li>Preventing more tags of its own type to appear as children ! * </ul> * Here are examples of each:<BR> * <B>Tags which will trigger a match</B> *************** *** 77,81 **** * <B>Preventing children of same type</B> * This is useful when you know that a certain tag can never hold children of its own type. ! * e.g. <FORM> can never have more form tags within it. If it does, it is an error and should * be corrected. The default behavior is to allow nesting. * <pre> --- 77,81 ---- * <B>Preventing children of same type</B> * This is useful when you know that a certain tag can never hold children of its own type. ! * e.g. <FORM> can never have more form tags within it. If it does, it is an error and should * be corrected. The default behavior is to allow nesting. * <pre> *************** *** 98,102 **** private Set endTagEnderSet; private boolean balance_quotes; ! public CompositeTagScanner(String [] nameOfTagToMatch) { this(nameOfTagToMatch,new String[] {}); --- 98,102 ---- private Set endTagEnderSet; private boolean balance_quotes; ! public CompositeTagScanner(String [] nameOfTagToMatch) { this(nameOfTagToMatch,new String[] {}); *************** *** 120,126 **** public CompositeTagScanner( ! String filter, ! String [] nameOfTagToMatch, ! String [] tagEnders, boolean allowSelfChildren) { this(filter,nameOfTagToMatch,tagEnders,new String[] {}, allowSelfChildren); --- 120,126 ---- public CompositeTagScanner( ! String filter, ! String [] nameOfTagToMatch, ! String [] tagEnders, boolean allowSelfChildren) { this(filter,nameOfTagToMatch,tagEnders,new String[] {}, allowSelfChildren); *************** *** 128,134 **** public CompositeTagScanner( ! String filter, ! String [] nameOfTagToMatch, ! String [] tagEnders, String [] endTagEnders, boolean allowSelfChildren) --- 128,134 ---- public CompositeTagScanner( ! String filter, ! String [] nameOfTagToMatch, ! String [] tagEnders, String [] endTagEnders, boolean allowSelfChildren) *************** *** 159,165 **** */ public CompositeTagScanner( ! String filter, ! String [] nameOfTagToMatch, ! String [] tagEnders, String [] endTagEnders, boolean allowSelfChildren, --- 159,165 ---- */ public CompositeTagScanner( ! String filter, ! String [] nameOfTagToMatch, ! String [] tagEnders, String [] endTagEnders, boolean allowSelfChildren, *************** *** 178,182 **** public Tag scan(Tag tag, String url, NodeReader reader,String currLine) throws ParserException { ! CompositeTagScannerHelper helper = new CompositeTagScannerHelper(this,tag,url,reader,currLine,balance_quotes); return helper.scan(); --- 178,182 ---- public Tag scan(Tag tag, String url, NodeReader reader,String currLine) throws ParserException { ! CompositeTagScannerHelper helper = new CompositeTagScannerHelper(this,tag,url,reader,currLine,balance_quotes); return helper.scan(); *************** *** 186,196 **** * Override this method if you wish to create any data structures or do anything * before the start of the scan. This is just after a tag has triggered the scanner ! * but before the scanner begins its processing. */ public void beforeScanningStarts() { } ! /** ! * This method is called everytime a child to the composite is found. It is useful when we * need to store special children seperately. Though, all children are collected anyway into a node list. */ --- 186,196 ---- * Override this method if you wish to create any data structures or do anything * before the start of the scan. This is just after a tag has triggered the scanner ! * but before the scanner begins its processing. */ public void beforeScanningStarts() { } ! /** ! * This method is called everytime a child to the composite is found. It is useful when we * need to store special children seperately. Though, all children are collected anyway into a node list. */ *************** *** 205,211 **** public final boolean isTagToBeEndedFor(Tag tag) { ! boolean isEndTag = tag instanceof EndTag; String tagName = tag.getTagName(); ! if ( ( isEndTag && endTagEnderSet.contains(tagName)) || (!isEndTag && tagEnderSet.contains(tagName)) --- 205,211 ---- public final boolean isTagToBeEndedFor(Tag tag) { ! boolean isEndTag = tag instanceof EndTag; String tagName = tag.getTagName(); ! if ( ( isEndTag && endTagEnderSet.contains(tagName)) || (!isEndTag && tagEnderSet.contains(tagName)) *************** *** 219,223 **** /** ! * Override this method to implement scanner logic that determines if the current scanner is * to be allowed. This is useful when there are rules which dont allow recursive tags of the same * type. @see BulletScanner --- 219,223 ---- /** ! * Override this method to implement scanner logic that determines if the current scanner is * to be allowed. This is useful when there are rules which dont allow recursive tags of the same * type. @see BulletScanner Index: DivScanner.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/scanners/DivScanner.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** DivScanner.java 8 Sep 2003 02:26:29 -0000 1.28 --- DivScanner.java 10 Sep 2003 03:38:19 -0000 1.29 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,27 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 18,27 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 36,40 **** public class DivScanner extends CompositeTagScanner { private static String MATCH_STRING [] = {"DIV"}; ! public DivScanner() { this(""); --- 36,40 ---- public class DivScanner extends CompositeTagScanner { private static String MATCH_STRING [] = {"DIV"}; ! public DivScanner() { this(""); Index: DoctypeScanner.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/scanners/DoctypeScanner.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** DoctypeScanner.java 8 Sep 2003 02:26:29 -0000 1.25 --- DoctypeScanner.java 10 Sep 2003 03:38:19 -0000 1.26 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,27 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 18,27 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 57,61 **** protected Tag createTag(TagData tagData, Tag tag, String url) throws ParserException { ! String tagContents = tag.getText(); tagContents=tagContents.substring(9,tagContents.length()); tagData.setTagContents(tagContents); --- 57,61 ---- protected Tag createTag(TagData tagData, Tag tag, String url) throws ParserException { ! String tagContents = tag.getText(); tagContents=tagContents.substring(9,tagContents.length()); tagData.setTagContents(tagContents); Index: FormScanner.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/scanners/FormScanner.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** FormScanner.java 8 Sep 2003 02:26:29 -0000 1.43 --- FormScanner.java 10 Sep 2003 03:38:19 -0000 1.44 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,27 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 18,27 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 51,55 **** { private static final String [] MATCH_ID = { "FORM" }; ! public static final String PREVIOUS_DIRTY_LINK_MESSAGE="Encountered a form tag after an open link tag.\nThere should have been an end tag for the link before the form tag began.\nCorrecting this.."; private boolean linkScannerAlreadyOpen=false; private static final String [] formTagEnders = {"HTML","BODY" --- 51,55 ---- { private static final String [] MATCH_ID = { "FORM" }; ! public static final String PREVIOUS_DIRTY_LINK_MESSAGE="Encountered a form tag after an open link tag.\nThere should have been an end tag for the link before the form tag began.\nCorrecting this.."; private boolean linkScannerAlreadyOpen=false; private static final String [] formTagEnders = {"HTML","BODY" *************** *** 73,77 **** parser.addScanner(new OptionTagScanner("-option",stack)); } ! /** * Extract the location of the image, given the string to be parsed, and the url --- 73,77 ---- parser.addScanner(new OptionTagScanner("-option",stack)); } ! /** * Extract the location of the image, given the string to be parsed, and the url *************** *** 145,149 **** public boolean evaluate(String s, TagScanner previousOpenScanner) { if (previousOpenScanner instanceof LinkScanner) { ! linkScannerAlreadyOpen = true; StringBuffer msg= new StringBuffer(); msg.append("<"); --- 145,149 ---- public boolean evaluate(String s, TagScanner previousOpenScanner) { if (previousOpenScanner instanceof LinkScanner) { ! linkScannerAlreadyOpen = true; StringBuffer msg= new StringBuffer(); msg.append("<"); *************** *** 153,162 **** feedback.warning(msg.toString()); // This is dirty HTML. Assume the current tag is ! // not a new link tag - but an end tag. This is actually a really wild bug - // Internet Explorer actually parses such tags. // So - we shall then proceed to fool the scanner into sending an endtag of type </A> // For this - set the dirty flag to true and return } ! else linkScannerAlreadyOpen = false; return super.evaluate(s, previousOpenScanner); --- 153,162 ---- feedback.warning(msg.toString()); // This is dirty HTML. Assume the current tag is ! // not a new link tag - but an end tag. This is actually a really wild bug - // Internet Explorer actually parses such tags. // So - we shall then proceed to fool the scanner into sending an endtag of type </A> // For this - set the dirty flag to true and return } ! else linkScannerAlreadyOpen = false; return super.evaluate(s, previousOpenScanner); *************** *** 166,170 **** throws ParserException { String formUrl = extractFormLocn(compositeTagData.getStartTag(),tagData.getUrlBeingParsed()); ! if (formUrl!=null && formUrl.length()>0) compositeTagData.getStartTag().setAttribute("ACTION",formUrl); if (!stack.empty () && (this == stack.peek ())) --- 166,170 ---- throws ParserException { String formUrl = extractFormLocn(compositeTagData.getStartTag(),tagData.getUrlBeingParsed()); ! if (formUrl!=null && formUrl.length()>0) compositeTagData.getStartTag().setAttribute("ACTION",formUrl); if (!stack.empty () && (this == stack.peek ())) Index: FrameScanner.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/scanners/FrameScanner.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** FrameScanner.java 8 Sep 2003 02:26:29 -0000 1.27 --- FrameScanner.java 10 Sep 2003 03:38:19 -0000 1.28 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,27 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 18,27 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 80,87 **** String msg; if (tag!=null) msg = tag.getText(); else msg = "null"; ! throw new ParserException("HTMLFrameScanner.extractFrameLocn() : Error in extracting frame location from tag "+msg,e); } } ! --- 80,87 ---- String msg; if (tag!=null) msg = tag.getText(); else msg = "null"; ! throw new ParserException("HTMLFrameScanner.extractFrameLocn() : Error in extracting frame location from tag "+msg,e); } } ! *************** *** 102,106 **** String frameUrl = extractFrameLocn(tag,url); String frameName = extractFrameName(tag,url); ! return new FrameTag(tagData,frameUrl,frameName); } --- 102,106 ---- String frameUrl = extractFrameLocn(tag,url); String frameName = extractFrameName(tag,url); ! return new FrameTag(tagData,frameUrl,frameName); } Index: FrameSetScanner.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/scanners/FrameSetScanner.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** FrameSetScanner.java 8 Sep 2003 02:26:29 -0000 1.26 --- FrameSetScanner.java 10 Sep 2003 03:38:19 -0000 1.27 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,27 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 18,27 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 48,52 **** { private static final String MATCH_NAME [] = {"FRAMESET"}; ! public FrameSetScanner() { --- 48,52 ---- { private static final String MATCH_NAME [] = {"FRAMESET"}; ! public FrameSetScanner() { Index: HeadScanner.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/scanners/HeadScanner.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** HeadScanner.java 8 Sep 2003 02:26:29 -0000 1.13 --- HeadScanner.java 10 Sep 2003 03:38:19 -0000 1.14 *************** *** 1,27 **** // HTMLParser Library v1_4_20030907 - A java-based parser for HTML // Copyright (C) Dec 31, 2000 Somik Raha ! // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. ! // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! // // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 1,27 ---- // HTMLParser Library v1_4_20030907 - A java-based parser for HTML // Copyright (C) Dec 31, 2000 Somik Raha ! // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. ! // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! // // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 45,49 **** this(""); } ! public HeadScanner(String filter) { super(filter,MATCH_NAME,ENDERS,END_TAG_ENDERS,false); --- 45,49 ---- this(""); } ! public HeadScanner(String filter) { super(filter,MATCH_NAME,ENDERS,END_TAG_ENDERS,false); *************** *** 53,57 **** return MATCH_NAME; } ! public Tag createTag( TagData tagData, --- 53,57 ---- return MATCH_NAME; } ! public Tag createTag( TagData tagData, Index: HtmlScanner.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/scanners/HtmlScanner.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** HtmlScanner.java 8 Sep 2003 02:26:29 -0000 1.28 --- HtmlScanner.java 10 Sep 2003 03:38:19 -0000 1.29 *************** *** 1,27 **** // HTMLParser Library v1_4_20030907 - A java-based parser for HTML // Copyright (C) Dec 31, 2000 Somik Raha ! // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. ! // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! // // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 1,27 ---- // HTMLParser Library v1_4_20030907 - A java-based parser for HTML // Copyright (C) Dec 31, 2000 Somik Raha ! // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. ! // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! // // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 36,40 **** public class HtmlScanner extends CompositeTagScanner { private static String MATCH_STRING [] = {"HTML"}; ! public HtmlScanner() { this(""); --- 36,40 ---- public class HtmlScanner extends CompositeTagScanner { private static String MATCH_STRING [] = {"HTML"}; ! public HtmlScanner() { this(""); Index: ImageScanner.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/scanners/ImageScanner.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** ImageScanner.java 8 Sep 2003 02:26:29 -0000 1.26 --- ImageScanner.java 10 Sep 2003 03:38:19 -0000 1.27 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,27 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 18,27 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 41,45 **** import org.htmlparser.util.ParserUtils; /** ! * Scans for the Image Tag. This is a subclass of TagScanner, and is called using a * variant of the template method. If the evaluate() method returns true, that means the * given string contains an image tag. Extraction is done by the scan method thereafter --- 41,45 ---- import org.htmlparser.util.ParserUtils; /** ! * Scans for the Image Tag. This is a subclass of TagScanner, and is called using a * variant of the template method. If the evaluate() method returns true, that means the * given string contains an image tag. Extraction is done by the scan method thereafter *************** *** 60,65 **** } /** ! * Overriding the constructor to accept the filter ! */ public ImageScanner(String filter,LinkProcessor processor) { --- 60,65 ---- } /** ! * Overriding the constructor to accept the filter ! */ public ImageScanner(String filter,LinkProcessor processor) { *************** *** 92,100 **** table = tag.redoParseAttributes(); relativeLink = (String) table.get("SRC"); ! ! } } if (relativeLink==null) return ""; else ! return processor.extract(relativeLink,url); } catch (Exception e) { --- 92,100 ---- table = tag.redoParseAttributes(); relativeLink = (String) table.get("SRC"); ! ! } } if (relativeLink==null) return ""; else ! return processor.extract(relativeLink,url); } catch (Exception e) { *************** *** 102,106 **** } } ! public String [] getID() { String [] ids = new String[1]; --- 102,106 ---- } } ! public String [] getID() { String [] ids = new String[1]; Index: InputTagScanner.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/scanners/InputTagScanner.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** InputTagScanner.java 8 Sep 2003 02:26:29 -0000 1.24 --- InputTagScanner.java 10 Sep 2003 03:38:19 -0000 1.25 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,27 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 18,27 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 40,44 **** super(); } ! public InputTagScanner(String filter) { --- 40,44 ---- super(); } ! public InputTagScanner(String filter) { *************** *** 51,55 **** return ids; } ! protected Tag createTag(TagData tagData, Tag tag, String url) throws ParserException { --- 51,55 ---- return ids; } ! protected Tag createTag(TagData tagData, Tag tag, String url) throws ParserException { Index: JspScanner.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/scanners/JspScanner.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** JspScanner.java 8 Sep 2003 02:26:29 -0000 1.25 --- JspScanner.java 10 Sep 2003 03:38:19 -0000 1.26 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,27 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 18,27 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com Index: LabelScanner.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/scanners/LabelScanner.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** LabelScanner.java 8 Sep 2003 02:26:29 -0000 1.31 --- LabelScanner.java 10 Sep 2003 03:38:19 -0000 1.32 *************** *** 1,27 **** // HTMLParser Library v1_4_20030907 - A java-based parser for HTML // Copyright (C) Dec 31, 2000 Somik Raha ! // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. ! // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! // // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 1,27 ---- // HTMLParser Library v1_4_20030907 - A java-based parser for HTML // Copyright (C) Dec 31, 2000 Somik Raha ! // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. ! // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! // // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 43,47 **** super(MATCH_NAME,new String [] {},false); } ! public LabelScanner(String filter) { super(filter,MATCH_NAME,new String [] {},false); --- 43,47 ---- super(MATCH_NAME,new String [] {},false); } ! public LabelScanner(String filter) { super(filter,MATCH_NAME,new String [] {},false); *************** *** 51,55 **** return MATCH_NAME; } ! public Tag createTag( TagData tagData, --- 51,55 ---- return MATCH_NAME; } ! public Tag createTag( TagData tagData, Index: LinkScanner.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/scanners/LinkScanner.java,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** LinkScanner.java 8 Sep 2003 02:26:29 -0000 1.51 --- LinkScanner.java 10 Sep 2003 03:38:19 -0000 1.52 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,27 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 18,27 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 44,48 **** import org.htmlparser.util.ParserUtils; /** ! * Scans for the Link Tag. This is a subclass of TagScanner, and is called using a * variant of the template method. If the evaluate() method returns true, that means the * given string contains an image tag. Extraction is done by the scan method thereafter --- 44,48 ---- import org.htmlparser.util.ParserUtils; /** ! * Scans for the Link Tag. This is a subclass of TagScanner, and is called using a * variant of the template method. If the evaluate() method returns true, that means the * given string contains an image tag. Extraction is done by the scan method thereafter *************** *** 57,61 **** private final static String ENDERS [] = { "TD","TR","FORM","LI","BODY", "HTML" }; private final static String ENDTAG_ENDERS [] = { "TD","TR","FORM","LI","BODY", "HTML" }; ! /** * Overriding the default constructor --- 57,61 ---- private final static String ENDERS [] = { "TD","TR","FORM","LI","BODY", "HTML" }; private final static String ENDTAG_ENDERS [] = { "TD","TR","FORM","LI","BODY", "HTML" }; ! /** * Overriding the default constructor *************** *** 64,76 **** this(""); } ! /** ! * Overriding the constructor to accept the filter */ public LinkScanner(String filter) { super(filter,MATCH_NAME,ENDERS,ENDTAG_ENDERS, false); ! processor = new LinkProcessor(); } ! public Tag createTag( TagData tagData, --- 64,76 ---- this(""); } ! /** ! * Overriding the constructor to accept the filter */ public LinkScanner(String filter) { super(filter,MATCH_NAME,ENDERS,ENDTAG_ENDERS, false); ! processor = new LinkProcessor(); } ! public Tag createTag( TagData tagData, *************** *** 85,90 **** mailto = link.indexOf(":"); link = link.substring(mailto+1); ! mailLink = true; ! } int javascript = link.indexOf("javascript:"); boolean javascriptLink = false; --- 85,90 ---- mailto = link.indexOf(":"); link = link.substring(mailto+1); ! mailLink = true; ! } int javascript = link.indexOf("javascript:"); boolean javascriptLink = false; *************** *** 92,99 **** link = link.substring(11); // this magic number is "javascript:".length() javascriptLink = true; ! } String accessKey = getAccessKey(compositeTagData.getStartTag()); String myLinkText = compositeTagData.getChildren().toString(); ! LinkTag linkTag = new LinkTag( tagData, --- 92,99 ---- link = link.substring(11); // this magic number is "javascript:".length() javascriptLink = true; ! } String accessKey = getAccessKey(compositeTagData.getStartTag()); String myLinkText = compositeTagData.getChildren().toString(); ! LinkTag linkTag = new LinkTag( tagData, *************** *** 110,116 **** return linkTag; } ! /** ! * Template Method, used to decide if this scanner can handle the Link tag type. If * the evaluation returns true, the calling side makes a call to scan(). * @param s The complete text contents of the Tag. --- 110,116 ---- return linkTag; } ! /** ! * Template Method, used to decide if this scanner can handle the Link tag type. If * the evaluation returns true, the calling side makes a call to scan(). * @param s The complete text contents of the Tag. *************** *** 122,126 **** char ch; boolean ret; ! // eat up leading blanks s = absorbLeadingBlanks (s); --- 122,126 ---- char ch; boolean ret; ! // eat up leading blanks s = absorbLeadingBlanks (s); *************** *** 140,145 **** /** ! * Extract the link from the ... [truncated message content] |