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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcallBeginSearch(org.mozilla.javascript.Scriptable scope, Session session) Call thebegin_searchfunctionvoidcallEndSearch(org.mozilla.javascript.Scriptable scope, Session session) Call theend_searchfunctioncallQueryFunction(org.mozilla.javascript.Scriptable scope, QueryScript.QueryFunction function, Object... args) Call the specified QueryFunction with the given argumentsvoidcallQueryRecord(org.mozilla.javascript.Scriptable scope, Integer recordIndex, Record record) Call thequery_recordfunction.booleanhasBeginSearch(org.mozilla.javascript.Scriptable scope) Does the script define abegin_searchfunctionbooleanhasEndSearch(org.mozilla.javascript.Scriptable scope) Does the script define aend_searchfunctionbooleanhasQueryFunction(org.mozilla.javascript.Scriptable scope, QueryScript.QueryFunction function) Does the script define the givenQueryScript.QueryFunctionbooleanhasQueryRecord(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:
trueif aquery_recordfunction was found,falseotherwise
-
callQueryRecord
public void callQueryRecord(org.mozilla.javascript.Scriptable scope, Integer recordIndex, Record record) throws PhonScriptException Call thequery_recordfunction.- Parameters:
record-- Throws:
PhonScriptException
-
hasBeginSearch
public boolean hasBeginSearch(org.mozilla.javascript.Scriptable scope) Does the script define abegin_searchfunction- Returns:
trueif abegin_searchfunction was found,falseotherwise
-
callBeginSearch
public void callBeginSearch(org.mozilla.javascript.Scriptable scope, Session session) throws PhonScriptException Call thebegin_searchfunction- Parameters:
session-- Throws:
PhonScriptException
-
hasEndSearch
public boolean hasEndSearch(org.mozilla.javascript.Scriptable scope) Does the script define aend_searchfunction- Returns:
trueif aend_searchfunction was found,falseotherwise
-
callEndSearch
public void callEndSearch(org.mozilla.javascript.Scriptable scope, Session session) throws PhonScriptException Call theend_searchfunction- 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:
trueif the specified function is defined in the script,falseotherwise
-
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
-