Class SmartParamEngine

java.lang.Object
io.higson.runtime.engine.core.SmartParamEngine
All Implemented Interfaces:
PropertiesAware, ParamEngine

public class SmartParamEngine extends Object implements ParamEngine, PropertiesAware
Since:
1.0.0
Version:
1.0.2
Author:
Przemek Hertel
  • Constructor Details

  • Method Details

    • setInvokerInterceptor

      public void setInvokerInterceptor(FunctionInvokerInterceptor invokerInterceptor)
    • runtimeConfiguration

      public ParamEngineRuntimeConfig runtimeConfiguration()
      Description copied from interface: ParamEngine
      Return runtime configuration of this instance of parameter engine.
      Specified by:
      runtimeConfiguration in interface ParamEngine
      Returns:
      runtime config
    • getDigest

      public String getDigest(Type type, String elementCode)
      Description copied from interface: ParamEngine
      Return digest of one of given Parameter/Funcion/Literal value
      Specified by:
      getDigest in interface ParamEngine
      Parameters:
      type - of Higson element to calculate its digest
      elementCode - code of parameter/function or literal value
      Returns:
      digest as string of given element or null, if digest is not available.
    • get

      public ParamValue get(String paramName, ParamContext ctx)
      Description copied from interface: ParamEngine
      Return submatrix of parameter rows that match values from context. Remember, that to use dynamic context levels need to have defined levelCreators.
      Specified by:
      get in interface ParamEngine
      Parameters:
      paramName - name of parameter to search
      ctx - evaluation context
      Returns:
      resulting submatrix
    • get

      public ParamValue get(String paramName, Object... inputLevels)
      Description copied from interface: ParamEngine
      Return submatrix of parameter rows that match provided query values. Input levels array should have length equal to parameters input levels count.
      Specified by:
      get in interface ParamEngine
      Parameters:
      paramName - name of parameter to search
      inputLevels - values to match against each input level
      Returns:
      resulting submatrix
    • callFunction

      public Object callFunction(String functionName, Object... args)
      Description copied from interface: ParamEngine
      Use function engine to call function registered under provided name, passing provided invocation arguments.
      Specified by:
      callFunction in interface ParamEngine
      Parameters:
      functionName - name of function to run
      args - function invocation arguments
      Returns:
      invocation result, null for void functions
    • callEvaluatedFunction

      public Object callEvaluatedFunction(String paramName, ParamContext ctx, Object... args)
      Description copied from interface: ParamEngine
      Evaluate parameter using provided context and use returned value retrieved using ParamValue.get() as name of function to call with provided arguments.
      Specified by:
      callEvaluatedFunction in interface ParamEngine
      Parameters:
      paramName - name of parameter to evaluate
      ctx - evaluation context
      args - function invocation arguments
      Returns:
      invocation result, null for void functions
    • setProperties

      public void setProperties(Properties properties)
      Specified by:
      setProperties in interface PropertiesAware