类 SortedProperties
- 所有已实现的接口:
Serializable,Cloneable,Map<Object,Object>
Specialization of
Properties that sorts properties alphanumerically
based on their keys.
This can be useful when storing the Properties instance in a
properties file, since it allows such files to be generated in a repeatable
manner with consistent ordering of properties.
Comments in generated properties files can also be optionally omitted.
- 从以下版本开始:
- 3.0
- 作者:
- Sam Brannen, TODAY 2021/1/29 15:19
- 另请参阅:
-
字段概要
字段修饰符和类型字段说明private static final Comparator<Map.Entry<Object,Object>> (专用程序包) static final Stringprivate static final Comparator<Object>private final boolean从类继承的字段 java.util.Properties
defaults -
构造器概要
构造器构造器说明SortedProperties(boolean omitComments) Construct a newSortedPropertiesinstance that honors the suppliedomitCommentsflag.SortedProperties(Properties properties, boolean omitComments) Construct a newSortedPropertiesinstance with properties populated from the suppliedPropertiesobject and honoring the suppliedomitCommentsflag. -
方法概要
修饰符和类型方法说明entrySet()Return a sorted set of the entries in thisPropertiesobject.keys()Return a sorted enumeration of the keys in thisPropertiesobject.keySet()Return a sorted set of the keys in thisPropertiesobject.voidstore(OutputStream out, String comments) voidvoidstoreToXML(OutputStream out, String comments) voidstoreToXML(OutputStream out, String comments, String encoding) 从类继承的方法 java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, equals, forEach, get, getOrDefault, getProperty, getProperty, hashCode, isEmpty, list, list, load, load, loadFromXML, merge, propertyNames, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, save, setProperty, size, storeToXML, stringPropertyNames, toString, values
-
字段详细资料
-
EOL
-
keyComparator
-
entryComparator
-
omitComments
private final boolean omitComments
-
-
构造器详细资料
-
SortedProperties
SortedProperties(boolean omitComments) Construct a newSortedPropertiesinstance that honors the suppliedomitCommentsflag.- 参数:
omitComments-trueif comments should be omitted when storing properties in a file
-
SortedProperties
SortedProperties(Properties properties, boolean omitComments) Construct a newSortedPropertiesinstance with properties populated from the suppliedPropertiesobject and honoring the suppliedomitCommentsflag.Default properties from the supplied
Propertiesobject will not be copied.- 参数:
properties- thePropertiesobject from which to copy the initial propertiesomitComments-trueif comments should be omitted when storing properties in a file
-
-
方法详细资料
-
store
- 覆盖:
store在类中Properties- 抛出:
IOException
-
store
- 覆盖:
store在类中Properties- 抛出:
IOException
-
storeToXML
- 覆盖:
storeToXML在类中Properties- 抛出:
IOException
-
storeToXML
- 覆盖:
storeToXML在类中Properties- 抛出:
IOException
-
keys
Return a sorted enumeration of the keys in thisPropertiesobject.- 覆盖:
keys在类中Properties- 另请参阅:
-
keySet
Return a sorted set of the keys in thisPropertiesobject.The keys will be converted to strings if necessary using
String.valueOf(Object)and sorted alphanumerically according to the natural order of strings. -
entrySet
Return a sorted set of the entries in thisPropertiesobject.The entries will be sorted based on their keys, and the keys will be converted to strings if necessary using
String.valueOf(Object)and compared alphanumerically according to the natural order of strings.
-