Package

com.celadari.jsonlogicscala

evaluate

Permalink

package evaluate

Visibility
  1. Public
  2. All

Type Members

  1. trait CompositionOperator extends Operator

    Permalink

    Defines interface of class/object that defines a composition operator.

    Defines interface of class/object that defines a composition operator. Unlike other operators, these operators are more complex and new to inform sub-nodes in syntax tree of values before evaluating its current node. This is performed by updating the map "logicOperatorToValue" which is passed on to sub-nodes. Invoked method has to be "composeOperator" and overloading this method doesn't work.

    Example:
    1. map, filter, all, none, some

  2. class EvaluatorLogic extends AnyRef

    Permalink

    Responsible for evaluating scala data structure com.celadari.jsonlogicscala.tree.JsonLogicCore.

    Responsible for evaluating scala data structure com.celadari.jsonlogicscala.tree.JsonLogicCore. May be extended to fit custom use cases. Providing the right configuration via com.celadari.jsonlogicscala.evaluate.EvaluatorLogicConf is enough to cover most cases. You may redefine methods to handle extreme uncommon cases.

  3. case class EvaluatorLogicConf(operatorToMethodConfMetaInfAdd: Map[String, MethodConf], operatorToMethodConfManualAdd: Map[String, MethodConf], valueLogicTypeToReducerMetaInfAdd: Map[TypeValue, EvaluatorValueLogic], valueLogicTypeToReducerManualAdd: Map[TypeValue, EvaluatorValueLogic], isPriorityToManualAdd: Boolean = true) extends Product with Serializable

    Permalink

    Represents an evaluator's configuration.

    Represents an evaluator's configuration. It informs the evaluator how to map an operator_codename to an actual method.

  4. trait EvaluatorValueLogic extends AnyRef

    Permalink

    Defines interface of class/object that defines an evaluator_value_logic.

    Defines interface of class/object that defines an evaluator_value_logic. A class|object implementing this interface is called before evaluation and transforms leaf values in syntax tree.

    AND / \ < < / \ / \ A 5 B -4

    if you define an evaluator_value_logic defined for int values and returns absolute value then evaluation will be on the following tree

    AND / \ < < / \ / \ A 5 B 4

  5. case class MethodConf(operator: String, methodName: String, ownerMethodOpt: Option[Operator], isReduceTypeOperator: Boolean = true, isCompositionOperator: Boolean = false, isUnaryOperator: Boolean = false) extends Product with Serializable

    Permalink

    Represents an operator's information for evaluation.

  6. class MethodSignatureFinder extends AnyRef

    Permalink

    Responsible for finding paths of a compatible classes in case there exists multiple overloaded method versions of operator's method.

    Responsible for finding paths of a compatible classes in case there exists multiple overloaded method versions of operator's method.

    Example:
    1. class A, class B extends A conditionsValues(a, b, c) (a object of A, b object of B, c object of C) overloaded methods have the following signatures: overloaded_method(A, A): B overloaded_method(A, B): A overloaded_method(A, C): D overloaded_method(A, D): A overloaded_method(B, A): A overloaded_method(B, C): A overloaded_method(D, C): A then compatible paths are Array((overloaded_method(A, A): B), (overloaded_method(B, C): A)) Array((overloaded_method(A, B): A), (overloaded_method(A, C): D)) This search is used on reduce type operators as conditions might not be the same type and which overloaded method to be applied must be found before evaluation.

  7. trait Operator extends AnyRef

    Permalink

    Defines interface of class/object that defines an operator.

    Defines interface of class/object that defines an operator. There is no constraint on method name. Name of invoked method during evaluation is known in com.celadari.jsonlogicscala.evaluate.MethodConf configuration.

  8. trait UnaryOperator extends Operator

    Permalink

    Defines interface of class/object that defines an unary operator.

    Defines interface of class/object that defines an unary operator. Unlike binary|multiple input operators, unary operators take only one input. Invoked method has to be "unaryOperator" and overloading this method doesn't work.

    Example:
    1. negate operator, getOrDefaultOperator

Value Members

  1. object CompositionOperator

    Permalink

    Companion object containing class com.celadari.jsonlogicscala.evaluate.CompositionOperator.ComposeJsonLogicCore's definition.

  2. object EvaluatorLogicConf extends Serializable

    Permalink

    Companion object to hold implicit: com.celadari.jsonlogicscala.evaluate.EvaluatorLogicConf, mapping of default operators (type_codename -> method_conf), and method to create a custom configuration.

  3. object EvaluatorValueLogic

    Permalink

    Companion object to hold default com.celadari.jsonlogicscala.evaluate.EvaluatorValueLogic.

  4. object MethodSignatureFinder

    Permalink

    Companion object that defines utility function to find minimum (class inheritance as partial order) classes among set of classes.

  5. package defaults

    Permalink

Ungrouped