| java.lang.Object org.hsqldb.persist.HsqlProperties
All known Subclasses: org.hsqldb.persist.HsqlDatabaseProperties,
HsqlProperties | public class HsqlProperties (Code) | | Wrapper for java.util.Properties to limit values to Specific types and
allow saving and loading.
author: fredt@users version: 1.7.2 since: 1.7.0 |
Method Summary | |
public void | addProperties(Properties props) | public void | addProperties(HsqlProperties props) | public static HsqlProperties | argArrayToProps(String[] arg, String type) Creates and populates an HsqlProperties Object from the arguments
array of a Main method. | public boolean | checkFileExists() | public static HsqlProperties | delimitedArgPairsToProps(String s, String pairsep, String dlimiter, String type) Creates and populates a new HsqlProperties Object using a string
such as "key1=value1;key2=value2". | public String[] | getErrorKeys() | public int | getIntegerProperty(String key, int defaultValue) | public int | getIntegerProperty(String key, int defaultValue, int minimum, int maximum) | public int | getIntegerProperty(String key, int defaultValue, int[] values) Choice limited to values list, defaultValue must be in the values list. | public Properties | getProperties() | public String | getProperty(String key) | public String | getProperty(String key, String defaultValue) | public boolean | isEmpty() | public boolean | isPropertyTrue(String key) | public boolean | isPropertyTrue(String key, boolean defaultValue) | public boolean | load() | public Enumeration | propertyNames() | public void | removeProperty(String key) | public void | save() Saves the properties. | public void | save(String fileString) Saves the properties using JDK2 method if present, otherwise JDK1. | public void | setFileName(String name) | public String | setProperty(String key, int value) | public String | setProperty(String key, boolean value) | public String | setProperty(String key, String value) | public String | setPropertyIfNotExists(String key, String value) |
NO_VALUE_FOR_KEY | final public static int NO_VALUE_FOR_KEY(Code) | | |
errorCodes | protected int[] errorCodes(Code) | | |
resource | protected boolean resource(Code) | | |
HsqlProperties | public HsqlProperties()(Code) | | |
argArrayToProps | public static HsqlProperties argArrayToProps(String[] arg, String type)(Code) | | Creates and populates an HsqlProperties Object from the arguments
array of a Main method. Properties are in the form of "-key value"
pairs. Each key is prefixed with the type argument and a dot before
being inserted into the properties Object.
"-?" is treated as a key with no value and not inserted.
|
delimitedArgPairsToProps | public static HsqlProperties delimitedArgPairsToProps(String s, String pairsep, String dlimiter, String type)(Code) | | Creates and populates a new HsqlProperties Object using a string
such as "key1=value1;key2=value2".
The string that represents the = sign above is specified as pairsep
and the one that represents the semicolon is specified as delimiter,
allowing any string to be used for either.
Leading / trailing spaces around the keys and values are discarded.
The string is parsed by (1) subdividing into segments by delimiter
(2) subdividing each segment in two by finding the first instance of
the pairsep (3) trimming each pair of segments from step 2 and
inserting into the properties object.
Each key is prefixed with the type argument and a dot before being
inserted.
Any key without a value is added to the list of errors.
|
getIntegerProperty | public int getIntegerProperty(String key, int defaultValue)(Code) | | |
getIntegerProperty | public int getIntegerProperty(String key, int defaultValue, int minimum, int maximum)(Code) | | |
getIntegerProperty | public int getIntegerProperty(String key, int defaultValue, int[] values)(Code) | | Choice limited to values list, defaultValue must be in the values list.
|
isEmpty | public boolean isEmpty()(Code) | | |
isPropertyTrue | public boolean isPropertyTrue(String key)(Code) | | |
isPropertyTrue | public boolean isPropertyTrue(String key, boolean defaultValue)(Code) | | |
save | public void save(String fileString) throws Exception(Code) | | Saves the properties using JDK2 method if present, otherwise JDK1.
|
|
|