jdk/src/share/classes/javax/script/ScriptEngineFactory.java
changeset 18803 c2fcefc8f0da
parent 18567 35b36d452864
child 21278 ef8a3a2a72f2
equal deleted inserted replaced
18802:68564211d16b 18803:c2fcefc8f0da
   194      */
   194      */
   195     public String getOutputStatement(String toDisplay);
   195     public String getOutputStatement(String toDisplay);
   196 
   196 
   197 
   197 
   198     /**
   198     /**
   199      * Returns A valid scripting language executable progam with given statements.
   199      * Returns a valid scripting language executable progam with given statements.
   200      * For instance an implementation for a PHP engine might be:
   200      * For instance an implementation for a PHP engine might be:
   201      * <p>
   201      * <p>
   202      * <pre>{@code
   202      * <pre>{@code
   203      * public String getProgram(String... statements) {
   203      * public String getProgram(String... statements) {
   204      *      $retval = "<?\n";
   204      *      String retval = "<?\n";
   205      *      int len = statements.length;
   205      *      int len = statements.length;
   206      *      for (int i = 0; i < len; i++) {
   206      *      for (int i = 0; i < len; i++) {
   207      *          $retval += statements[i] + ";\n";
   207      *          retval += statements[i] + ";\n";
   208      *      }
   208      *      }
   209      *      $retval += "?>";
   209      *      return retval += "?>";
   210      *
       
   211      * }
   210      * }
   212      * }</pre>
   211      * }</pre>
   213      *
   212      *
   214      *  @param statements The statements to be executed.  May be return values of
   213      *  @param statements The statements to be executed.  May be return values of
   215      *  calls to the <code>getMethodCallSyntax</code> and <code>getOutputStatement</code> methods.
   214      *  calls to the <code>getMethodCallSyntax</code> and <code>getOutputStatement</code> methods.