public class Preferences
extends Object
Container for shell preferences.
| Modifiers | Name | Description |
|---|---|---|
static String |
EDITOR_KEY |
Preference key storing the preferred editor command. |
static String |
PARSER_FLAVOR_KEY |
Preference key storing the parser flavor. |
static String |
PARSER_RELAXED |
Parser flavor value selecting relaxed parsing. |
static String |
PARSER_RIGID |
Parser flavor value selecting rigid parsing. |
static String |
SANITIZE_STACK_TRACE_KEY |
Preference key controlling stack-trace sanitization. |
static String |
SHOW_LAST_RESULT_KEY |
Preference key controlling whether the last result is shown. |
static String |
VERBOSITY_KEY |
Preference key storing the selected verbosity level. |
static Verbosity |
verbosity |
Current shell verbosity preference. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public static void |
addChangeListener(PreferenceChangeListener listener)Registers a listener for preference changes. |
|
public static void |
clear()Clears all stored shell preferences. |
|
public static String |
get(String name, String defaultValue)Returns a preference value with a fallback. |
|
public static String |
get(String name)Returns a preference value or null when absent. |
|
public static String |
getEditor()Returns the configured editor command. |
|
public static String |
getParserFlavor()Returns the configured parser flavor. |
|
public static boolean |
getSanitizeStackTrace()Returns whether stack traces should be sanitized before display. |
|
public static boolean |
getShowLastResult()Returns whether the shell should display the last evaluation result. |
|
public static String[] |
keys()Returns all stored preference keys. |
|
public static void |
put(String name, String value)Stores a preference value. |
Preference key storing the preferred editor command.
Preference key storing the parser flavor.
Parser flavor value selecting relaxed parsing.
Parser flavor value selecting rigid parsing.
Preference key controlling stack-trace sanitization.
Preference key controlling whether the last result is shown.
Preference key storing the selected verbosity level.
Current shell verbosity preference.
Registers a listener for preference changes.
listener - the listener to registerClears all stored shell preferences.
Returns a preference value with a fallback.
name - the preference keydefaultValue - the fallback value to return when the key is absent Returns a preference value or null when absent.
name - the preference keynull if absentReturns the configured editor command.
EDITOR
environment variable if none is storedReturns the configured parser flavor.
Returns whether stack traces should be sanitized before display.
true if stack traces should be sanitizedReturns whether the shell should display the last evaluation result.
true if the last result should be shownReturns all stored preference keys.