public class PropertyReader
extends java.lang.Object
修飾子とタイプ | フィールドと説明 |
---|---|
static java.lang.String |
DEFAULT_PROPBASE_NAME_PROPNAME |
static java.lang.String |
NESTED_PROP_SUFFIX
Suffix indicates nested property
|
static java.lang.String |
NESTED_SUBPROPS_DELIMITOR
Delimitor of properties of sub properties
|
static java.lang.String |
NESTED_SUBPROPS_PROPNAME
Property name for obtain sub properties of nested properties
|
static java.lang.String |
PROP_DELIMITOR
Delimitor of properties
|
static java.lang.String |
PROPERTY_NAME
Property name of PropertyReader
|
static java.lang.String |
RESPROP_NAME_SUFFIX
Suffix of resource file name in system properties
This is suffix for obtaining and setting resource file name.
|
修飾子とタイプ | メソッドと説明 |
---|---|
static java.util.Map |
getLocalPropertiesFor(java.lang.String propName)
Read local properties of specified name from resource file
|
static java.util.Map |
getProperties()
Read properties from resource file
|
static java.util.Map |
getPropertiesFor(java.lang.String propName)
Read properties of specified name from resource file
|
public static final java.lang.String PROPERTY_NAME
public static java.lang.String RESPROP_NAME_SUFFIX
This is suffix for obtaining and setting resource file name. Using property name "Property Name" concatenated with "RESPROP_NAME_SUFFIX", It enables to obtain resource file name from system properties and specify other resource file name differred from default resoure filen name named "Property Name"+".properties".
public static final java.lang.String DEFAULT_PROPBASE_NAME_PROPNAME
public static final java.lang.String PROP_DELIMITOR
public static final java.lang.String NESTED_PROP_SUFFIX
public static final java.lang.String NESTED_SUBPROPS_PROPNAME
public static final java.lang.String NESTED_SUBPROPS_DELIMITOR
public static java.util.Map getProperties() throws PropertyReadException
PropertyReadException
- Reading properties failed.
This method obtains properties started with "DEFAULT_PROPBASE_NAME" using getPropertiesFor(String) method. The gotten properties are cached.
public static java.util.Map getPropertiesFor(java.lang.String propName) throws PropertyReadException
propName
- Property namejava.lang.IllegalArgumentException
- Invalid argument is specified.PropertyReadException
- Reading properties failed.
This method obtains properties specified in argument from resource file. If resource file name is specified in system properties, the specified file is read.
Properties values can be specified in system properties(-D>key<=>value<
).
In this case, the properties started with properties name specified in argument is obtained.
If the value obtained from system properties is defined in properties file,
that of system properties is adopted.
The properties value can be nested. See PropertyReader.NestedPropertyReader.read(String).
Key
public static java.util.Map getLocalPropertiesFor(java.lang.String propName) throws PropertyReadException
propName
- Property namejava.lang.IllegalArgumentException
- Invalid argument is specified.PropertyReadException
- Reading properties failed.
This method obtains properties specified in argument from resource file. If resource file name is specified in system properties, the specified file is read.
This method is differ from getProperties(String) method in properties key. The properties does not have to start with property name specified in argument. If the value obtained from system properties is defined in properties file, that of system properties is adopted.
The properties value can be nested. See PropertyReader.NestedPropertyReader.read(String).
Key