jdk/src/java.scripting/share/classes/javax/script/ScriptEngineFactory.java
author sundar
Mon, 05 Jan 2015 21:52:03 +0530
changeset 28293 ad51f784a352
parent 25859 3317bb8137f4
child 28296 7610e2b3018c
permissions -rw-r--r--
8068279: (typo in the spec) javax.script.ScriptEngineFactory.getLanguageName Reviewed-by: jlaskey, alanb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
18567
35b36d452864 8019320: Fix doclint issues in javax.script
darcy
parents: 18156
diff changeset
     2
 * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.script;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.util.List;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * <code>ScriptEngineFactory</code> is used to describe and instantiate
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * <code>ScriptEngines</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * <br><br>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * Each class implementing <code>ScriptEngine</code> has a corresponding factory
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * that exposes metadata describing the engine class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * <br><br>The <code>ScriptEngineManager</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * uses the service provider mechanism described in the <i>Jar File Specification</i> to obtain
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * instances of all <code>ScriptEngineFactories</code> available in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * the current ClassLoader.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
public interface ScriptEngineFactory {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
     * Returns the full  name of the <code>ScriptEngine</code>.  For
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
     * instance an implementation based on the Mozilla Rhino Javascript engine
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
     * might return <i>Rhino Mozilla Javascript Engine</i>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
     * @return The name of the engine implementation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    public String getEngineName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
     * Returns the version of the <code>ScriptEngine</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
     * @return The <code>ScriptEngine</code> implementation version.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    public String getEngineVersion();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * Returns an immutable list of filename extensions, which generally identify scripts
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     * written in the language supported by this <code>ScriptEngine</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
     * The array is used by the <code>ScriptEngineManager</code> to implement its
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     * <code>getEngineByExtension</code> method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     * @return The list of extensions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    public List<String> getExtensions();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * Returns an immutable list of mimetypes, associated with scripts that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     * can be executed by the engine.  The list is used by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * <code>ScriptEngineManager</code> class to implement its
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * <code>getEngineByMimetype</code> method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     * @return The list of mime types.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    public List<String> getMimeTypes();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     * Returns an immutable list of  short names for the <code>ScriptEngine</code>, which may be used to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     * identify the <code>ScriptEngine</code> by the <code>ScriptEngineManager</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     * For instance, an implementation based on the Mozilla Rhino Javascript engine might
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     * return list containing {&quot;javascript&quot;, &quot;rhino&quot;}.
18567
35b36d452864 8019320: Fix doclint issues in javax.script
darcy
parents: 18156
diff changeset
    83
     * @return an immutable list of short names
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    public List<String> getNames();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    /**
28293
ad51f784a352 8068279: (typo in the spec) javax.script.ScriptEngineFactory.getLanguageName
sundar
parents: 25859
diff changeset
    88
     * Returns the name of the scripting language supported by this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * <code>ScriptEngine</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * @return The name of the supported language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    public String getLanguageName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     * Returns the version of the scripting language supported by this
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * <code>ScriptEngine</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     * @return The version of the supported language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    public String getLanguageVersion();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * Returns the value of an attribute whose meaning may be implementation-specific.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * Keys for which the value is defined in all implementations are:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     * <li>ScriptEngine.ENGINE</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * <li>ScriptEngine.ENGINE_VERSION</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * <li>ScriptEngine.NAME</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     * <li>ScriptEngine.LANGUAGE</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     * <li>ScriptEngine.LANGUAGE_VERSION</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     * The values for these keys are the Strings returned by <code>getEngineName</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     * <code>getEngineVersion</code>, <code>getName</code>, <code>getLanguageName</code> and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * <code>getLanguageVersion</code> respectively.<br><br>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * A reserved key, <code><b>THREADING</b></code>, whose value describes the behavior of the engine
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * with respect to concurrent execution of scripts and maintenance of state is also defined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * These values for the <code><b>THREADING</b></code> key are:<br><br>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * <ul>
8404
800283ef7d59 7018459: javax.script code comments have issues with HTML4 validation and Accessibility compliance
sundar
parents: 8383
diff changeset
   119
     * <li><code>null</code> - The engine implementation is not thread safe, and cannot
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * be used to execute scripts concurrently on multiple threads.
8404
800283ef7d59 7018459: javax.script code comments have issues with HTML4 validation and Accessibility compliance
sundar
parents: 8383
diff changeset
   121
     * <li><code>&quot;MULTITHREADED&quot;</code> - The engine implementation is internally
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     * thread-safe and scripts may execute concurrently although effects of script execution
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     * on one thread may be visible to scripts on other threads.
8404
800283ef7d59 7018459: javax.script code comments have issues with HTML4 validation and Accessibility compliance
sundar
parents: 8383
diff changeset
   124
     * <li><code>&quot;THREAD-ISOLATED&quot;</code> - The implementation satisfies the requirements
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     * of &quot;MULTITHREADED&quot;, and also, the engine maintains independent values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * for symbols in scripts executing on different threads.
8404
800283ef7d59 7018459: javax.script code comments have issues with HTML4 validation and Accessibility compliance
sundar
parents: 8383
diff changeset
   127
     * <li><code>&quot;STATELESS&quot;</code> - The implementation satisfies the requirements of
800283ef7d59 7018459: javax.script code comments have issues with HTML4 validation and Accessibility compliance
sundar
parents: 8383
diff changeset
   128
     * <li><code>&quot;THREAD-ISOLATED&quot;</code>.  In addition, script executions do not alter the
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * mappings in the <code>Bindings</code> which is the engine scope of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * <code>ScriptEngine</code>.  In particular, the keys in the <code>Bindings</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * and their associated values are the same before and after the execution of the script.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * <br><br>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * Implementations may define implementation-specific keys.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     * @param key The name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * @return The value for the given parameter. Returns <code>null</code> if no
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     * value is assigned to the key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    public Object getParameter(String key);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * Returns a String which can be used to invoke a method of a  Java object using the syntax
21278
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 18803
diff changeset
   145
     * of the supported scripting language.  For instance, an implementation for a Javascript
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * engine might be;
21953
3facfc87b92e 8029478: Fix more doclint issues in javax.script
darcy
parents: 21278
diff changeset
   147
     *
18156
edb590d448c5 8016217: More javadoc warnings
alanb
parents: 9035
diff changeset
   148
     * <pre>{@code
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * public String getMethodCallSyntax(String obj,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     *                                   String m, String... args) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     *      String ret = obj;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     *      ret += "." + m + "(";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     *      for (int i = 0; i < args.length; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     *          ret += args[i];
8383
8156ef75e9e7 6604827: JavaDoc for ScriptEngineFactory.getMethodCallSyntax contains an error.
sundar
parents: 5506
diff changeset
   155
     *          if (i < args.length - 1) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     *              ret += ",";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     *          }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     *      }
8383
8156ef75e9e7 6604827: JavaDoc for ScriptEngineFactory.getMethodCallSyntax contains an error.
sundar
parents: 5506
diff changeset
   159
     *      ret += ")";
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     *      return ret;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * }
18156
edb590d448c5 8016217: More javadoc warnings
alanb
parents: 9035
diff changeset
   162
     * } </pre>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * @param obj The name representing the object whose method is to be invoked. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     * name is the one used to create bindings using the <code>put</code> method of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     * <code>ScriptEngine</code>, the <code>put</code> method of an <code>ENGINE_SCOPE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     * <code>Bindings</code>,or the <code>setAttribute</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     * of <code>ScriptContext</code>.  The identifier used in scripts may be a decorated form of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     * specified one.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     * @param m The name of the method to invoke.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     * @param args names of the arguments in the method call.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * @return The String used to invoke the method in the syntax of the scripting language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    public String getMethodCallSyntax(String obj, String m, String... args);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * Returns a String that can be used as a statement to display the specified String  using
21278
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 18803
diff changeset
   180
     * the syntax of the supported scripting language.  For instance, the implementation for a Perl
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     * engine might be;
21953
3facfc87b92e 8029478: Fix more doclint issues in javax.script
darcy
parents: 21278
diff changeset
   182
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     * <pre><code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     * public String getOutputStatement(String toDisplay) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     *      return "print(" + toDisplay + ")";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     * }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     * </code></pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     * @param toDisplay The String to be displayed by the returned statement.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     * @return The string used to display the String in the syntax of the scripting language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    public String getOutputStatement(String toDisplay);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
    /**
21278
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 18803
diff changeset
   198
     * Returns a valid scripting language executable program with given statements.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * For instance an implementation for a PHP engine might be:
21953
3facfc87b92e 8029478: Fix more doclint issues in javax.script
darcy
parents: 21278
diff changeset
   200
     *
18156
edb590d448c5 8016217: More javadoc warnings
alanb
parents: 9035
diff changeset
   201
     * <pre>{@code
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     * public String getProgram(String... statements) {
18803
c2fcefc8f0da 7187144: JavaDoc for ScriptEngineFactory.getProgram() contains an error
sundar
parents: 18567
diff changeset
   203
     *      String retval = "<?\n";
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     *      int len = statements.length;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     *      for (int i = 0; i < len; i++) {
18803
c2fcefc8f0da 7187144: JavaDoc for ScriptEngineFactory.getProgram() contains an error
sundar
parents: 18567
diff changeset
   206
     *          retval += statements[i] + ";\n";
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     *      }
18803
c2fcefc8f0da 7187144: JavaDoc for ScriptEngineFactory.getProgram() contains an error
sundar
parents: 18567
diff changeset
   208
     *      return retval += "?>";
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * }
18156
edb590d448c5 8016217: More javadoc warnings
alanb
parents: 9035
diff changeset
   210
     * }</pre>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     *  @param statements The statements to be executed.  May be return values of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     *  calls to the <code>getMethodCallSyntax</code> and <code>getOutputStatement</code> methods.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     *  @return The Program
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    public String getProgram(String... statements);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     * Returns an instance of the <code>ScriptEngine</code> associated with this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     * <code>ScriptEngineFactory</code>. A new ScriptEngine is generally
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     * returned, but implementations may pool, share or reuse engines.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     * @return A new <code>ScriptEngine</code> instance.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    public  ScriptEngine getScriptEngine();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
}