|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.util.ApplicationConfig
org.nuiton.util.ApplicationConfig.SubApplicationConfig
public static class ApplicationConfig.SubApplicationConfig
Permet de masquer un prefix. Il est possible d'avoir des valeurs par defaut. Par exemple:
monOption=toto monPrefix.monOption=titi
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.nuiton.util.ApplicationConfig |
|---|
ApplicationConfig.Action, ApplicationConfig.ActionDef, ApplicationConfig.CacheItem<T>, ApplicationConfig.OptionDef, ApplicationConfig.OptionList, ApplicationConfig.SubApplicationConfig |
| Field Summary | |
|---|---|
protected ApplicationConfig |
parent
|
protected String |
prefix
|
| Fields inherited from class org.nuiton.util.ApplicationConfig |
|---|
actions, ADJUSTING_PROPERTY, aliases, APP_NAME, cacheAction, cacheOption, classpath, CONFIG_ENCODING, CONFIG_FILE_NAME, CONFIG_PATH, context, curfile, defaults, env, etcfile, homefile, inParseOptionPhase, jvm, line, LIST_SEPARATOR, options, osName, pcs, unparsed, useOnlyAliases, userPath |
| Constructor Summary | |
|---|---|
ApplicationConfig.SubApplicationConfig(ApplicationConfig parent,
String prefix)
|
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
|
protected void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
|
Properties |
getFlatOptions(boolean replaceInner)
Surcharge de la methode pour que les options commencant par le prefix soit modifiee pour qu'elle est la meme cle sans le prefix. |
String |
getOption(String key)
Surcharge pour recherche la cle avec le prefix. |
Properties |
getOptions()
Get all options from configuration. |
Properties |
getOptionStartsWith(String prefix)
Surcharge pour recupere les valeurs commencant par le prefix demande en plus du prefix 'sub'. |
ApplicationConfig |
getParent()
|
String |
getPrefix()
|
boolean |
hasListeners(String propertyName)
|
boolean |
hasOption(String key)
Teste si un option existe ou non. |
protected void |
init(Properties defaults,
String configFilename)
On separt l'init du corps du constructeur, car les sous classes ne doivent pas l'executer. |
ApplicationConfig |
parse(String... args)
Parse option and call set necessary method, read jvm, env variable, Load configuration file and prepare Action. |
void |
removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
|
void |
setDefaultOption(String key,
String value)
Used to put default configuration option in config option. |
void |
setOption(String key,
String value)
Set option value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ApplicationConfig parent
protected String prefix
| Constructor Detail |
|---|
public ApplicationConfig.SubApplicationConfig(ApplicationConfig parent, String prefix)
| Method Detail |
|---|
protected void init(Properties defaults, String configFilename)
ApplicationConfig
init in class ApplicationConfigpublic ApplicationConfig getParent()
public String getPrefix()
public Properties getOptions()
ApplicationConfig
getOptions in class ApplicationConfigpublic void setDefaultOption(String key, String value)
ApplicationConfig
setDefaultOption in class ApplicationConfigkey - default property keyvalue - default property valuepublic boolean hasOption(String key)
ApplicationConfig
hasOption in class ApplicationConfigkey - la clef de l'option à tester
true si l'option existe, false sinon.public void setOption(String key, String value)
ApplicationConfig
setOption in class ApplicationConfigkey - property keyvalue - property valuepublic String getOption(String key)
getOption in class ApplicationConfigkey - La cle de l'option
public Properties getFlatOptions(boolean replaceInner)
getFlatOptions in class ApplicationConfigreplaceInner - le prefix à remplacer
public Properties getOptionStartsWith(String prefix)
getOptionStartsWith in class ApplicationConfigprefix - prefix to use
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)
firePropertyChange in class ApplicationConfigpublic void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
addPropertyChangeListener in class ApplicationConfigpublic void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
removePropertyChangeListener in class ApplicationConfigpublic boolean hasListeners(String propertyName)
hasListeners in class ApplicationConfigpublic ApplicationConfig parse(String... args) throws ArgumentsParserException
ApplicationConfig
parse in class ApplicationConfigargs - argument as main(String[] args)
ArgumentsParserException - if parsing failed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||