Package jodd.props
Class PropsData
java.lang.Object
jodd.props.PropsData
- All Implemented Interfaces:
Cloneable
Props data storage for base and profile properties.
Properties can be lookuped and modified only through this
class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprotected booleanIf set, duplicate props will be appended to the end, separated by comma.protected final HashMap<String, PropsEntry> protected PropsEntryprotected booleanWhen set, missing macros will be replaces with an empty string.protected PropsEntryprivate static final intprotected final HashMap<String, Map<String, PropsEntry>> protected booleanWhen set, empty properties will be skipped. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPropsData(HashMap<String, PropsEntry> properties, HashMap<String, Map<String, PropsEntry>> profiles) -
Method Summary
Modifier and TypeMethodDescriptionclone()intCounts base properties.intCounts profile properties.Extracts props to target map.protected voidextractMap(Map target, Map<String, PropsEntry> map, String[] profiles, String[] wildcardPatterns, String prefix) getBaseProperty(String key) Returns base property ornullif it doesn't exist.getProfileProperty(String profile, String key) Returns profile property.protected StringlookupValue(String key, String... profiles) Lookup props value through profiles and base properties.protected voidPuts key-value pair into the map, with respect of appending duplicate propertiesvoidputBaseProperty(String key, String value, boolean append) Adds base property.voidputProfileProperty(String key, String value, String profile, boolean append) Adds profile property.resolveMacros(String value, String... profiles) Resolves all macros in this props set.
-
Field Details
-
MAX_INNER_MACROS
private static final int MAX_INNER_MACROS- See Also:
-
APPEND_SEPARATOR
- See Also:
-
baseProperties
-
profileProperties
-
first
-
last
-
appendDuplicateProps
protected boolean appendDuplicatePropsIf set, duplicate props will be appended to the end, separated by comma. -
ignoreMissingMacros
protected boolean ignoreMissingMacrosWhen set, missing macros will be replaces with an empty string. -
skipEmptyProps
protected boolean skipEmptyPropsWhen set, empty properties will be skipped.
-
-
Constructor Details
-
PropsData
public PropsData() -
PropsData
protected PropsData(HashMap<String, PropsEntry> properties, HashMap<String, Map<String, PropsEntry>> profiles)
-
-
Method Details
-
clone
-
put
protected void put(String profile, Map<String, PropsEntry> map, String key, String value, boolean append) Puts key-value pair into the map, with respect of appending duplicate properties -
countBaseProperties
public int countBaseProperties()Counts base properties. -
putBaseProperty
Adds base property. -
getBaseProperty
Returns base property ornullif it doesn't exist. -
countProfileProperties
public int countProfileProperties()Counts profile properties. Note: this method is not that easy on execution. -
putProfileProperty
Adds profile property. -
getProfileProperty
Returns profile property. -
lookupValue
Lookup props value through profiles and base properties. Returnsnullif value not found. -
resolveMacros
Resolves all macros in this props set. Called on property lookup. -
extract
Extracts props to target map. This is all-in-one method, that does many things at once. -
extractMap
-