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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classstatic interfaceNested 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
FieldsModifier and TypeFieldDescriptionprivate final TypedProperties.SubstitutionCallbackstatic final Stringprivate final Propertiesprivate final boolean -
Constructor Summary
ConstructorsConstructorDescriptionTypedProperties(boolean substitute) TypedProperties(TypedProperties.SubstitutionCallback callback, boolean substitute) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()private static ObjectconvertFromString(String value) private static StringconvertToString(Object value) private voidentrySet()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) private static TypedProperties.SubstitutionCallbackMethods inherited from class java.util.AbstractMap
clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, size, toString, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
ENV_PREFIX
- See Also:
-
storage
-
callback
-
substitute
private final boolean substitute
-
-
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
-
ensureTyped
private void ensureTyped() -
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
-
wrap
private static TypedProperties.SubstitutionCallback wrap(InterpolationHelper.SubstitutionCallback cb) -
prepare
-
substitute
public static void substitute(Map<String, TypedProperties> properties, Map<String, Map<String, String>> dynamic, TypedProperties.SubstitutionCallback callback, boolean finalSubstitution) -
convertToString
-
convertFromString
-