|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.arsdigita.util.parameter.AbstractParameterContext
Subject to change.
A base implementation of the ParameterContext
interface.
ParameterContext| Field Summary | |
static String |
versionId
|
| Constructor Summary | |
AbstractParameterContext()
Constructs a parameter context. |
|
| Method Summary | |
Object |
get(Parameter param)
Gets the unmarshaled value of param. |
Object |
get(Parameter param,
Object dephault)
Gets the unmarshaled value of param, returning
dephalt if param's value is null. |
Parameter[] |
getParameters()
Returns all the parameters registered on the parameter context. |
ErrorList |
load(ParameterReader reader)
Reads and unmarshals all values associated with the registered parameters from reader. |
void |
load(ParameterReader reader,
ErrorList errors)
Reads and unmarshals all values associated with the registered parameters from reader. |
protected void |
loadInfo()
Loads source data for ParameterInfo objects from
the file YourClass_parameter.properties next to
YourClass.class. |
void |
register(Parameter param)
Registers param to the context. |
void |
save(ParameterWriter writer)
Marshals and writes all values associated with the registered parameters to writer. |
void |
set(Parameter param,
Object value)
Sets the value of param to value. |
ErrorList |
validate()
Validates all values associated with the registered parameters. |
void |
validate(ErrorList errors)
Validates all values associated with the registered parameters. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String versionId
| Constructor Detail |
public AbstractParameterContext()
| Method Detail |
public final void register(Parameter param)
param to the context.
param - The Parameter being registered; it
cannot be nullpublic final Parameter[] getParameters()
ParameterContext
getParameters in interface ParameterContextParameter[] of all the parameters; it
cannot be nullParameterContext.getParameters()public Object get(Parameter param)
ParameterContextparam. If the
loaded value is null, param.getDefaultValue() is
returned.
get in interface ParameterContextparam - The named Parameter whose value to
retrieve; it cannot be null
paramParameterContext.get(Parameter)
public Object get(Parameter param,
Object dephault)
ParameterContextparam, returning
dephalt if param's value is null.
get in interface ParameterContextparam - The Parameter whose value to
retrieve; it cannot be nulldephault - The fallback default value; it may be null
param
or dephalt if the former is nullParameterContext.get(Parameter,Object)
public void set(Parameter param,
Object value)
ParameterContextparam to value.
set in interface ParameterContextparam - The Parameter whose value to set; it
cannot be nullvalue - The new value of param; it may be
nullParameterContext.get(Parameter,Object)public final ErrorList load(ParameterReader reader)
reader. Any errors are returned.
reader - The ParameterReader from which to
fetch the values; it cannot be null
ErrorList containing any errors
encountered while loading; it cannot be null
public final void load(ParameterReader reader,
ErrorList errors)
ParameterContextreader. If any errors are
encountered, they are added to errors.
load in interface ParameterContextreader - The ParameterReader from which to
fetch the values; it cannot be nullerrors - The ErrorList that captures any
errors while loading; it cannot be nullParameterContext.load(ParameterReader,ErrorList)public final ErrorList validate()
ErrorList containing validation errors;
it cannot be nullpublic final void validate(ErrorList errors)
ParameterContexterrors.
validate in interface ParameterContexterrors - The ErrorList that captures
validation errors; it cannot be nullParameterContext.validate(ErrorList)public final void save(ParameterWriter writer)
ParameterContextwriter.
save in interface ParameterContextwriter - The ParameterWriter to which values
are written; it cannot be nullParameterContext.save(ParameterWriter)protected final void loadInfo()
ParameterInfo objects from
the file YourClass_parameter.properties next to
YourClass.class.
YourClass_parameter.properties:
yourforum.notification_enabled.title=Flag to enable forum notifications yourforum.notification_enabled.purpose=Enables or disables forum notifications yourforum.notification_enabled.example=true yourforum.notifiaction_enabled.format=true|false
ParameterInfo
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||