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 java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTypedProperties
(boolean substitute) TypedProperties
(TypedProperties.SubstitutionCallback callback, boolean substitute) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
entrySet()
getComments
(String key) Return the comment footer.Return the comment header.void
void
load
(InputStream is) void
void
prepare
(Map<String, TypedProperties> properties) void
void
save
(OutputStream os) void
void
Set the comment footer.void
Set the comment header.void
store
(OutputStream os, String comment) Store a properties into a output stream, preserving comments, special character, etc.static void
substitute
(Map<String, TypedProperties> properties, Map<String, Map<String, String>> dynamic, TypedProperties.SubstitutionCallback callback, boolean finalSubstitution) void
boolean
boolean
update
(TypedProperties properties) Methods inherited from class java.util.AbstractMap
clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, 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
-
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
public void clear() -
getHeader
Return the comment header.- Returns:
- the comment header
-
setHeader
Set the comment header.- Parameters:
header
- the header to use
-
substitute
-
prepare
-
substitute
public static void substitute(Map<String, TypedProperties> properties, Map<String, Map<String, String>> dynamic, TypedProperties.SubstitutionCallback callback, boolean finalSubstitution)
-