Package ball.util
Class PropertiesImpl
- java.lang.Object
-
- java.util.Dictionary<K,V>
-
- java.util.Hashtable<Object,Object>
-
- java.util.Properties
-
- ball.util.PropertiesImpl
-
- All Implemented Interfaces:
Serializable,Cloneable,Map<Object,Object>
public class PropertiesImpl extends Properties
Propertiesimplementation that overridesload(InputStream)andstore(OutputStream,String)methods to specify theCharset(asUTF-8).- Author:
- Allen D. Ball
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static CharsetCHARSETUTF-8-
Fields inherited from class java.util.Properties
defaults
-
-
Constructor Summary
Constructors Constructor Description PropertiesImpl()SeeProperties().PropertiesImpl(Properties defaults)PropertiesImpl(Properties defaults, File file)PropertiesImpl(Properties defaults, String resource)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectconfigure(Object object)static Objectconfigure(Properties properties, Object object)Seeconfigure(Object).voidload(InputStream in)protected static voidload(Properties properties, InputStream in)voidstore(OutputStream out, String comment)protected static voidstore(Properties properties, OutputStream out, String comment)-
Methods inherited from class java.util.Properties
clear, clone, 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
-
-
-
-
Constructor Detail
-
PropertiesImpl
public PropertiesImpl()
SeeProperties().
-
PropertiesImpl
public PropertiesImpl(Properties defaults)
- Parameters:
defaults- APropertiesthat contains default values for any keys not found in thisProperties.
-
PropertiesImpl
public PropertiesImpl(Properties defaults, File file) throws IOException
- Parameters:
defaults- The defaultProperties.file- TheFileto load (may benull).- Throws:
IOException- Iffileis not null and cannot be read.
-
PropertiesImpl
public PropertiesImpl(Properties defaults, String resource) throws IOException
- Parameters:
defaults- The defaultProperties.resource- The name of theresourceto load (may benull).- Throws:
IOException- Ifresourceis not null and cannot be read.
-
-
Method Detail
-
configure
public Object configure(Object object) throws Exception
Method to configure anObjectproperties with values inthisPropertiesImpl. (AnObject"setter" does not have to returnvoidto be invoked.)
-
load
public void load(InputStream in) throws IOException
- Overrides:
loadin classProperties- Throws:
IOException
-
store
public void store(OutputStream out, String comment) throws IOException
- Overrides:
storein classProperties- Throws:
IOException
-
load
protected static void load(Properties properties, InputStream in) throws IOException
- Throws:
IOException
-
store
protected static void store(Properties properties, OutputStream out, String comment) throws IOException
- Throws:
IOException
-
configure
public static Object configure(Properties properties, Object object) throws Exception
Seeconfigure(Object).- Parameters:
properties- ThePropertieswith the configuration parameters..object- TheObjectto configure.- Returns:
- The argument
Object. - Throws:
Exception- If any problem is encountered.
-
-