Class JsonLogic


  • public class JsonLogic
    extends java.lang.Object
    Author:
    yuriyz
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean apply​(java.lang.String rule)  
      static boolean apply​(java.lang.String rule, java.lang.String data)  
      static java.lang.Object applyObject​(java.lang.String rule)  
      static java.lang.Object applyObject​(java.lang.String rule, java.lang.String data)  
      static java.lang.Object eval​(java.lang.String script)  
      javax.script.ScriptEngine getEngine()  
      static JsonLogic getInstance()  
      javax.script.Invocable getInvocable()  
      static java.lang.Object invokeFunction​(java.lang.String name, java.lang.Object... args)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getInstance

        public static JsonLogic getInstance()
      • getEngine

        public javax.script.ScriptEngine getEngine()
      • getInvocable

        public javax.script.Invocable getInvocable()
      • eval

        public static java.lang.Object eval​(java.lang.String script)
                                     throws javax.script.ScriptException
        Throws:
        javax.script.ScriptException
      • invokeFunction

        public static java.lang.Object invokeFunction​(java.lang.String name,
                                                      java.lang.Object... args)
                                               throws javax.script.ScriptException,
                                                      java.lang.NoSuchMethodException
        Throws:
        javax.script.ScriptException
        java.lang.NoSuchMethodException
      • apply

        public static boolean apply​(java.lang.String rule)
                             throws javax.script.ScriptException
        Throws:
        javax.script.ScriptException
      • apply

        public static boolean apply​(java.lang.String rule,
                                    java.lang.String data)
                             throws javax.script.ScriptException
        Throws:
        javax.script.ScriptException
      • applyObject

        public static java.lang.Object applyObject​(java.lang.String rule)
                                            throws javax.script.ScriptException
        Throws:
        javax.script.ScriptException
      • applyObject

        public static java.lang.Object applyObject​(java.lang.String rule,
                                                   java.lang.String data)
                                            throws javax.script.ScriptException
        Throws:
        javax.script.ScriptException