Enum Class SystemProperty
- All Implemented Interfaces:
Serializable, Comparable<SystemProperty>, Constable, EnabledAccessor, EnabledAccessor.EnabledMutator, EnabledAccessor.EnabledProperty, KeyAccessor<String>, ValueAccessor<String>, ValueAccessor.ValueMutator<String>, ValueAccessor.ValueProperty<String>
SystemProperty define values to be used at runtime. Them are passed
to a JVM by prefixing a "-D" to the actual "property=value" pair.-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E>Nested classes/interfaces inherited from interface EnabledAccessor
EnabledAccessor.EnabledBuilder<B>, EnabledAccessor.EnabledMutator, EnabledAccessor.EnabledPropertyNested classes/interfaces inherited from interface KeyAccessor
KeyAccessor.KeyBuilder<K,B>, KeyAccessor.KeyMutator<K>, KeyAccessor.KeyProperty<K> Nested classes/interfaces inherited from interface ValueAccessor
ValueAccessor.ValueBuilder<V,B>, ValueAccessor.ValueMutator<V>, ValueAccessor.ValueProperty<V> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionWhen set, then theArgsFilterfrom artifactrefcodes-cli(of grouporg.refcodes) with the according propertie's value is applied when parsing command line arguments via theorg.refcodescommand line parser (any implementation of theArgsParsertype).When set, then theSyntaxNotationfrom artifactrefcodes-cli(of grouporg.refcodes) with the according propertie's value is applied when parsing command line arguments via theorg.refcodescommand line parser (any implementation of theArgsParsertype).Pass as JVM argument via "-Dconfig.dir=path_to_your_config_dir" (where path_to_your_config_dir stands for the path to the directory where you placed configuration files such as the "runtimelogger.ini" file).Pass as JVM argument via-Dconsole.ansi=<true|false>where "true" or "false" forces ANSI to be used / not used by REFCODES.ORG artifacts, no matter what capabilities were detected for the hosting terminal.Pass as JVM argument via "-Dconsole.height=n" (where n stands for the number of lines).The console's line-break property.Pass as JVM argument via "-Dconsole.width=n" (where n stands for the number of chars per row).When set totrue, then marshaling (XML) documents will preserve array index information by using an index attribute for array elements in the produced XML.When set totrue, then unmarshaling (XML) documents will preserve the preserve the root element (envelope) when even when merely acting as an envelope.When set totrue, then unmarshaling (XML) documents will preserve empty elements, e.g. when parsing XML.The OS specific file encoding is retrieved by this system property.The OS specific file separator is retrieved by this system property.System property "host.seed" for the Host-Seed for host-related IDs.No-Proxy settings for theHTTP_PROXY_HOST(HTTP_PROXY_PORT) settings in a comma separated list ("localhost,127.0.0.0/8,127.0.1.1,127.0.1.1*,...")HTTP-Proxy host without a port ("http://my.company.org")HTTP-Proxy port ("3128")No-Proxy settings for theHTTPS_PROXY_HOST(HTTPS_PROXY_PORT) settings in a comma separated list ("localhost,127.0.0.0/8,127.0.1.1,127.0.1.1*,...")HTTPS-Proxy host without a port ("http://my.company.org")HTTP-Proxy port ("3128")To set up headless mode, set the appropriate system property ("https://www.oracle.com/technetwork/articles/javase/headless-136834.html").Location of the Java keystore file containing an application process's own certificate and private key.Password to access the private key from the keystore file specified byKEY_STORE_FILE.For Java keystore file format, this property has the value "jks" (or "JKS").Specifies the path to your application's launcher dir, e.g. the place where your JAR resides in.Sequence used by operating system to separate lines in text files.WhenisEnabled(), then additional REFCODES.ORG artifacts' debug information may be logged.WhenisEnabled(), then REFCODES.ORG artifacts' unit tests are (more) verbose,Pass as JVM argument via "-Dlogger.layout=<layout>" (where<layout>stands for the chosen layout for the REFCODES.ORG logger artifacts.).Pass as JVM argument via "-Dlogger.style=<style>" (where<style>stands for the chosen logger-style for the REFCODES.ORG logger artifacts.)Holds the string that is the name of the system property providing information about the context in which code is currently executing.Name of the system property that holds if this image is built as a shared library or an executable.Operating system name.Operating system name.Processor architecture on some systems (e.g.OS Name, might be something like "Linux" or "Windows"At least set on Ubuntu-Linux:.SOCKS-Proxy host without a port ("http://my.company.org")SOCKS-Proxy port ("3128")When set to "true" thenMapinstances in data-structures are preserved instead of converting them to arrays if possible by indirectly callingStructureUtility.toDataStructure(ImmutablePathTable, String)when invokingImmutablePathTable.toDataStructure().The OS specific temp folder path.Location of the Java keystore file containing the collection of CA certificates trusted by this application process (trust store).Password to unlock the keystore file (store password) specified byTRUST_STORE_FILE.For Java keystore file format, this property has the value "jks" (or "JKS").System variable holding the user's login name.System variable holding the user's current working directory.System variable holding the user's home folder path.System variable holding the user's login name.System variable holding the user's login name. -
Method Summary
Modifier and TypeMethodDescriptiongetKey()getValue()booleanbooleanisEnabledOr(boolean aDefaultValue) Returns the value for the property if present or if the default value if there is no such property.voidsetEnabled(boolean isEnabled) voidstatic StringtoPropertyValue(String aDefaultValue, SystemProperty aSystemProperty, EnvironmentVariable... aEnvironmentProperties) Gets the value for the provided properties, if non was found then the default value is taken.static StringtoPropertyValue(SystemProperty aSystemProperty, EnvironmentVariable... aEnvironmentProperties) Gets the value for the provided properties, if non was found then null is returned.static StringtoSystemPropertyName(String aKey) Converts the given key into a JVM system property name.static SystemPropertyReturns the enum constant of this class with the specified name.static SystemProperty[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface EnabledAccessor.EnabledProperty
letEnabledMethods inherited from interface ValueAccessor
getValueOr, hasValueMethods inherited from interface ValueAccessor.ValueProperty
letValue
-
Enum Constant Details
-
LOG_TESTS
WhenisEnabled(), then REFCODES.ORG artifacts' unit tests are (more) verbose, -
LOG_DEBUG
WhenisEnabled(), then additional REFCODES.ORG artifacts' debug information may be logged. -
ARGS_FILTER
When set, then the
ArgsFilterfrom artifactrefcodes-cli(of grouporg.refcodes) with the according propertie's value is applied when parsing command line arguments via theorg.refcodescommand line parser (any implementation of theArgsParsertype).Values as of the
ArgsFilterenumeration may beD,XX,D_XXorNONE. -
ARGS_NOTATION
When set, then the
SyntaxNotationfrom artifactrefcodes-cli(of grouporg.refcodes) with the according propertie's value is applied when parsing command line arguments via theorg.refcodescommand line parser (any implementation of theArgsParsertype).Values as of the
SyntaxNotationenumeration may beLOGICAL,GNU_POSIX,WINDOWSorDESCRIPTION. -
NATIVE_IMAGE_CODE
Holds the string that is the name of the system property providing information about the context in which code is currently executing. If the property returns the string given by
ImageInfo.PROPERTY_IMAGE_CODE_VALUE_BUILDTIMEthe code is executing in the context of image building (e.g. in a static initializer of a class that will be contained in the image). If the property returns the string given byImageInfo.PROPERTY_IMAGE_CODE_VALUE_RUNTIMEthe code is executing at image runtime. Otherwise the property is not set.Holds the string that will be returned by the system property for
ImageInfo.PROPERTY_IMAGE_CODE_KEYif code is executing in the context of image building (e.g. in a static initializer of class that will be contained in the image).PROPERTY_IMAGE_CODE_VALUE_BUILDTIME= "buildtime"PROPERTY_IMAGE_CODE_VALUE_RUNTIME= "runtime"
See also https://www.graalvm.org/sdk/javadoc/constant-values.html
-
NATIVE_IMAGE_KIND
Name of the system property that holds if this image is built as a shared library or an executable. If the property is
ImageInfo.PROPERTY_IMAGE_KIND_VALUE_EXECUTABLEthe image is built as an executable. If the property isImageInfo.PROPERTY_IMAGE_KIND_VALUE_SHARED_LIBRARYthe image is built as a shared library.PROPERTY_IMAGE_KIND_VALUE_EXECUTABLE= "executable"PROPERTY_IMAGE_KIND_VALUE_SHARED_LIBRARY= "shared"
See also https://www.graalvm.org/sdk/javadoc/constant-values.html
-
JAVA_AWT_HEADLESS
To set up headless mode, set the appropriate system property ("https://www.oracle.com/technetwork/articles/javase/headless-136834.html"). -
HTTP_PROXY_HOST
HTTP-Proxy host without a port ("http://my.company.org") -
HTTP_PROXY_PORT
HTTP-Proxy port ("3128") -
HTTPS_PROXY_HOST
HTTPS-Proxy host without a port ("http://my.company.org") -
HTTPS_PROXY_PORT
HTTP-Proxy port ("3128") -
SOCKS_PROXY_HOST
SOCKS-Proxy host without a port ("http://my.company.org") -
SOCKS_PROXY_PORT
SOCKS-Proxy port ("3128") -
STRUCT_KEEP_MAPS
When set to "true" thenMapinstances in data-structures are preserved instead of converting them to arrays if possible by indirectly callingStructureUtility.toDataStructure(ImmutablePathTable, String)when invokingImmutablePathTable.toDataStructure(). -
HOST_SEED
System property "host.seed" for the Host-Seed for host-related IDs. -
HTTP_NON_PROXY_HOSTS
No-Proxy settings for theHTTP_PROXY_HOST(HTTP_PROXY_PORT) settings in a comma separated list ("localhost,127.0.0.0/8,127.0.1.1,127.0.1.1*,...") -
HTTPS_NON_PROXY_HOSTS
No-Proxy settings for theHTTPS_PROXY_HOST(HTTPS_PROXY_PORT) settings in a comma separated list ("localhost,127.0.0.0/8,127.0.1.1,127.0.1.1*,...") -
OS_ARCH
Processor architecture on some systems (e.g. "AMD64"). -
OS_NAME
OS Name, might be something like "Linux" or "Windows" -
CONFIG_DIR
Pass as JVM argument via "-Dconfig.dir=path_to_your_config_dir" (where path_to_your_config_dir stands for the path to the directory where you placed configuration files such as the "runtimelogger.ini" file). -
FILE_SEPARATOR
The OS specific file separator is retrieved by this system property. -
FILE_ENCODING
The OS specific file encoding is retrieved by this system property. -
TEMP_DIR
The OS specific temp folder path. -
PROCESS_ID
At least set on Ubuntu-Linux:. -
LINE_SEPARATOR
Sequence used by operating system to separate lines in text files. -
OPERATING_SYSTEM_NAME
Operating system name. -
OPERATING_SYSTEM_VERSION
Operating system name. -
LAUNCHER_DIR
Specifies the path to your application's launcher dir, e.g. the place where your JAR resides in. Pass as JVM argument via "-Dlauncher.dir=/path/to/launcher/dir". -
CONSOLE_HEIGHT
Pass as JVM argument via "-Dconsole.height=n" (where n stands for the number of lines). -
CONSOLE_WIDTH
Pass as JVM argument via "-Dconsole.width=n" (where n stands for the number of chars per row). -
CONSOLE_ANSI
Pass as JVM argument via-Dconsole.ansi=<true|false>where "true" or "false" forces ANSI to be used / not used by REFCODES.ORG artifacts, no matter what capabilities were detected for the hosting terminal. -
CONSOLE_LINE_BREAK
The console's line-break property. Used to override any default line breaks for the REFCODES-ORG artifacts. -
LOGGER_LAYOUT
Pass as JVM argument via "-Dlogger.layout=<layout>" (where<layout>stands for the chosen layout for the REFCODES.ORG logger artifacts.). -
LOGGER_STYLE
Pass as JVM argument via "-Dlogger.style=<style>" (where<style>stands for the chosen logger-style for the REFCODES.ORG logger artifacts.) (seeorg.refcodes.textual.TextBoxStyle). -
USER_HOME
System variable holding the user's home folder path. -
USER_NAME
System variable holding the user's login name. -
USER_LANGUAGE
System variable holding the user's login name. -
USER_COUNTRY
System variable holding the user's login name. -
USER_DIR
System variable holding the user's current working directory. -
KEY_STORE_FILE
Location of the Java keystore file containing an application process's own certificate and private key. -
KEY_STORE_PASSWORD
Password to access the private key from the keystore file specified byKEY_STORE_FILE. -
KEY_STORE_TYPE
For Java keystore file format, this property has the value "jks" (or "JKS"). Its default value is already "jks". -
TRUST_STORE_FILE
Location of the Java keystore file containing the collection of CA certificates trusted by this application process (trust store). -
TRUST_STORE_PASSWORD
Password to unlock the keystore file (store password) specified byTRUST_STORE_FILE. -
TRUST_STORE_TYPE
For Java keystore file format, this property has the value "jks" (or "JKS"). Its default value is already "jks". -
DOCUMENT_ENVELOPE
When set totrue, then unmarshaling (XML) documents will preserve the preserve the root element (envelope) when even when merely acting as an envelope. As an (XML) document requires a root element, the root element often is provided merely as of syntactic reasons and must be omitted as of semantic reasons. Unmarshaling functionality therefore may by default skip the root elelemt, as this is considered merely to serve as an envelope. This behavior can be overridden by setting this property totrue. -
DOCUMENT_ARRAY_INDEX
When set totrue, then marshaling (XML) documents will preserve array index information by using an index attribute for array elements in the produced XML. -
DOCUMENT_PRESERVE_EMPTY
When set totrue, then unmarshaling (XML) documents will preserve empty elements, e.g. when parsing XML.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getKey
- Specified by:
getKeyin interfaceKeyAccessor<String>
-
getValue
- Specified by:
getValuein interfaceValueAccessor<String>
-
setValue
- Specified by:
setValuein interfaceValueAccessor.ValueMutator<String>
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceEnabledAccessor
-
isEnabledOr
public boolean isEnabledOr(boolean aDefaultValue) Returns the value for the property if present or if the default value if there is no such property.- Parameters:
aDefaultValue- The default value to take when no property was present.- Returns:
- The value of the property if present or the default value.
-
setEnabled
public void setEnabled(boolean isEnabled) - Specified by:
setEnabledin interfaceEnabledAccessor.EnabledMutator
-
toPropertyValue
public static String toPropertyValue(String aDefaultValue, SystemProperty aSystemProperty, EnvironmentVariable... aEnvironmentProperties) Gets the value for the provided properties, if non was found then the default value is taken. ASystemPropertyelements wins over theEnvironmentVariableelements. The precedingEnvironmentVariableelement wins over the succeedingEnvironmentVariableelement. The default value is taken if non property had a value (a String with length > 0).- Parameters:
aDefaultValue- The default value to take when none other value was set.aSystemProperty- The system-property passed viajava -D<name>=<value>aEnvironmentProperties- The properties looked for in the system's environment variables.- Returns:
- The best fitting value.
-
toPropertyValue
public static String toPropertyValue(SystemProperty aSystemProperty, EnvironmentVariable... aEnvironmentProperties) Gets the value for the provided properties, if non was found then null is returned. ASystemPropertyelements wins over theEnvironmentVariableelements. The precedingEnvironmentVariableelement wins over the succeedingEnvironmentVariableelement. A null is taken if non property had a value (a String with length > 0).- Parameters:
aSystemProperty- The system-property passed viajava -D<name>=<value>aEnvironmentProperties- The properties looked for in the system's environment variables.- Returns:
- The best fitting value or null if none was detected.
-
toSystemPropertyName
Converts the given key into a JVM system property name.The conversion transforms the key into a lower-case, dot-separated form. Word boundaries in camel-case identifiers are converted to dot separators, existing underscore characters are replaced by dots, and the resulting name is converted to lower case.
This convention follows common JVM system property naming practices and allows configuration values to be supplied consistently via
-Dcommand line arguments.- Parameters:
aKey- The key to be converted.- Returns:
- The corresponding system property name.
-