public class PropertiesImpl extends Properties
Properties
implementation that overrides
load(InputStream)
and store(OutputStream,String)
methods to specify the Charset
(as UTF-8
).Modifier and Type | Field and Description |
---|---|
protected static Charset |
CHARSET
UTF-8
|
defaults
Constructor and Description |
---|
PropertiesImpl()
|
PropertiesImpl(Properties defaults)
|
PropertiesImpl(Properties defaults,
File file)
|
PropertiesImpl(Properties defaults,
String resource)
|
Modifier and Type | Method and Description |
---|---|
Object |
configure(Object object)
|
static Object |
configure(Properties properties,
Object object)
See
configure(Object) . |
void |
load(InputStream in) |
protected static void |
load(Properties properties,
InputStream in) |
void |
store(OutputStream out,
String comment) |
protected static void |
store(Properties properties,
OutputStream out,
String comment) |
getProperty, getProperty, list, list, load, loadFromXML, propertyNames, save, setProperty, store, storeToXML, storeToXML, stringPropertyNames
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keys, keySet, merge, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, size, toString, values
public PropertiesImpl()
public PropertiesImpl(Properties defaults)
defaults
- A Properties
that contains default
values for any keys not found in this
Properties
.public PropertiesImpl(Properties defaults, File file) throws IOException
defaults
- The default Properties
.file
- The File
to load
(may be null
).IOException
- If file
is not null and cannot be
read.public PropertiesImpl(Properties defaults, String resource) throws IOException
defaults
- The default Properties
.resource
- The name of the resource
to load
(may be null
).IOException
- If resource
is not null and cannot be
read.public Object configure(Object object) throws Exception
Object
properties with values in
this
PropertiesImpl
. (An Object
"setter"
does not have to return void
to be invoked.)public void load(InputStream in) throws IOException
load
in class Properties
IOException
public void store(OutputStream out, String comment) throws IOException
store
in class Properties
IOException
protected static void load(Properties properties, InputStream in) throws IOException
IOException
protected static void store(Properties properties, OutputStream out, String comment) throws IOException
IOException
public static Object configure(Properties properties, Object object) throws Exception
configure(Object)
.properties
- The Properties
with the
configuration parameters..object
- The Object
to configure.Object
.Exception
- If any problem is encountered.Copyright © 2015–2020 Allen D. Ball. All rights reserved.