[Httpunit-commit] CVS: httpunit/src/com/meterware/httpunit HTMLPage.java,1.20,1.21 HtmlErrorListener
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2002-12-25 15:23:14
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit
In directory sc8-pr-cvs1:/tmp/cvs-serv12005/src/com/meterware/httpunit
Modified Files:
HTMLPage.java HtmlErrorListener.java HttpUnitOptions.java
Removed Files:
JTidyPrintWriter.java
Log Message:
General cleanup of the parser classes
Index: HTMLPage.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HTMLPage.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- HTMLPage.java 24 Dec 2002 17:17:02 -0000 1.20
+++ HTMLPage.java 25 Dec 2002 15:23:11 -0000 1.21
@@ -260,12 +260,11 @@
}
-
public void parse( String text, URL pageURL ) throws SAXException, IOException {
HTMLParserFactory.getHTMLParser().parse( pageURL, text, new DocumentAdapter() {
public void setRootNode( Node rootNode ) { HTMLPage.this.setRootNode( rootNode ); }
public String getIncludedScript( String srcAttribute ) throws IOException { return HTMLPage.this.getIncludedScript( srcAttribute ); }
- public Scriptable getScriptableObject() { return HTMLPage.this.getScriptableObject(); }
+ public ScriptableDelegate getScriptableObject() { return HTMLPage.this.getScriptableObject().getParent(); }
});
}
Index: HtmlErrorListener.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HtmlErrorListener.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- HtmlErrorListener.java 14 Nov 2001 17:11:28 -0000 1.1
+++ HtmlErrorListener.java 25 Dec 2002 15:23:11 -0000 1.2
@@ -2,7 +2,7 @@
/********************************************************************************************************************
* $Id$
*
-* Copyright (c) 2001, Russell Gold
+* Copyright (c) 2001-2002, Russell Gold
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
@@ -19,24 +19,17 @@
* DEALINGS IN THE SOFTWARE.
*
*******************************************************************************************************************/
-import java.net.URL;
+import com.meterware.httpunit.parsing.HTMLParserListener;
/**
* This interface represents a listener which can receive notification of errors and warnings during the parsing
* of an HTML page.
*
+ * @deprecated as of 1.5.2, use HTMLParserListener
+ *
* @author <a href="mailto:bx...@bi...">Benoit Xhenseval</a>
- * @author <a href="mailto:rus...@ac...">Russell Gold</a>
+ * @author <a href="mailto:rus...@ht...">Russell Gold</a>
**/
-public interface HtmlErrorListener {
-
- /**
- * callback for HTML warning.
- **/
- public void warning( URL url, String msg, int line, int column );
+public interface HtmlErrorListener extends HTMLParserListener {
- /**
- * callback for HTML errors.
- **/
- public void error( URL url, String msg, int line, int column );
}
Index: HttpUnitOptions.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HttpUnitOptions.java,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- HttpUnitOptions.java 20 Dec 2002 01:59:47 -0000 1.35
+++ HttpUnitOptions.java 25 Dec 2002 15:23:11 -0000 1.36
@@ -21,6 +21,8 @@
*******************************************************************************************************************/
import com.meterware.httpunit.scripting.ScriptingEngineFactory;
+import com.meterware.httpunit.parsing.HTMLParserListener;
+import com.meterware.httpunit.parsing.HTMLParserFactory;
import java.util.Vector;
@@ -40,7 +42,7 @@
* Resets all options to their default values.
*/
public static void reset() {
- _parserWarningsEnabled = false;
+ HTMLParserFactory.reset();
_exceptionsOnErrorStatus = true;
_parameterValuesValidated = true;
_imagesTreatedAsAltText = false;
@@ -182,9 +184,19 @@
/**
* Returns true if parser warnings are enabled.
+ * @deprecated as of 1.5.2, use HTMLParserFactory#isParserWarningsEnabled
**/
public static boolean getParserWarningsEnabled() {
- return _parserWarningsEnabled;
+ return HTMLParserFactory.isParserWarningsEnabled();
+ }
+
+
+ /**
+ * If true, tells the parser to display warning messages. The default is false (warnings are not shown).
+ * @deprecated as of 1.5.2, use HTMLParserFactory#setParserWarningsEnabled
+ **/
+ public static void setParserWarningsEnabled( boolean enabled ) {
+ HTMLParserFactory.setParserWarningsEnabled( enabled );
}
@@ -206,14 +218,6 @@
/**
- * If true, tells the parser to display warning messages. The default is false (warnings are not shown).
- **/
- public static void setParserWarningsEnabled( boolean enabled ) {
- _parserWarningsEnabled = enabled;
- }
-
-
- /**
* Returns true if form parameter settings are checked.
**/
public static boolean getParameterValuesValidated() {
@@ -341,25 +345,29 @@
_autoRefresh = autoRefresh;
}
+
/**
* Remove an Html error listener.
+ * @deprecated as of 1.5.2, use HTMLParserfactory#removeHTMLParserListener
**/
- public static void removeHtmlErrorListener(HtmlErrorListener el) {
- _listeners.removeElement(el);
+ public static void removeHtmlErrorListener(HTMLParserListener el) {
+ HTMLParserFactory.removeHTMLParserListener( el );
}
/**
* Add an Html error listener.
+ * @deprecated as of 1.5.2, use HTMLParserfactory#addHTMLParserListener
**/
- public static void addHtmlErrorListener(HtmlErrorListener el) {
- _listeners.addElement(el);
+ public static void addHtmlErrorListener(HTMLParserListener el) {
+ HTMLParserFactory.addHTMLParserListener( el );
}
/**
* Get the list of Html Error Listeners
+ * @deprecated as of 1.5.2, removed with no replacement
**/
public static Vector getHtmlErrorListeners() {
- return _listeners;
+ return null;
}
@@ -470,8 +478,6 @@
private static boolean _acceptCookies = true;
- private static boolean _parserWarningsEnabled;
-
private static boolean _exceptionsOnErrorStatus = true;
private static boolean _parameterValuesValidated = true;
@@ -496,8 +502,6 @@
private static String _contentType = DEFAULT_CONTENT_TYPE;
- private static Vector _listeners;
-
private static String _scriptEngineClassName;
private static ScriptingEngineFactory _scriptingEngine;
@@ -508,7 +512,6 @@
static {
- _listeners = new Vector();
reset();
}
|