|
Web-4-All v3.00 Plug-in API Specification | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.utoronto.atrc.web4all.configuration.AbstractSetterLauncher
Class that provides the base structure of a SetterLauncher without actually implementing the methods of the interface. It also provides a number of utility methods that a specific SetterLauncher might want to use.
| Constructor Summary | |
AbstractSetterLauncher()
Initialize the SetterLauncher with all of its internal data initially set to "null", and then perform the initialization proper via a call to init(). |
|
| Method Summary | |
protected void |
addArgToArray(java.lang.String inParameter,
java.lang.String inValue)
Add the given parameter's value to the command line argument array. |
protected void |
clearParamsWritten(java.lang.String inTechType)
Utility for setting parameters' written state array to false. |
protected void |
closeOutput()
Flush and close the current output file. |
protected java.lang.String[] |
createArgsArray(int inNumArgs)
Create an empty String array to hold a set of command line arguments. |
protected java.io.PrintWriter |
createOutput(java.lang.String inFullPath)
Create the output file from a full path to the file. |
protected java.io.PrintWriter |
createOutput(java.lang.String inFullPath,
boolean inAppend)
Create the output file from a full path to the file. |
protected java.io.PrintWriter |
createOutput(java.lang.String inHomeDir,
java.lang.String inFileName)
Create the output file, given a relative path to a directory, and a file name. |
protected java.io.PrintWriter |
createOutput(java.lang.String inHomeDir,
java.lang.String inFileName,
boolean useSubDir)
Create the output file, given a relative or absolute path to a directory, a file name, and whether the directory is a sub-directory. |
protected void |
createReadProcessIStreams()
Allocate the ReadProcessIStreams object, if desired. |
protected abstract void |
doWriteSetting(java.lang.String inParameter,
java.lang.String inValue)
Abstract method for "writing" the setting. |
ParameterState |
findParameter(java.lang.String inTechType,
java.lang.String inAccLipPrefName)
Given a type of technology and a preference name from the ACCLIP, determine if it is a parameter this plug-in handles. |
ParameterState |
findParameter(java.lang.String inTechType,
java.lang.String inAccLipPrefName,
boolean isGeneric)
Given a type of technology and a preference name from the ACCLIP document, determine if it is a parameter this technology handles. |
java.lang.String |
getAppID()
Retrieve the application ID for the SetterLauncher. |
org.w3c.dom.Element |
getAppSettings()
Retrieve the root of the ACCLIP DOM for the current technology that this SetterLauncher is processing. |
protected java.lang.String[] |
getArgsArray()
Retrieve the array of strings that represent a set of command line arguments. |
protected java.util.ResourceBundle |
getArgsIndexMap()
Retrieve the argument index map for a command line argument string. |
ControlHub |
getControlHub()
Get the Control Hub property. |
protected java.lang.String |
getLocalProperty(java.lang.String inPropName)
Retrieve one of the plug-in's local properties. |
protected java.lang.Process |
getProcess()
Retrieve the process launched by this SetterLauncher. |
java.lang.String |
getValueValue(org.w3c.dom.Element inPref)
Given a prefs element, find its Web4AllConstansts.VAL_ATT attribute and return
the value of that attribute. |
protected void |
handlePref(java.lang.String inTechType,
org.w3c.dom.Element inPref)
Given a technology type and a preference for that type, determine if it is one that this SetterLauncher handles. |
protected void |
handlePref(java.lang.String inTechType,
org.w3c.dom.Element inPref,
boolean isGeneric)
Given a technology type and a preference for that type, determine if it is one that this SetterLauncher handles. |
protected void |
handleProcessIStreams(java.lang.Process inProcess)
Activate the ReadProcessIStreams object. |
protected void |
handleProcessIStreams(java.lang.Process inProcess,
boolean logFlag)
Activate the ReadProcessIStreams object. |
protected void |
handleUnwrittenParams(java.lang.String inTechType)
Write out default values for those preferences that were not in the ACCLIP document. |
protected abstract void |
init()
Class specific initialization -- must be overridden. |
boolean |
initLocalProps()
Basic implementation for acquiring the local properties of the plug-in. |
void |
kill()
Basic implementation of the SetterLauncher kill method. |
float |
linearCalcTechVal(java.lang.String inAccLipVal,
float inSlope,
float inIntercept)
Utility to convert a floating point ACCLIP preference value to a parameter value. |
protected void |
loopThru3rdPartyPrefs(java.lang.String inTechType,
org.w3c.dom.Element in3rdPartyPrefs)
Loop thru the specific preferences for the given type of technology. |
protected void |
loopThruGenerics(java.lang.String inTechType,
org.w3c.dom.Element inGenericContainer)
Loop through the generic preferences from the ACCLIP for the given type of technology. |
protected java.lang.String |
mapValue(java.lang.String inParam,
java.lang.String inValue)
Map the value retrieved from the preferences document to the parameter's value. |
protected void |
setAppID(org.w3c.dom.Element in3rdPartyPrefs)
Set the application ID for this SetterLauncher based on an application preferences element from the ACCLIP. |
void |
setAppID(java.lang.String inAppID)
Set the application ID for the SetterLauncher. |
void |
setAppSettings(org.w3c.dom.Element inAppSettings)
Set the root of the ACCLIP document for the current technology that the SetterLauncher is processing. |
protected void |
setArgsArray(java.lang.String[] ioArgsArray)
Use the given String array for the command line arguments. |
protected void |
setArgsIndexMap(java.util.ResourceBundle inArgsIndexMap)
Set the argument index map for a command line argument array. |
void |
setControlHub(ControlHub inControlHub)
Set the Control Hub property. |
protected void |
setProcess(java.lang.Process inProcess)
Set the process launched by this SetterLauncher. |
protected void |
setUpParameters(SettingsBundle[] inParams,
java.util.ResourceBundle inValueMapChooser)
Initialize the technology specific parameters of interest and the value map chooser. |
protected void |
writeSetting(java.lang.String inParameter,
int inValue)
Write the given paramater and its value. |
protected void |
writeSetting(java.lang.String inParameter,
java.lang.Number inValue)
Write the given paramater and its value. |
protected void |
writeSetting(java.lang.String inParameter,
java.lang.String inValue)
Write the given paramater and its value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface ca.utoronto.atrc.web4all.configuration.SetterLauncher |
doLaunch, doSettings |
| Constructor Detail |
public AbstractSetterLauncher()
init().
init()| Method Detail |
protected abstract void init()
setUpParameters(SettingsBundle[],ResourceBundle),
createOutput(String,String).,
createOutput(String,String,boolean).,
createOutput(String).,
createArgsArray(int),
setArgsArray(String[]),
getArgsArray(),
setArgsIndexMap(ResourceBundle),
getArgsIndexMap()
protected void setUpParameters(SettingsBundle[] inParams,
java.util.ResourceBundle inValueMapChooser)
inParams - An array of SettingsBundle for the technology specific settings
handled by this SetterLauncher. There is one bundle for each
type of technology.inValueMapChooser - A ResourceBundle that, given a parameter name, chooses a value
map that associates an ACCLIP preference value with a
technology parameter value.init(),
clearParamsWritten(String)protected void clearParamsWritten(java.lang.String inTechType)
inTechType - The type of technology whose parameters written state
are to be cleared.setUpParameters(SettingsBundle[],ResourceBundle)
protected java.io.PrintWriter createOutput(java.lang.String inHomeDir,
java.lang.String inFileName)
inHomeDir - Path to the directory relative to Web-4-All's home directory.inFileName - The name of the file to create.
null if an I/O error occurred.init(),
ControlHub.getHomeDirectory(),
createOutput(String,String,boolean),
createOutput(String)
protected java.io.PrintWriter createOutput(java.lang.String inHomeDir,
java.lang.String inFileName,
boolean useSubDir)
false. If it is true the path is assumed to be relative, and
relative to Web-4-All's home directory.
inHomeDir - Path to a directory relative to Web-4-All's home directory, "or",
the full path to the directory containing the file
(see argument useSubDir below).inFileName - The name of the file.useSubDir - A flag that indicates whether inHomeDir is a sub-folder
or a full path to some other directory.
null if there was an I/O error.init(),
ControlHub.getHomeDirectory(),
createOutput(String,String),
createOutput(String)protected java.io.PrintWriter createOutput(java.lang.String inFullPath)
inFullPath - A String that is the full path to the file.
null if there was an I/O error.init(),
createOutput(String,String),
createOutput(String,String,boolean)
protected java.io.PrintWriter createOutput(java.lang.String inFullPath,
boolean inAppend)
inFullPath - A String that is the full path to the file.inAppend - A boolean indicating whether or not to append the output.
null if there was an I/O error.init(),
createOutput(String,String),
createOutput(String,String,boolean)protected void closeOutput()
createOutput(String,String),
createOutput(String,String,boolean),
createOutput(String)protected java.lang.String[] createArgsArray(int inNumArgs)
setArgsArray().
inNumArgs - The number of arguments in the array.
setArgsArray(String[]),
getArgsArray(),
setArgsIndexMap(ResourceBundle),
getArgsIndexMap()protected void setArgsArray(java.lang.String[] ioArgsArray)
ioArgsArray - Array to use for the arguments.createArgsArray(int),
getArgsArray(),
setArgsIndexMap(ResourceBundle),
getArgsIndexMap()protected java.lang.String[] getArgsArray()
createArgsArray(int),
setArgsArray(String[]),
setArgsIndexMap(ResourceBundle),
getArgsIndexMap()protected void setArgsIndexMap(java.util.ResourceBundle inArgsIndexMap)
inArgsIndexMap - Mapping between setting names and their index, or position,
in a command line.getArgsIndexMap(),
createArgsArray(int),
setArgsArray(String[]),
getArgsArray()protected java.util.ResourceBundle getArgsIndexMap()
setArgsIndexMap(ResourceBundle),
createArgsArray(int),
setArgsArray(String[]),
getArgsArray()public void setAppSettings(org.w3c.dom.Element inAppSettings)
inAppSettings - The subtree of the settings that contain the generic and
application specific preferences.getAppSettings()public org.w3c.dom.Element getAppSettings()
setAppSettings(Element)public void setControlHub(ControlHub inControlHub)
inControlHub - The ControlHub instance that is controlling the system.getControlHub()public ControlHub getControlHub()
null if setControlHub() was not called.setControlHub(ControlHub)public void setAppID(java.lang.String inAppID)
inAppID - The application ID.setAppID(Element),
getAppID()public java.lang.String getAppID()
null if
the property was not set by setAppID().setAppID(String),
setAppID(Element)protected void setAppID(org.w3c.dom.Element in3rdPartyPrefs)
in3rdPartyPrefs - An application preferences Element; its name attribute is used
to set the application ID.setAppID(String),
getAppID()protected void setProcess(java.lang.Process inProcess)
doLaunch().
inProcess - The Process.SetterLauncher.doLaunch(),
getProcess()protected java.lang.Process getProcess()
doLaunch().
SetterLauncher.doLaunch(),
setProcess(Process).
protected void loopThruGenerics(java.lang.String inTechType,
org.w3c.dom.Element inGenericContainer)
handlePref().
Sub-classes that wish to handle the generics differently should either not call this method,
override it to do something else, or override handlePref() to handle them
differently.
inTechType - The type of technology the given generic preferences are for
expressed in the ACCLIP's vocabulary (e.g. "screenReader").inGenericContainer - The parent generic Element, (e.g. "screenReaderGeneric").handlePref(String,Element,boolean)
protected void loopThru3rdPartyPrefs(java.lang.String inTechType,
org.w3c.dom.Element in3rdPartyPrefs)
handlePref(), passing the child element, and indicating
it is not a generic preference.
inTechType - The type of technology the application specific preferences
are for, as taken from the ACCLIP (e.g. "screenReader").in3rdPartyPrefs - The <application> container element for specific
preferences.handlePref(String,Element,boolean)
protected void handlePref(java.lang.String inTechType,
org.w3c.dom.Element inPref)
handlePref() with false
(this preference is not a generic preference).
inTechType - The type of technology this preference is for, as taken from the
ACCLIP (e.g. "screenReader").inPref - The preference Element from the preferences that represents a
single setting.handlePref(String,Element,boolean)
protected void handlePref(java.lang.String inTechType,
org.w3c.dom.Element inPref,
boolean isGeneric)
doWriteSetting(). This also sets the parameter's written state
to true.
This method is useful for the simple case of a straight match between the ACCLIP preference and the technology's parameter value (i.e. no hierarchical nesting of preferences, nor exclusive-or with respect to a containing Element).
inTechType - The type of technology these generic preferences are for, as
taken from the ACCLIP (e.g. "screenReader").inPref - The pref Element from the preferences that represents a
single setting.isGeneric - Did the preference come from the generic container in
the ACCLIP? This is passed to findParameter().handlePref(String,Element),
findParameter(String,String,boolean),
doWriteSetting(String,String)
public ParameterState findParameter(java.lang.String inTechType,
java.lang.String inAccLipPrefName)
null. This method is a convenience for calling the full
version of findParameter() -- this passes false to indicate that
the preference is not a generic preference.
inTechType - The type of technology this preference are for, as taken from
the ACCLIP (e.g. "screenReader").inAccLipPrefName - String representing the preference found in the ACCLIP.
null if this technology does not handle this
preference.ParameterState,
findParameter(String,String,boolean)
public ParameterState findParameter(java.lang.String inTechType,
java.lang.String inAccLipPrefName,
boolean isGeneric)
null. Note that this method only handles generic preferences
at this level in the derivation hierarchy. Sub-classes should override to handle specfic
preferences.
inTechType - The type of technology this preference are for, as taken from
taken from the ACCLIP (e.g. "screenReader").inAccLipPrefName - String representing the preference found in the ACCLIP.isGeneric - Did the preference come from the generic container in the
ACCLIP? This is ignored.
null if this technology does not handle this
preference.ParameterState,
findParameter(String,String)public java.lang.String getValueValue(org.w3c.dom.Element inPref)
Web4AllConstansts.VAL_ATT attribute and return
the value of that attribute.
inPref - The preference Element whose value attribute is sought.
null if none is found.Web4AllConstants.VAL_ATT
protected java.lang.String mapValue(java.lang.String inParam,
java.lang.String inValue)
inParam - The parameter of interest. This is expressed using the technology's
vocabulary.inValue - The value from the ACCLIP.
linearCalcTechVal(String,float,float)
public float linearCalcTechVal(java.lang.String inAccLipVal,
float inSlope,
float inIntercept)
inAccLipVal - Floating point value from the ACCLIP.inSlope - A float that represents the slope of the line.inIntercept - A float that represents the y-intercept of the line.
mapValue(String,String)protected void handleUnwrittenParams(java.lang.String inTechType)
inTechType - The type of technology that this is configuring, expressed using
the ACCLIP vocabulary.
protected abstract void doWriteSetting(java.lang.String inParameter,
java.lang.String inValue)
inParameter - The parameter to "write".inValue - The value of the parameter.writeSetting(String,String),
writeSetting(String,int),
writeSetting(String,Number),
addArgToArray(String,String)
protected void writeSetting(java.lang.String inParameter,
java.lang.String inValue)
createOutputFile() was called at some point prior to this method.
inParameter - String representing the parameter to write.inValue - String representing the value of inParameter.createOutput(String,String),
createOutput(String,String,boolean),
createOutput(String),
doWriteSetting(String,String),
writeSetting(String,int),
writeSetting(String,Number)
protected void writeSetting(java.lang.String inParameter,
int inValue)
createOutputFile() was called at some point prior to this method.
inParameter - String representing the parameter to write.inValue - An int representing the value of inParameter.createOutput(String,String),
createOutput(String,String,boolean),
createOutput(String),
doWriteSetting(String,String),
writeSetting(String,String),
writeSetting(String,Number)
protected void writeSetting(java.lang.String inParameter,
java.lang.Number inValue)
createOutputFile() was called at some point prior to this method.
inParameter - String representing the parameter to write.inValue - Number representing the value of inParameter.createOutput(String,String),
createOutput(String,String,boolean),
createOutput(String),
doWriteSetting(String,String),
writeSetting(String,String),
writeSetting(String,int)
protected void addArgToArray(java.lang.String inParameter,
java.lang.String inValue)
createArgsArray() or setArgsArray(), and
setArgsIndexMap() were used to initialize the command line argument
arrays.
inParameter - The parameter to write.inValue - The value of inParameter.createArgsArray(int),
setArgsArray(String[]),
setArgsIndexMap(ResourceBundle)protected void createReadProcessIStreams()
ReadProcessIStreams,
handleProcessIStreams(Process),
handleProcessIStreams(Process,boolean)protected void handleProcessIStreams(java.lang.Process inProcess)
inProcess - The Process whose InputStreams are to read.ReadProcessIStreams,
createReadProcessIStreams(),
handleProcessIStreams(Process,boolean)
protected void handleProcessIStreams(java.lang.Process inProcess,
boolean logFlag)
inProcess - The Process whose InputStreams are to read.logFlag - If true the contents of the InputStreams are
written to the ConfigManager's log file.ReadProcessIStreams,
createReadProcessIStreams(),
handleProcessIStreams(Process)
protected java.lang.String getLocalProperty(java.lang.String inPropName)
throws java.util.MissingResourceException
initLocalProps() -- this checks to see if the local properties
have been initialized, and, if not, throws a MissingResourceException. If they have been
initialized, then the desired property is retrieved. If the property does not exist,
a MissingResourceException is thrown.
inPropName - Name of the property to be retrieved.
java.util.MissingResourceException - Occurs if the local properties have not
been initialized, or the given property is not known.initLocalProps()public void kill()
kill in interface SetterLauncherSetterLauncher.doLaunch()public boolean initLocalProps()
getControlHub(). The properties are stored as a
java.util.ResourceBundle. If such a bundle does not exist, this will fail.
initLocalProps in interface SetterLaunchergetControlHub(),
getLocalProperty(String),
ControlHub.get3rdPartyProperties(String)
|
Web-4-All v3.00 Plug-in API Specification | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||