public class OAProperties extends Properties implements Serializable
This can be used for working with *.ini files.
Modifier and Type | Field and Description |
---|---|
protected boolean |
bUpperCase |
protected String |
fileName |
defaults
Constructor and Description |
---|
OAProperties()
Creates a new OAProperties.
|
OAProperties(InputStream in) |
OAProperties(String fname)
Creates a new OAProperties using the specified file name and loads the file.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
exists(String name)
Returns true if property name exists.
|
Object |
get(String name)
Retrieve value of a name/value pair where name is case insensitive.
|
boolean |
getBoolean(String name)
Returns a property that is converted to a "boolean".
|
boolean |
getBoolean(String name,
boolean bDefault)
Returns a property that is converted to a "boolean".
|
String |
getFileName()
Returns name of file that properties are associated with.
|
int |
getInt(String name)
Returns a property that is converted to an "int".
|
int |
getInt(String name,
int iDefault)
Returns a property that is converted to an "int".
|
String |
getProperty(String name)
Retrieve value of a name/value pair where name is case insensitive.
|
String |
getProperty(String name,
String defaultValue)
Retrieve value of a name/value pair where name is case insensitive.
|
String |
getString(String name)
Returns a property value.
|
String |
getString(String name,
String strDefault)
Returns a property value.
|
Enumeration |
keys() |
void |
load()
Load name/value properties from file.
|
void |
load(InputStream in)
Loads name/values from a file.
|
void |
load(String fileName)
Converts fileName path to correct system file.separator chars and loads name/value properties.
|
Object |
put(Object key,
Object obj)
Add/replace a name/value.
|
void |
put(String name,
boolean b)
Add/replace a name/value.
|
void |
put(String name,
int i)
Add/replace a name/value.
|
void |
putInt(String name,
int i)
Add/replace a name/value.
|
Object |
remove(Object key)
Remove a name/value.
|
void |
save()
Saves name/value properties to file.
|
void |
save(String fileName)
Converts fileName path to correct system file.separator chars and saves name/value properties to file.
|
void |
save(String fileName,
String title)
Converts fileName path to correct system file.separator chars and saves name/value properties to file.
|
void |
setFileName(String fname)
Sets name of file that properties are associated with.
|
Object |
setProperty(String name,
boolean value) |
Object |
setProperty(String name,
double value) |
Object |
setProperty(String name,
int value) |
Object |
setProperty(String name,
long value) |
Object |
setProperty(String name,
Object value) |
Object |
setProperty(String name,
String value) |
list, list, load, loadFromXML, propertyNames, save, store, store, storeToXML, storeToXML, stringPropertyNames
clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, putAll, putIfAbsent, rehash, remove, replace, replace, replaceAll, size, toString, values
protected String fileName
protected boolean bUpperCase
public OAProperties()
public OAProperties(String fname)
load()
public OAProperties(InputStream in)
public void setFileName(String fname)
public String getFileName()
public void load()
IllegalArgumentException
- if fileName has not been set.setFileName(java.lang.String)
public void load(String fileName)
public void load(InputStream in)
load
in class Properties
public void save()
IllegalArgumentException
- if fileName has not been set.setFileName(java.lang.String)
,
save(String,String)
public void save(String fileName)
public void save(String fileName, String title)
fileName
- name of file to store name/values.title
- is commented title used within file.public String getProperty(String name)
getProperty
in class Properties
name
- is not case sensitivepublic String getProperty(String name, String defaultValue)
getProperty
in class Properties
name
- is name of property and is not case sensitive.defaultValue
- is returned if property does not exist.public Object get(String name)
name
- is name of property and is not case sensitive.public Object setProperty(String name, String value)
setProperty
in class Properties
public Enumeration keys()
public void clear()
public Object put(Object key, Object obj)
public Object remove(Object key)
public void put(String name, int i)
name
- is name of property and is not case sensitive.
see #put(String,Object)public void put(String name, boolean b)
name
- is name of property and is not case sensitive.
see #put(String,Object)public void putInt(String name, int i)
name
- is name of property and is not case sensitive.
see #put(String,Object)public int getInt(String name)
name
- is name of property and is not case sensitive.public int getInt(String name, int iDefault)
name
- is name of property and is not case sensitive.public String getString(String name)
name
- is name of property and is not case sensitive.public String getString(String name, String strDefault)
name
- is name of property and is not case sensitive.public boolean getBoolean(String name)
name
- is name of property and is not case sensitive.public boolean getBoolean(String name, boolean bDefault)
name
- is name of property and is not case sensitive.public boolean exists(String name)
name
- is name of property and is not case sensitive.Copyright © 1999–2019 ViaOA. All rights reserved.