Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexer
In directory sc8-pr-cvs1:/tmp/cvs-serv12839/src/org/htmlparser/lexer
Modified Files:
Page.java
Log Message:
Move LinkProcess out of scanners and into Page, untangling A, IMG and BASE scanners.
Move form action determination to tag.
The scanners have no special actions on behalf of tags anymore.
Index: Page.java
===================================================================
RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexer/Page.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** Page.java 27 Oct 2003 02:18:04 -0000 1.22
--- Page.java 29 Oct 2003 03:31:17 -0000 1.23
***************
*** 40,43 ****
--- 40,44 ----
import org.htmlparser.util.*;
+ import org.htmlparser.util.LinkProcessor;
/**
***************
*** 81,84 ****
--- 82,91 ----
/**
+ * The processor of relative links on this page.
+ * Holds any overridden base HREF.
+ */
+ protected LinkProcessor mProcessor;
+
+ /**
* Messages for page not there (404).
*/
***************
*** 121,124 ****
--- 128,132 ----
throw new IllegalArgumentException ("connection cannot be null");
setConnection (connection);
+ mProcessor = null;
}
***************
*** 142,145 ****
--- 150,154 ----
mConnection = null;
mUrl = null;
+ mProcessor = null;
}
***************
*** 163,166 ****
--- 172,176 ----
mConnection = null;
mUrl = null;
+ mProcessor = null;
}
***************
*** 660,663 ****
--- 670,694 ----
throw new ParserException (ioe.getMessage (), ioe);
}
+ }
+
+ /**
+ * Get the link processor associated with this page.
+ * @return The link processor that has the base HREF.
+ */
+ public LinkProcessor getLinkProcessor ()
+ {
+ if (null == mProcessor)
+ mProcessor = new LinkProcessor ();
+
+ return (mProcessor);
+ }
+
+ /**
+ * Set the link processor associated with this page.
+ * @param processor The new link processor for this page.
+ */
+ public void setLinkProcessor (LinkProcessor processor)
+ {
+ mProcessor = processor;
}
|