public final class AppConstants extends PropertyLoader
When an instance is created, it tries to load the properties file specified
by the propertiesFileName
field
If a property exits with the name ADDITIONAL.PROPERTIES.FILE
that file is loaded also
Modifier and Type | Field and Description |
---|---|
static String |
ADDITIONAL_PROPERTIES_FILE_SUFFIX_KEY |
static String |
APPLICATION_SERVER_CUSTOMIZATION_PROPERTY |
static String |
APPLICATION_SERVER_TYPE_PROPERTY |
defaults
Modifier and Type | Method and Description |
---|---|
Properties |
getAppConstants(String keyBase)
Returns a list of
AppConstants which names begin with the keyBase |
Properties |
getAppConstants(String keyBase,
boolean useSystemProperties,
boolean useEnvironmentVariables)
Returns a list of
AppConstants which names begin with the keyBase |
static AppConstants |
getInstance()
Return the AppConstants root instance
|
static AppConstants |
getInstance(ClassLoader classLoader)
Retrieve an instance based on a ClassLoader.
|
StringTokenizer |
getTokenizedProperty(String key,
String defaults)
Deprecated.
|
protected void |
load(ClassLoader classLoader,
String filename)
Load the contents of a properties file.
|
void |
put(String key,
String value)
Add property to global (all) AppConstants
|
static void |
removeInstance() |
static void |
removeInstance(ClassLoader cl) |
Object |
setProperty(String key,
boolean value) |
Object |
setProperty(String key,
String value)
Add property to global AppConstants
|
get, getBoolean, getDouble, getInt, getListProperty, getListProperty, getLong, getProperty, getResolvedProperty, getString, getUnresolvedProperty, put
getProperty, list, list, load, load, loadFromXML, propertyNames, save, store, store, storeToXML, storeToXML, stringPropertyNames
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, getOrDefault, hashCode, isEmpty, keys, keySet, merge, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, size, toString, values
public static final String APPLICATION_SERVER_TYPE_PROPERTY
public static final String APPLICATION_SERVER_CUSTOMIZATION_PROPERTY
public static final String ADDITIONAL_PROPERTIES_FILE_SUFFIX_KEY
public static AppConstants getInstance()
public static AppConstants getInstance(ClassLoader classLoader)
cl
- ClassLoader to retrieve AppConstants frompublic static void removeInstance()
public static void removeInstance(ClassLoader cl)
@Deprecated public StringTokenizer getTokenizedProperty(String key, @Nonnull String defaults)
PropertyLoader.getResolvedProperty(String)
method.
Can be used to process lists of values.public Properties getAppConstants(String keyBase)
AppConstants
which names begin with the keyBasepublic Properties getAppConstants(String keyBase, boolean useSystemProperties, boolean useEnvironmentVariables)
AppConstants
which names begin with the keyBasepublic Object setProperty(String key, String value)
setProperty
in class Properties
protected void load(ClassLoader classLoader, String filename)
PropertyLoader
Optionally, this may be a comma-separated list of files to load, e.g.
which will cause both files to be loaded in the listed order.
log4j2.properties,DeploymentSpecifics.properties
load
in class PropertyLoader
Copyright © 2023 Frank!Framework. All rights reserved.