Constructor
-
new SettingsFileParser(getter, setter, newFile)
-
Parameters:
Name Type Description getter
AvayaClientServices.Base.SettingsFileParser#onVariableValueRequested a function that returns a value for the variable name
setter
AvayaClientServices.Base.SettingsFileParser#onVariableValueAvailable a function that sets the value of
newFile
AvayaClientServices.Base.SettingsFileParser#onAdditionalSettingsFileRequested a function that aborts the analysis of current data and starts a new
Methods
-
parse(data) → {boolean}
-
Parses a settings file from the given line.
The settings file is read from the line and as it is parsed the
AvayaClientServices.Base.SettingsFileParser#onVariableValueRequested,
AvayaClientServices.Base.SettingsFileParser#onVariableValueAvailable and
AvayaClientServices.Base.SettingsFileParser#onAdditionalSettingsFileRequested
methods are called to handle the contents.Parameters:
Name Type Description data
string line containing the settings file to parse
Returns:
{ boolean }true if successful completion or false if the process was aborted
-
proceed() → {boolean}
-
Continues parsing of a previous call to
AvayaClientServices.Base.SettingsFileParser#parse that was interrupted.A parse may be interrupted if a call is made to
AvayaClientServices.Base.SettingsFileParser#onAdditionalSettingsFileRequested.
If the requested file cannot be obtained the application should call
AvayaClientServices.Base.SettingsFileParser#proceed to continue parsing the current data line.Returns:
{ boolean }true if successful completion or false if the process was interrupted
Type Definitions
-
onAdditionalSettingsFileRequested(filepath)
-
Interface for callback function to be invoked when an additional settings file is requested.
Parameters:
Name Type Description filepath
string http path to the requested file on the server
-
onVariableValueAvailable(name, value)
-
Interface for callback function to be invoked when parser provides variable value to the application.
Parameters:
Name Type Description name
string The name of the variable
value
string The value of the variable, assigned by the application
-
onVariableValueRequested(name) → {string}
-
Interface for callback function to be invoked when parser requires variable value.
Parameters:
Name Type Description name
string The name of the variable in upper case
Returns:
{ string }value the string value of the variable