java.lang.Object
java.util.Dictionary<K,V>
java.util.Hashtable<Object,Object>
java.util.Properties
org.glassfish.main.jul.cfg.LoggingProperties
- All Implemented Interfaces:
Serializable,Cloneable,Map<Object,Object>
Extended
Properties class. Same as Properties, it uses hashcodes for providing
values for property names, but the difference is in storing content to a file or stream, which is
sorted by keys.
Also provides some methods for more comfortable work.
Warning: using other than String objects can cause unexpected behavior.
- Author:
- David Matejcek
- See Also:
-
Field Summary
Fields inherited from class java.util.Properties
defaults -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty property table.LoggingProperties(Properties properties) Makes a copy of provided properties. -
Method Summary
Modifier and TypeMethodDescriptionclone()entrySet()keys()static LoggingPropertiesLoads aLoggingPropertiesfrom aFile.static LoggingPropertiesloadFrom(InputStream stream) Loads aLoggingPropertiesfrom anInputStream.voidWrites this property list (key and element pairs) in thisPropertiestable to the file in a format suitable for loading into aPropertiestable using theloadFrom(File)method.toInputStream(String comments) Writes this property list (key and element pairs) in thisPropertiestable to the file in a format suitable for loading into aPropertiestable using theloadFrom(InputStream)method.Methods inherited from class java.util.Properties
clear, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, equals, forEach, get, getOrDefault, getProperty, getProperty, hashCode, isEmpty, keySet, list, list, load, load, loadFromXML, merge, propertyNames, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, save, setProperty, size, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, toString, values
-
Constructor Details
-
LoggingProperties
public LoggingProperties()Creates an empty property table. -
LoggingProperties
Makes a copy of provided properties.- Parameters:
properties-
-
-
Method Details
-
keys
- Overrides:
keysin classProperties- Returns:
- a sorted
Enumerationof keys.
-
getPropertyNames
- Returns:
- all property names used in the current configuration.
-
entrySet
-
store
Writes this property list (key and element pairs) in thisPropertiestable to the file in a format suitable for loading into aPropertiestable using theloadFrom(File)method.- Parameters:
outputFile-comments-- Throws:
IOException
-
toInputStream
Writes this property list (key and element pairs) in thisPropertiestable to the file in a format suitable for loading into aPropertiestable using theloadFrom(InputStream)method.- Parameters:
comments-- Returns:
ByteArrayInputStream- Throws:
IOException
-
clone
- Overrides:
clonein classProperties
-
loadFrom
Loads aLoggingPropertiesfrom aFile.- Parameters:
file-- Returns:
LoggingProperties- Throws:
IOException
-
loadFrom
Loads aLoggingPropertiesfrom anInputStream.- Parameters:
stream-- Returns:
LoggingProperties- Throws:
IOException
-