Package ca.phon.query.script
Class QueryScriptContext
java.lang.Object
ca.phon.script.PhonScriptContext
ca.phon.query.script.QueryScriptContext
-
Field Summary
Fields inherited from class ca.phon.script.PhonScriptContext
SCRIPT_EXPORTS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
callBeginSearch
(org.mozilla.javascript.Scriptable scope, Session session) Call thebegin_search
functionvoid
callEndSearch
(org.mozilla.javascript.Scriptable scope, Session session) Call theend_search
functioncallQueryFunction
(org.mozilla.javascript.Scriptable scope, QueryScript.QueryFunction function, Object... args) Call the specified QueryFunction with the given argumentsvoid
callQueryRecord
(org.mozilla.javascript.Scriptable scope, Integer recordIndex, Record record) Call thequery_record
function.boolean
hasBeginSearch
(org.mozilla.javascript.Scriptable scope) Does the script define abegin_search
functionboolean
hasEndSearch
(org.mozilla.javascript.Scriptable scope) Does the script define aend_search
functionboolean
hasQueryFunction
(org.mozilla.javascript.Scriptable scope, QueryScript.QueryFunction function) Does the script define the givenQueryScript.QueryFunction
boolean
hasQueryRecord
(org.mozilla.javascript.Scriptable scope) Does the script define aquery_record = function(session, record)
functionMethods inherited from class ca.phon.script.PhonScriptContext
callFunction, createBasicScope, createImporterScope, enter, eval, exec, exit, getCompiledScript, getContextFactory, getEvaluatedScope, getEvaluatedScope, getPhonScript, getScriptParameters, getStdErr, getStdOut, getWrapFactory, hasFunction, installParams, redirectStdErr, redirectStdOut, resetEvaulatedScope
-
Constructor Details
-
QueryScriptContext
-
-
Method Details
-
hasQueryRecord
public boolean hasQueryRecord(org.mozilla.javascript.Scriptable scope) Does the script define aquery_record = function(session, record)
function- Returns:
true
if aquery_record
function was found,false
otherwise
-
callQueryRecord
public void callQueryRecord(org.mozilla.javascript.Scriptable scope, Integer recordIndex, Record record) throws PhonScriptException Call thequery_record
function.- Parameters:
record
-- Throws:
PhonScriptException
-
hasBeginSearch
public boolean hasBeginSearch(org.mozilla.javascript.Scriptable scope) Does the script define abegin_search
function- Returns:
true
if abegin_search
function was found,false
otherwise
-
callBeginSearch
public void callBeginSearch(org.mozilla.javascript.Scriptable scope, Session session) throws PhonScriptException Call thebegin_search
function- Parameters:
session
-- Throws:
PhonScriptException
-
hasEndSearch
public boolean hasEndSearch(org.mozilla.javascript.Scriptable scope) Does the script define aend_search
function- Returns:
true
if aend_search
function was found,false
otherwise
-
callEndSearch
public void callEndSearch(org.mozilla.javascript.Scriptable scope, Session session) throws PhonScriptException Call theend_search
function- Parameters:
session
-- Throws:
PhonScriptException
-
hasQueryFunction
public boolean hasQueryFunction(org.mozilla.javascript.Scriptable scope, QueryScript.QueryFunction function) Does the script define the givenQueryScript.QueryFunction
- Parameters:
function
-- Returns:
true
if the specified function is defined in the script,false
otherwise
-
callQueryFunction
public Object callQueryFunction(org.mozilla.javascript.Scriptable scope, QueryScript.QueryFunction function, Object... args) throws PhonScriptException Call the specified QueryFunction with the given arguments- Parameters:
function
-args
-- Returns:
- result of calling function or
null
- Throws:
PhonScriptException
-