Class CommentedProperties
- All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionUse a Vector to keep a copy of lines containing a key, i.e.Use a Vector to keep a copy of lines that are a comment or 'blank'Fields inherited from class Properties
defaults -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a Property to the end of the CommentedProperties.voidAdd a comment or blank line or comment to the end of the CommentedProperties.clone()voidload(InputStream inStream) Load properties from the specified InputStream.voidload(InputStreamReader isr) Load properties from the specified InputStreamReader.voidstore(OutputStream out, String header) voidstore(OutputStream out, String header, String encoding) Write the properties to the specified OutputStream.voidMethods inherited from class Properties
clear, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, getProperty, getProperty, hashCode, isEmpty, keys, keySet, list, list, load, loadFromXML, merge, propertyNames, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, save, setProperty, size, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, toString, values
-
Field Details
-
lineData
-
keyData
-
-
Constructor Details
-
CommentedProperties
public CommentedProperties()
-
-
Method Details
-
load
Load properties from the specified InputStreamReader. Overload the load method in Properties so we can keep comment and blank lines.- Parameters:
isr- The InputStreamReader to read.- Throws:
IOException
-
load
Load properties from the specified InputStream. Overload the load method in Properties so we can keep comment and blank lines.- Overrides:
loadin classProperties- Parameters:
inStream- The InputStream to read.- Throws:
IOException
-
store
- Overrides:
storein classProperties- Throws:
IOException
-
store
public void store(OutputStream out, String header, String encoding, Map<String, String> missing) throws IOException- Throws:
IOException
-
store
Write the properties to the specified OutputStream.Overloads the store method in Properties so we can put back comment and blank lines.
- Parameters:
out- The OutputStream to write to.header- Ignored, here for compatibility w/ Properties.encoding- The encoding of the file- Throws:
IOException- If the creation of the writer fails.
-
add
-
addLine
Add a comment or blank line or comment to the end of the CommentedProperties.- Parameters:
line- The string to add to the end, make sure this is a comment or a 'whitespace' line.
-
clone
- Overrides:
clonein classProperties
-