langtools/src/jdk.jshell/share/classes/jdk/jshell/tool/JavaShellToolBuilder.java
author rfield
Tue, 20 Dec 2016 13:42:13 -0800
changeset 42843 a8d83044a192
child 43770 a321bed02000
permissions -rw-r--r--
8170162: jshell tool: no mechanism to programmatically launch 8170044: jshell tool: jshell missing from javax.tools.ToolProvider Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
42843
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
     1
/*
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
     2
 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
     4
 *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    10
 *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    15
 * accompanied this code).
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    16
 *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    20
 *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    23
 * questions.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    24
 */
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    25
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    26
package jdk.jshell.tool;
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    27
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    28
import java.io.InputStream;
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    29
import java.io.PrintStream;
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    30
import java.util.Locale;
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    31
import java.util.Map;
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    32
import java.util.prefs.Preferences;
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    33
import jdk.internal.jshell.tool.JShellToolBuilder;
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    34
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    35
/**
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    36
 * Interface to configure and run a Java shell tool instance. An instance of the
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    37
 * builder is created with the static {@link #builder} method. This builder can,
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    38
 * optionally, be configured with the configuration methods. All configuration
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    39
 * methods return the builder instance for use in chained initialization. All
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    40
 * configuration methods have sensible defaults which will be used if they are
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    41
 * not called.. After zero or more calls to configuration methods, the tool is
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    42
 * launched with a call to {@link #run(java.lang.String...) }.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    43
 */
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    44
public interface JavaShellToolBuilder {
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    45
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    46
    /**
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    47
     * Create a builder for launching the JDK jshell tool.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    48
     *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    49
     * @return a builder which can be used to configure and launch the jshell
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    50
     * tool
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    51
     */
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    52
    static JavaShellToolBuilder builder() {
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    53
        return new JShellToolBuilder();
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    54
    }
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    55
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    56
    /**
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    57
     * Set the input channels.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    58
     *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    59
     * @implSpec If this method is not called, the behavior should be
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    60
     * equivalent to calling {@code in(System.in, null)}.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    61
     *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    62
     * @param cmdIn source of command input
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    63
     * @param userIn source of input for running user code, or {@code null} to
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    64
     * extract user input from cmdIn
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    65
     * @return the {@code JavaShellToolBuilder} instance
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    66
     */
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    67
    JavaShellToolBuilder in(InputStream cmdIn, InputStream userIn);
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    68
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    69
    /**
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    70
     * Set the output channels. Same as {@code out(output, output, output)}.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    71
     *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    72
     * @implSpec If neither {@code out} method is called, the behavior should be
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    73
     * equivalent to calling {@code out(System.out)}.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    74
     *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    75
     * @param output destination of command feedback, console interaction, and
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    76
     * user code output
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    77
     * @return the {@code JavaShellToolBuilder} instance
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    78
     */
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    79
    JavaShellToolBuilder out(PrintStream output);
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    80
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    81
    /**
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    82
     * Set the output channels.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    83
     *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    84
     * @implSpec If neither {@code out} method is called, the behavior should be
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    85
     * equivalent to calling {@code out(System.out, System.out, System.out)}.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    86
     *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    87
     * @param cmdOut destination of command feedback including error messages
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    88
     * for users
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    89
     * @param console destination of console interaction
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    90
     * @param userOut destination of user code output.  For example, user snippet
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    91
     * {@code System.out.println("Hello")} when executed {@code Hello} goes to
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    92
     * userOut.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    93
     * @return the {@code JavaShellToolBuilder} instance
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    94
     */
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    95
    JavaShellToolBuilder out(PrintStream cmdOut, PrintStream console, PrintStream userOut);
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    96
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    97
    /**
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    98
     * Set the error channels. Same as {@code err(error, error)}.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
    99
     *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   100
     * @implSpec If neither {@code err} method is called, the behavior should be
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   101
     * equivalent to calling {@code err(System.err)}.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   102
     *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   103
     * @param error destination of tool errors, and
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   104
     * user code errors
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   105
     * @return the {@code JavaShellToolBuilder} instance
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   106
     */
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   107
    JavaShellToolBuilder err(PrintStream error);
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   108
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   109
    /**
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   110
     * Set the error channels.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   111
     *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   112
     * @implSpec If neither {@code err} method is called, the behavior should be
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   113
     * equivalent to calling {@code err(System.err, System.err, System.err)}.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   114
     *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   115
     * @param cmdErr destination of tool start-up and fatal errors
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   116
     * @param userErr destination of user code error output.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   117
     * For example, user snippet  {@code System.err.println("Oops")}
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   118
     * when executed {@code Oops} goes to userErr.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   119
     * @return the {@code JavaShellToolBuilder} instance
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   120
     */
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   121
    JavaShellToolBuilder err(PrintStream cmdErr, PrintStream userErr);
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   122
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   123
    /**
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   124
     * Set the storage mechanism for persistent information which includes
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   125
     * input history and retained settings.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   126
     *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   127
     * @implSpec If neither {@code persistence} method is called, the behavior
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   128
     * should be to use the tool's standard persistence mechanism.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   129
     *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   130
     * @param prefs an instance of {@link java.util.prefs.Preferences} that
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   131
     * is used to retrieve and store persistent information
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   132
     * @return the {@code JavaShellToolBuilder} instance
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   133
     */
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   134
    JavaShellToolBuilder persistence(Preferences prefs);
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   135
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   136
    /**
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   137
     * Set the storage mechanism for persistent information which includes
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   138
     * input history and retained settings.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   139
     *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   140
     * @implSpec If neither {@code persistence} method is called, the behavior
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   141
     * should be to use the tool's standard persistence mechanism.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   142
     *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   143
     * @param prefsMap  an instance of {@link java.util.Map} that
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   144
     * is used to retrieve and store persistent information
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   145
     * @return the {@code JavaShellToolBuilder} instance
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   146
     */
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   147
    JavaShellToolBuilder persistence(Map<String,String> prefsMap);
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   148
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   149
    /**
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   150
     * Set the source for environment variables.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   151
     *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   152
     * @implSpec If this method is not called, the behavior should be
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   153
     * equivalent to calling {@code env(System.getenv())}.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   154
     *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   155
     * @param vars the Map of environment variable names to values
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   156
     * @return the {@code JavaShellToolBuilder} instance
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   157
     */
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   158
    JavaShellToolBuilder env(Map<String,String> vars);
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   159
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   160
    /**
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   161
     * Set the locale.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   162
     *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   163
     * @implSpec If this method is not called, the behavior should be
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   164
     * equivalent to calling {@code locale(Locale.getDefault())}.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   165
     *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   166
     * @param locale the locale
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   167
     * @return the {@code JavaShellToolBuilder} instance
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   168
     */
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   169
    JavaShellToolBuilder locale(Locale locale);
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   170
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   171
    /**
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   172
     * Set to enable a command capturing prompt override.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   173
     *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   174
     * @implSpec If this method is not called, the behavior should be
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   175
     * equivalent to calling {@code promptCapture(false)}.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   176
     *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   177
     * @param capture if {@code true}, basic prompt is the {@code ENQ}
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   178
     * character and continuation prompt is the {@code ACK} character.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   179
     * If false, prompts are as set with set-up or user {@code /set} commands.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   180
     * @return the {@code JavaShellToolBuilder} instance
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   181
     */
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   182
    JavaShellToolBuilder promptCapture(boolean capture);
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   183
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   184
    /**
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   185
     * Run an instance of the Java shell tool as configured by the other methods
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   186
     * in this interface.  This call is not destructive, more than one call of
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   187
     * this method may be made from a configured builder.
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   188
     *
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   189
     * @param arguments the command-line arguments (including options), if any
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   190
     * @throws Exception an unexpected fatal exception
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   191
     */
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   192
    void run(String... arguments) throws Exception;
a8d83044a192 8170162: jshell tool: no mechanism to programmatically launch
rfield
parents:
diff changeset
   193
}