|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crosswire.common.config.Config
public class Config
Config is the core part of the configuration system; it is simply a
Collection of Choice
s.
Config does the following things:
Config does not attempt to make permanent copies of the config data because different apps may wish to store the data in different ways. Possible storage mechanisms include:
for license details.
The copyright to this program is held by it's authors.
Field Summary | |
---|---|
protected List |
keys
The array that stores the keys |
protected EventListenerList |
listenerList
The list of listeners |
protected Properties |
local
The set of local values |
private static Logger |
log
The log stream |
protected List |
models
The array that stores the models |
protected String |
title
The name for dialog boxes and properties files |
Constructor Summary | |
---|---|
Config(String title)
Config ctor |
Method Summary | |
---|---|
void |
add(org.jdom.Document xmlconfig,
ResourceBundle configResources)
Add the set of configuration options specified in the xml file. |
void |
add(String key,
Choice model)
Add a key/model pairing |
void |
addConfigListener(ConfigListener li)
Add an Exception listener to the list of things wanting to know whenever we capture an Exception |
void |
applicationToLocal()
Take the data in the application and copy it to the local storage area. |
protected void |
fireChoiceAdded(String key,
Choice model)
A Choice got added |
protected void |
fireChoiceRemoved(String key,
Choice model)
A Choice got added |
Choice |
getChoice(String key)
Step through the keys |
static String |
getLeaf(String key)
What is the Path of this key |
String |
getLocal(String name)
Get a configuration Choice (by name). |
Iterator |
getNames()
The set of Choice Names that we are controlling |
static String |
getPath(String key)
What is the Path of this key |
Iterator |
getPaths()
The set of Choice Names that we are controlling |
Properties |
getProperties()
Take the data in the local storage area and store it permanently |
String |
getTitle()
|
void |
localToApplication()
Take the data in the local storage area and copy it to the application. |
void |
localToPermanent(URL url)
Take the data in the local storage area and store it permanently, using the configured storage area. |
void |
permanentToLocal(URL url)
Take the data stored permanently and copy it to the local storage area, using the configured storage area |
void |
remove(String key)
Remove a key/model pairing |
void |
removeConfigListener(ConfigListener li)
Remove an Exception listener from the list of things wanting to know whenever we capture an Exception |
void |
setLocal(String name,
String value)
Set a configuration Choice (by name) to a new value. |
void |
setProperties(Properties prop)
Take the data stored permanetly and copy it to the local storage area, using the specified stream |
int |
size()
The number of Choices |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Logger log
protected String title
protected List keys
protected List models
protected Properties local
protected EventListenerList listenerList
Constructor Detail |
---|
public Config(String title)
title
- The name for dialog boxes and properties filesMethod Detail |
---|
public String getTitle()
public void add(String key, Choice model)
key
- The new namemodel
- The Field model to map to the keypublic void add(org.jdom.Document xmlconfig, ResourceBundle configResources)
xmlconfig
- The JDOM document to read.configResources
- contains the user level text for this configpublic void remove(String key)
key
- The name to killpublic Iterator getPaths()
public Iterator getNames()
public Choice getChoice(String key)
public int size()
public void setLocal(String name, String value)
public String getLocal(String name)
public void applicationToLocal()
public void localToApplication()
public void setProperties(Properties prop)
public Properties getProperties()
public void permanentToLocal(URL url) throws IOException
IOException
public void localToPermanent(URL url) throws IOException
IOException
public static String getPath(String key)
public static String getLeaf(String key)
public void addConfigListener(ConfigListener li)
public void removeConfigListener(ConfigListener li)
protected void fireChoiceAdded(String key, Choice model)
protected void fireChoiceRemoved(String key, Choice model)
|
Copyright ยจ 2003-2006 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |