Class QueryScriptContext

java.lang.Object
ca.phon.script.PhonScriptContext
ca.phon.query.script.QueryScriptContext

public class QueryScriptContext extends PhonScriptContext
  • Constructor Details

    • QueryScriptContext

      public QueryScriptContext(QueryScript script)
  • Method Details

    • hasQueryRecord

      public boolean hasQueryRecord(org.mozilla.javascript.Scriptable scope)
      Does the script define a query_record = function(session, record) function
      Returns:
      true if a query_record function was found, false otherwise
    • callQueryRecord

      public void callQueryRecord(org.mozilla.javascript.Scriptable scope, Integer recordIndex, Record record) throws PhonScriptException
      Call the query_record function.
      Parameters:
      record -
      Throws:
      PhonScriptException
    • hasBeginSearch

      public boolean hasBeginSearch(org.mozilla.javascript.Scriptable scope)
      Does the script define a begin_search function
      Returns:
      true if a begin_search function was found, false otherwise
    • callBeginSearch

      public void callBeginSearch(org.mozilla.javascript.Scriptable scope, Session session) throws PhonScriptException
      Call the begin_search function
      Parameters:
      session -
      Throws:
      PhonScriptException
    • hasEndSearch

      public boolean hasEndSearch(org.mozilla.javascript.Scriptable scope)
      Does the script define a end_search function
      Returns:
      true if a end_search function was found, false otherwise
    • callEndSearch

      public void callEndSearch(org.mozilla.javascript.Scriptable scope, Session session) throws PhonScriptException
      Call the end_search function
      Parameters:
      session -
      Throws:
      PhonScriptException
    • hasQueryFunction

      public boolean hasQueryFunction(org.mozilla.javascript.Scriptable scope, QueryScript.QueryFunction function)
      Does the script define the given QueryScript.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