The lookup keys with examples are:
Using a StringLookup from the StringLookupFactory:
StringLookupFactory.INSTANCE.javaPlatformStringLookup().lookup("version");
Using a StringSubstitutor:
StringSubstitutor.createInterpolator().replace("... ${java:version} ..."));
The above examples convert "version" to the current VM version, for example,
"Java version 1.8.0_181".
Public access is through StringLookupFactory.
StringLookupFactory
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final JavaPlatformStringLookup | INSTANCE
Defines the singleton for this class. |
| private static final String | KEY_HARDWARE
|
| private static final String | KEY_LOCALE
|
| private static final String | KEY_OS
|
| private static final String | KEY_RUNTIME
|
| private static final String | KEY_VERSION
|
| private static final String | KEY_VM
|
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv String | |
| pack-priv String | Returns: system locale and file encoding information.Accessible through the Lookup key |
| pack-priv String | |
| pack-priv String | Returns: Java Runtime Environment information.Accessible through the Lookup key |
| private String | Returns: a system property value.a system property name. name)Gets the given system property. |
| private String | Returns: The prefix + a system property value.the prefix to use for the result string. prefix, final String a system property name. name)Gets the given system property. |
| pack-priv String | |
| public String | Returns: The value of the environment variable.the key to be looked up, may be null. key)Implements org. Looks up the value of the Java platform key. |
| public static void |
| INSTANCE | back to summary |
|---|---|
| pack-priv static final JavaPlatformStringLookup INSTANCE Defines the singleton for this class. | |
| KEY_HARDWARE | back to summary |
|---|---|
| private static final String KEY_HARDWARE
| |
| KEY_LOCALE | back to summary |
|---|---|
| private static final String KEY_LOCALE
| |
| KEY_OS | back to summary |
|---|---|
| private static final String KEY_OS
| |
| KEY_RUNTIME | back to summary |
|---|---|
| private static final String KEY_RUNTIME
| |
| KEY_VERSION | back to summary |
|---|---|
| private static final String KEY_VERSION
| |
| KEY_VM | back to summary |
|---|---|
| private static final String KEY_VM
| |
| JavaPlatformStringLookup | back to summary |
|---|---|
| private JavaPlatformStringLookup() No need to build instances for now. | |
| getHardware | back to summary |
|---|---|
| pack-priv String getHardware() Accessible through the Lookup key
| |
| getLocale | back to summary |
|---|---|
| pack-priv String getLocale() Accessible through the Lookup key
| |
| getOperatingSystem | back to summary |
|---|---|
| pack-priv String getOperatingSystem() Accessible through the Lookup key
| |
| getRuntime | back to summary |
|---|---|
| pack-priv String getRuntime() Accessible through the Lookup key
| |
| getSystemProperty | back to summary |
|---|---|
| private String getSystemProperty(final String name) Gets the given system property. | |
| getSystemProperty | back to summary |
|---|---|
| private String getSystemProperty(final String prefix, final String name) Gets the given system property. | |
| getVirtualMachine | back to summary |
|---|---|
| pack-priv String getVirtualMachine() Accessible through the Lookup key
| |
| lookup | back to summary |
|---|---|
| public String lookup(final String key) Implements org. Looks up the value of the Java platform key. The lookup keys with examples are:
| |
| main | back to summary |
|---|---|
| public static void main(final String[] args) The main method for running the JavaPlatformStringLookup.
| |