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