|
Openwings API Documentation (v1.1) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.openwings.identity.PropertyInitializer
This class is a utility for setting system properties. The main
motivation for this command is to allow more properties to be set than
could be successfully set on the Java command line alone (i.e. due to
string length). This class is a static singleton that should be
invoked prior to reading system properties. It will try to get the
property file to read from a PROPERTY_FILE_PROPERTY.
If that is unsuccessful it will attempt to load properties from the
DEFAULT_PROPERTY_FILE.
Properties read in may contain references to other properties and methods in the following form:
${property}
$
Property file inclusion is also supported using the built in property file comment syntax:
#!<myfile>
<myfile> can be a local file.
Included property files will be
processed first in order of occurence. Then the main file will be processed.
Forward references are supported for the set of properties read in, other
system properties are not resolved. Circular dependencies are not detected,
but a built-in safety measure will prevent dependencies from being resolved
beyond MAX_DEPENDENCY_DEPTH.
| Field Summary | |
static java.lang.String |
DEFAULT_PROPERTY_FILE
This constant denotes the default property file name. |
static java.lang.String |
FILE_INCLUDE
This constant denotes a file inclusion |
static int |
MAX_DEPENDENCY_DEPTH
This constant represents the maximum number of references to follow when resolving dependencies. |
static java.lang.String |
PROPERTY_FILE_PROPERTY
This constant denotes the property name used to get the properties file. |
static java.lang.String |
REFERENCE_BEGIN
This constant denotes the beginning of a reference. |
static java.lang.String |
REFERENCE_END
This constant denotes the ending of a reference. |
static char |
REFERENCE_METHOD
This constant denotes a method reference. |
| Method Summary | |
static java.lang.String |
getHost()
This method is a convenience function for getting the hostname in a property file. |
static void |
initialize()
This method is used to set properties from a property file. |
static void |
main(java.lang.String[] args)
This main is for testing purposes only. |
static java.lang.String |
translate(java.lang.String target)
This method can be used to translate strings containing property or method references. |
static java.lang.String |
translate(java.lang.String target,
java.util.Properties properties)
This method can be used to translate strings containing property or method references. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String PROPERTY_FILE_PROPERTY
public static final java.lang.String DEFAULT_PROPERTY_FILE
public static final java.lang.String REFERENCE_BEGIN
public static final java.lang.String REFERENCE_END
public static final char REFERENCE_METHOD
public static final java.lang.String FILE_INCLUDE
public static final int MAX_DEPENDENCY_DEPTH
| Method Detail |
public static java.lang.String translate(java.lang.String target)
target - string to be translated
public static java.lang.String translate(java.lang.String target,
java.util.Properties properties)
target - string to be translated
public static void initialize()
public static java.lang.String getHost()
$,
the reference will be replaced with the local host name
public static void main(java.lang.String[] args)
|
Openwings API Documentation (v1.1) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||