Interface EvalScript

All Known Implementing Classes:
EvalScriptWithDataModel, EvalScriptWithJsonDataModel

public interface EvalScript
Simple interface for script handling.
  • Method Summary

    Modifier and Type
    Method
    Description
    default Object
    handle(Reader reader)
    It will handle a script with no data model Any exception will be converted to ConfigRuntimeException
    default Object
    handle(Reader reader, Map<String,Object> dataModel)
    It will handle a script and bind a data model.
    default Object
    handleEx(Reader reader)
    It will handle a script with no data model.
    handleEx(Reader reader, Map<String,Object> dataModel)
    It will handle a script and bind a data model.
  • Method Details

    • handle

      default Object handle(Reader reader, Map<String,Object> dataModel)
      It will handle a script and bind a data model. Any exception will be converted to ConfigRuntimeException
      Parameters:
      reader - the reader over script
      dataModel - the data model to bind
      Returns:
      the result of script processing
    • handle

      default Object handle(Reader reader)
      It will handle a script with no data model Any exception will be converted to ConfigRuntimeException
      Parameters:
      reader - the reader over script
      Returns:
      the result of script processing
    • handleEx

      Object handleEx(Reader reader, Map<String,Object> dataModel) throws ScriptException
      It will handle a script and bind a data model. Any class implementing EvalScript will need to provide at least this method.
      Parameters:
      reader - the reader over script
      dataModel - the data model to bind
      Returns:
      the result of script processing
      Throws:
      ScriptException - in case of script handling issues
    • handleEx

      default Object handleEx(Reader reader) throws ScriptException
      It will handle a script with no data model.
      Parameters:
      reader - the reader over script
      Returns:
      the result of script processing
      Throws:
      ScriptException - in case of script handling issues