Package ru.bgcrm.util
Class Preferences
- Direct Known Subclasses:
Setup
ConcurrentHashMap
based implementation of ParameterMap
.-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
FieldsFields inherited from class ru.bgcrm.util.ParameterMap
configMap, EMPTY, mapPrint
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionentrySet()
getHashValuesWithPrefix
(String prefix) static String
insertVariablesValues
(String line, Map<String, String> data, Iterable<ParameterMap> includes, boolean validate) protected void
loadBundle
(String bundleName, Map<String, String> data, boolean validate) Loads configuration file to map.protected void
loadData
(String conf, String delim, Map<String, String> data, Iterable<ParameterMap> includes, boolean validate) parseObjects
(String prefix) Функция для разбора конфигураций вида: filetype.1.name=...parseObjectsNoOrder
(String prefix) static ParameterMap
processIncludes
(ConfigDAO configDao, String config, boolean validate) Inserts includes placed withvoid
void
Methods inherited from class ru.bgcrm.util.ParameterMap
fingerprint, get, getBigDecimal, getBoolean, getBoolean, getConfig, getConfig, getDataString, getDataString, getDataString, getInt, getInt, getLong, getLong, getSok, getSok, getSokBoolean, getSokBoolean, getSokLong, getSokLong, of, removeConfig, sub, subIndexed, subKeyed, validateConfig
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, remove, size, toString, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
data
-
-
Constructor Details
-
Preferences
public Preferences() -
Preferences
-
Preferences
-
-
Method Details
-
get
- Specified by:
get
in classParameterMap
-
entrySet
-
put
-
putAll
-
getDataMap
-
removeSub
-
loadBundle
Loads configuration file to map.- Parameters:
bundleName
- file name without '.properties' extension.data
- target map.validate
- check used in values variables.
-
loadData
protected void loadData(String conf, String delim, Map<String, String> data, Iterable<ParameterMap> includes, boolean validate) throws BGException- Throws:
BGException
-
insertVariablesValues
public static String insertVariablesValues(String line, Map<String, String> data, Iterable<ParameterMap> includes, boolean validate) throws BGException- Throws:
BGException
-
getHashValuesWithPrefix
-
processIncludes
public static ParameterMap processIncludes(ConfigDAO configDao, String config, boolean validate) throws Exception Inserts includes placed withinclude.ID=1
expressions.- Parameters:
configDao
- DAO for getting includes.config
- key-value lines of main configuration.validate
- check existence of includes configurations, variables.- Throws:
Exception
-
parseObjects
Функция для разбора конфигураций вида: filetype.1.name=... filetype.1.value=... filetype.2.name=... filetype.2.value.. разбирает в список Map с ключами name, value, код передается под ключем id.- Parameters:
prefix
-setup
-- Returns:
-
parseObjectsNoOrder
Description copied from class:ParameterMap
- Overrides:
parseObjectsNoOrder
in classParameterMap
- Returns:
-