Package com.webmethods.rtl.tools
Class PrettyProperties
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<Object,
Object>
Read/Write properties file while preserving comments and formatting.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
protected static final String
protected static boolean
protected static final String
protected static String
protected static String
protected boolean
protected static final String
protected static final String
protected static String
protected static final String
Fields inherited from class java.util.Properties
defaults
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
static PrettyProperties
copy
(Properties src) protected static boolean
isCommentLine
(String line) Determine if the given line is a comment linevoid
load
(InputStream in) We override the load function so that we read in comment lines and preserve the original order of the items in the properties filevoid
protected PrettyProperties.NameValue
void
void
save
(OutputStream out, String header) protected String
saveConvert
(String theString, boolean escapeSpace) void
Methods inherited from class java.util.Properties
clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, getProperty, getProperty, hashCode, isEmpty, keys, keySet, list, list, loadFromXML, merge, propertyNames, putIfAbsent, rehash, remove, replace, replace, replaceAll, setProperty, size, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, toString, values
-
Field Details
-
specialCharsEscape
protected boolean specialCharsEscape -
DEBUG
protected static boolean DEBUG -
OS_PROP
-
WINDOWS_DETECT
-
COMMENT_CHAR1
- See Also:
-
COMMENT_CHAR2
- See Also:
-
DELIMINATOR
- See Also:
-
UNIXNEWLINE
- See Also:
-
WINDOWSNEWLINE
- See Also:
-
NEWLINE
-
m_sourceDataList
-
m_lineInSource
-
specialSaveChars
- See Also:
-
-
Constructor Details
-
PrettyProperties
public PrettyProperties() -
PrettyProperties
-
-
Method Details
-
copy
-
putAll
-
load
We override the load function so that we read in comment lines and preserve the original order of the items in the properties file- Overrides:
load
in classProperties
- Throws:
IOException
-
load
- Overrides:
load
in classProperties
- Throws:
IOException
-
put
-
remove
-
clear
public void clear() -
save
- Overrides:
save
in classProperties
-
store
- Overrides:
store
in classProperties
- Throws:
IOException
-
isCommentLine
Determine if the given line is a comment line -
parseLine
-
saveConvert
-