|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjautil.BasicOptionSet
public class BasicOptionSet
A BasicOptionSet
is a basic collection of options settings,
with an associated JA Preferences node, and with a back up
options set, either or both of which may be null.
The option set is represented as a Java Properties
set;
this set is initialised at construction time from the associated
Preferences node, and optionally from the properties at a given
URL.
Field Summary | |
---|---|
static java.lang.String |
NULL_REP
Representation for null property value. |
Constructor Summary | |
---|---|
BasicOptionSet(BasicOptionSet backup,
java.net.URL baseurl,
java.util.Properties props)
Constructs a simple BasicOptionSet with the given backup
option set, base url and defining properties, but
with no key validator, preferences handler or preferences node. |
|
BasicOptionSet(BasicOptionSet backup,
java.net.URL baseurl,
java.net.URL propsurl,
JAPreferencesHandler japhdlr,
java.lang.String prefsname)
BasicOptionSet constructor with a null valid keys filter and
no preferences update. |
|
BasicOptionSet(BasicOptionSet backup,
java.net.URL baseurl,
java.net.URL propsurl,
JAPreferencesHandler japhdlr,
java.lang.String prefsname,
boolean updateprefs)
BasicOptionSet constructor with a null valid keys filter. |
|
BasicOptionSet(JAOptions.KeyChecker keychckr,
BasicOptionSet backup,
java.net.URL baseurl,
java.net.URL propsurl,
JAPreferencesHandler japhdlr,
java.lang.String prefsname,
boolean updateprefs)
BasicOptionSet constructor. |
|
BasicOptionSet(java.net.URL baseurl,
java.net.URL propsurl,
JAPreferencesHandler japhdlr,
java.lang.String prefsname)
BasicOptionSet constructor with a null valid keys filter,
a null back-up set, and no preferences update. |
|
BasicOptionSet(java.net.URL baseurl,
java.net.URL propsurl,
JAPreferencesHandler japhdlr,
java.lang.String prefsname,
boolean updateprefs)
BasicOptionSet constructor with a null valid keys filter
and a null back-up set. |
Method Summary | |
---|---|
static java.lang.String |
checkForNull(java.lang.String prop)
Returns the given property string value unless it is a string representation of null , in which case null is
returned; the empty string and the string "null" and its
case-insensitive invariants are taken to be valid representations of
null . |
java.lang.String |
getBaseURLProperty(java.lang.String key)
Performs a base URL look-up, just as getURLProperty(String) ,
except that the result is guaranteed to be valid as a base URL,
by appending a trailing slash character if necessary. |
java.lang.String |
getStringProperty(java.lang.String key)
Returns the string value of the property with the given key, or null if there is none. |
java.lang.String |
getURLProperty(java.lang.String key)
Looks up the URL property in this option set with the given key, and returns the result as a string; if found the URL is resolved against this option set's base URL, but any URL retrieved from the back-up option set is resolved against that set's base URL; the result is null if the look up fails. |
void |
updateStringProperty(java.lang.String key,
java.lang.String value)
Updates this option set's properties and the associated preferences node with the given key-value pair, provided the key is valid for this option set. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String NULL_REP
Constructor Detail |
---|
public BasicOptionSet(BasicOptionSet backup, java.net.URL baseurl, java.util.Properties props)
BasicOptionSet
with the given backup
option set, base url and defining properties, but
with no key validator, preferences handler or preferences node.
public BasicOptionSet(java.net.URL baseurl, java.net.URL propsurl, JAPreferencesHandler japhdlr, java.lang.String prefsname)
BasicOptionSet
constructor with a null valid keys filter,
a null back-up set, and no preferences update.
baseurl
- Base URL, used to resolve URLs looked up in this
option set.propsurl
- URL for the properties to be included in this option
set; may be null
.japhdlr
- JA Preferences handler to be used by this option set.prefsname
- Name of the JA preferences node associated with this
option set.public BasicOptionSet(BasicOptionSet backup, java.net.URL baseurl, java.net.URL propsurl, JAPreferencesHandler japhdlr, java.lang.String prefsname)
BasicOptionSet
constructor with a null valid keys filter and
no preferences update.
backup
- Back-up option set, used when look-up in this set
fails; may be null
.baseurl
- Base URL, used to resolve URLs looked up in this
option set.propsurl
- URL for the properties to be included in this option
set; may be null
.japhdlr
- JA Preferences handler to be used by this option set.prefsname
- Name of the JA preferences node associated with this
option set.public BasicOptionSet(java.net.URL baseurl, java.net.URL propsurl, JAPreferencesHandler japhdlr, java.lang.String prefsname, boolean updateprefs)
BasicOptionSet
constructor with a null valid keys filter
and a null back-up set.
baseurl
- Base URL, used to resolve URLs looked up in this
option set.propsurl
- URL for the properties to be included in this option
set; may be null
.japhdlr
- JA Preferences handler to be used by this option set.prefsname
- Name of the JA preferences node associated with this
option set.updateprefs
- Flag indicating whether or not the preferences node
associated with this set is to be permanently
updated with any newly loaded property definitions
in this set.public BasicOptionSet(BasicOptionSet backup, java.net.URL baseurl, java.net.URL propsurl, JAPreferencesHandler japhdlr, java.lang.String prefsname, boolean updateprefs)
BasicOptionSet
constructor with a null valid keys filter.
backup
- Back-up option set, used when look-up in this set
fails; may be null
.baseurl
- Base URL, used to resolve URLs looked up in this
option set.propsurl
- URL for the properties to be included in this option
set; may be null
.japhdlr
- JA Preferences handler to be used by this option set.prefsname
- Name of the JA preferences node associated with this
option set.updateprefs
- Flag indicating whether or not the preferences node
associated with this set is to be permanently
updated with any newly loaded property definitions
in this set.public BasicOptionSet(JAOptions.KeyChecker keychckr, BasicOptionSet backup, java.net.URL baseurl, java.net.URL propsurl, JAPreferencesHandler japhdlr, java.lang.String prefsname, boolean updateprefs)
BasicOptionSet
constructor.
keychckr
- Valid keys checker for this option set;
may be null
, meaning no filter.backup
- Back-up option set, used when look-up in this set
fails; may be null
.baseurl
- Base URL, used to resolve URLs looked up in this
option set.propsurl
- URL for the properties to be included in this option
set; may be null
.japhdlr
- JA Preferences handler to be used by this option set.prefsname
- Name of the JA preferences node associated with this
option set.updateprefs
- Flag indicating whether or not the preferences node
associated with this set is to be permanently
updated with any newly loaded property definitions
in this set.Method Detail |
---|
public void updateStringProperty(java.lang.String key, java.lang.String value)
public java.lang.String getStringProperty(java.lang.String key)
null
if there is none.
public java.lang.String getURLProperty(java.lang.String key)
null
if the look up fails.
public java.lang.String getBaseURLProperty(java.lang.String key)
getURLProperty(String)
,
except that the result is guaranteed to be valid as a base URL,
by appending a trailing slash character if necessary.
public static java.lang.String checkForNull(java.lang.String prop)
null
, in which case null
is
returned; the empty string and the string "null"
and its
case-insensitive invariants are taken to be valid representations of
null
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |