public static interface ApplicationConfig.OptionDef extends Serializable
public enum MyConfigOption implements OptionDef {
APP_CONFIG_FILE(
ApplicationConfig.CONFIG_FILE_NAME,
"Main configuration app file",
"myApp-config.properties",
String.class, true, true),
APP_NAME(
ApplicationConfig.CONFIG_FILE_NAME,
Application name,
"MyApp",
String.class, true, true);
public String key;
public String description;
public String defaultValue;
public Class> type;
public boolean isTransient;
public boolean isFinal;
private WikittyConfigOption(String key, String description,
String defaultValue, Class> type, boolean isTransient, boolean isFinal) {
this.key = key;
this.description = description;
this.defaultValue = defaultValue;
this.type = type;
this.isTransient = isTransient;
this.isFinal = isFinal;
}
@Override
public boolean isFinal() {
return isFinal;
}
@Override
public boolean isTransient() {
return isTransient;
}
@Override
public String getDefaultValue() {
return defaultValue;
}
@Override
public String getDescription() {
return description;
}
@Override
public String getKey() {
return key;
}
@Override
public Class> getType() {
return type;
}
@Override
public void setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue;
}
@Override
public void setTransient(boolean isTransient) {
this.isTransient = isTransient;
}
@Override
public void setFinal(boolean isFinal) {
this.isFinal = isFinal;
}
}
| Modifier and Type | Method and Description |
|---|---|
String |
getDefaultValue() |
String |
getDescription() |
String |
getKey() |
Class<?> |
getType() |
boolean |
isFinal() |
boolean |
isTransient() |
void |
setDefaultValue(String defaultValue)
Changes the default value of the option.
|
void |
setFinal(boolean isFinal)
Changes the final state of the option.
|
void |
setTransient(boolean isTransient)
Changes the transient state of the option.
|
String getKey()
Class<?> getType()
String getDescription()
String getDefaultValue()
boolean isTransient()
true si l'option ne peut etre sauvegardee sur
disque (utile par exemple pour les mots de passe, ...)boolean isFinal()
true si l'option n'est pas modifiable (utilise
par exemple pour la version de l'application, ...)void setDefaultValue(String defaultValue)
defaultValue - the new default value of the optionvoid setTransient(boolean isTransient)
isTransient - the new value of the transient statevoid setFinal(boolean isFinal)
isFinal - the new transient state valueCopyright © 2004-2013 CodeLutin. All Rights Reserved.