Class FunctorScript

    • Field Detail

      • SCRIPT_KEY

        public static String SCRIPT_KEY
    • Constructor Detail

      • FunctorScript

        public FunctorScript​(JFunctorFactory functorFactory,
                             net.sf.json.JSONObject rawContent)
        Use this to initialize the entire parser in advance of execution. You may then execute it by simply invoking the execute() method when you need to.
        Parameters:
        functorFactory -
        rawContent -
    • Method Detail

      • execute

        public void execute​(File file)
        Executes a file.
        Parameters:
        file -
      • execute

        public void execute​(List<String> commands)
      • execute

        public void execute​(Reader reader)
      • hasHandlers

        public boolean hasHandlers()
      • getFunctorMap

        public FunctorMap getFunctorMap()
      • executeScript

        protected void executeScript​(List<String> commands)
      • checkVersion

        protected void checkVersion()
      • getProperties

        public XProperties getProperties()
        Description copied from interface: ScriptInterface
        Properties the system may need about this script. These are not set here but are determined by the needs of the ScriptRuntimeEngine and the language. At the least, they should included a language and language version, plus some identifier.
        Specified by:
        getProperties in interface ScriptInterface
        Returns:
      • execute

        public void execute()
      • execute

        public void execute​(net.sf.json.JSONObject rawContent)
        Figure out what type of object is to be executed. Then run it.
        Throws:
        Throwable
      • executeScript

        protected void executeScript​(net.sf.json.JSONObject rawContent)
      • hasLogicBlocks

        public boolean hasLogicBlocks()
      • executeJSON

        protected void executeJSON​(net.sf.json.JSONObject rawContent)
        Execute the old JSON functor and put it into a script object. The pre-supposes that the content is functor notation and the functor factory will unscramble it. Then we just execute the result. The scripting notation is in a JSONObject of the form
             {"script":[array of lines as they are in a command file]}
         
        So be sure you are sending that if this method executes for no apparent reason. If the argument is not in the above form, it falls through to this case since it can be hard to figure out and the factory is good at that.
        Parameters:
        rawContent -