edu.umd.cfar.lamp.apploader.prefs
Interface TriggerHandler
- All Known Implementing Classes:
- PrintUsage, PrintVersion, PropsToPrefs
- public interface TriggerHandler
A TriggerHandler
is created and invoked when
a preference is set (a preference trigger or flag) and an
instance of the property is found on the command line or in
the java properties set on start-up of the application.
An example of a trigger is a command line key/value pair.
Upon finding a trigger, the application loader uses the
preferences to find an implementation of TriggerHandler to
invoke.
A flag is like a trigger, but it does not take a value.
They share an interface (this one, TriggerHandler
,
for convenience.
The initial idea was just to convert the values into
RDF triples, but you are free to do whatever you wish upon
handling a trigger. For example, a '--help' flag may either
add a javabeans property set method in the preference model
that turns on 'help' mode, or it may invoke the
PrintUsage
handler, which prints usage to the command
line and exits the program.
- Author:
- davidm
Method Summary |
void |
invoke(PrefsManager prefs,
com.hp.hpl.jena.rdf.model.Resource def,
java.lang.String value)
Invokes the given trigger using the given command
line value, if it exists. |
invoke
public void invoke(PrefsManager prefs,
com.hp.hpl.jena.rdf.model.Resource def,
java.lang.String value)
- Invokes the given trigger using the given command
line value, if it exists.
- Parameters:
prefs
- The preferences to modify.def
- The RDF resource that defined the handlervalue
- The value passed from the command line or java property.