Class TypedProperties
Map to load / store / update untyped or typed properties.
The map is untyped if all properties are strings.
When this is the case, the properties are stored without
any encoding, else all properties are encoded using
the ConfigurationHandler.
- Author:
- gnodet
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTypedProperties(boolean substitute) TypedProperties(TypedProperties.SubstitutionCallback callback, boolean substitute) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()entrySet()getComments(String key) Return the comment footer.Return the comment header.voidvoidload(InputStream is) voidvoidprepare(Map<String, TypedProperties> properties) voidvoidsave(OutputStream os) voidvoidSet the comment footer.voidSet the comment header.voidstore(OutputStream os, String comment) Store a properties into a output stream, preserving comments, special character, etc.static voidsubstitute(Map<String, TypedProperties> properties, Map<String, Map<String, String>> dynamic, TypedProperties.SubstitutionCallback callback, boolean finalSubstitution) voidbooleanbooleanupdate(TypedProperties properties) Methods inherited from class AbstractMap
clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, size, toString, valuesMethods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
ENV_PREFIX
- See Also:
-
-
Constructor Details
-
TypedProperties
public TypedProperties() -
TypedProperties
public TypedProperties(boolean substitute) -
TypedProperties
-
TypedProperties
-
-
Method Details
-
load
- Throws:
IOException
-
load
- Throws:
IOException
-
load
- Throws:
IOException
-
load
- Throws:
IOException
-
save
- Throws:
IOException
-
save
- Throws:
IOException
-
save
- Throws:
IOException
-
store
Store a properties into a output stream, preserving comments, special character, etc. This method is mainly to be compatible with the java.util.Properties class.- Parameters:
os- an output stream.comment- this parameter is ignored as this Properties- Throws:
IOException- If storing fails
-
entrySet
-
put
-
get
-
put
-
put
-
put
-
update
-
update
-
getRaw
-
getComments
-
remove
-
clear
-
getHeader
-
setHeader
-
substitute
-
prepare
-
substitute
public static void substitute(Map<String, TypedProperties> properties, Map<String, Map<String, String>> dynamic, TypedProperties.SubstitutionCallback callback, boolean finalSubstitution)
-