01: package com.meterware.httpunit.scripting;
02:
03: import com.meterware.httpunit.WebResponse;
04:
05: /********************************************************************************************************************
06: * $Id: ScriptingEngineFactory.java,v 1.4 2004/08/08 17:38:18 russgold Exp $
07: *
08: * Copyright (c) 2002, Russell Gold
09: *
10: * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
11: * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
12: * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
13: * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
14: *
15: * The above copyright notice and this permission notice shall be included in all copies or substantial portions
16: * of the Software.
17: *
18: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
19: * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
21: * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22: * DEALINGS IN THE SOFTWARE.
23: *
24: *******************************************************************************************************************/
25:
26: /**
27: *
28: * @author <a href="mailto:russgold@acm.org">Russell Gold</a>
29: **/
30: public interface ScriptingEngineFactory {
31:
32: /**
33: * Returns true if this engine is enabled.
34: */
35: public boolean isEnabled();
36:
37: /**
38: * Associates a scripting engine with the specified HTML web response.
39: **/
40: public void associate(WebResponse response);
41:
42: /**
43: * Runs the 'onload' event (if any) for the specified HTML web response. Will associate a scripting engine with
44: * the response if that has not already been done.
45: **/
46: public void load(WebResponse response);
47:
48: /**
49: * Determines whether script errors result in exceptions or warning messages.
50: */
51: public void setThrowExceptionsOnError(boolean throwExceptions);
52:
53: /**
54: * Returns true if script errors cause exceptions to be thrown.
55: */
56: public boolean isThrowExceptionsOnError();
57:
58: /**
59: * Returns the accumulated script error messages encountered. Error messages are accumulated only
60: * if 'throwExceptionsOnError' is disabled.
61: */
62: public String[] getErrorMessages();
63:
64: /**
65: * Clears the accumulated script error messages.
66: */
67: public void clearErrorMessages();
68:
69: }
|