Skip navigation links

ScriptHelper

scriptHelper is a Java library allowing a simple integration between Java code and various script languages.

See: Description

core classes 
Package Description
org.scripthelper.context
Contains the classes whihc manage the context for scripts.
org.scripthelper.debug
The debug package.
org.scripthelper.debug.expr
Contains the blocks for the breakpoints expressions.
org.scripthelper.debug.expr.parser
Contains the JavaCC parser for the breakpoint expressions.
org.scripthelper.debug.model
Contain the source model.
org.scripthelper.debug.nodes
This package contains utility classes for representing variables in the debugger.
org.scripthelper.debug.parser
The debug parser package, containing abstract class to parse script files.
org.scripthelper.exceptions
Contains the classes which wrap script exceptions.
org.scripthelper.model
Contains the classes which model the scripts and their methods.
Swing classes 
Package Description
org.scripthelper.swing
Contains the Swing helper classes for the framework.
org.scripthelper.swing.debug
Contains the Swing helper classes for the debugging framework.
org.scripthelper.swing.debug.treetable
Contains the treetable classes used by the Swing debugging window.
org.scripthelper.swing.script
Contains additional Swing script helper classes.
Groovy classes 
Package Description
org.scripthelper.groovy
Contains the classes which implements the Groovy scripts.
org.scripthelper.groovy.debug
Contains the Groovy debug instrumenting class.
org.scripthelper.groovy.debug.parser
Contains the classes which implements the Groovy debug parsing.
Ruby classes 
Package Description
org.scripthelper.ruby
Contains the classes which implements the Ruby scripts.
Javascript classes 
Package Description
org.scripthelper.js
Contains the classes which implements the Javascript scripts.
org.scripthelper.js.framework
Contains classes which control the usage of Javasxript scripts in Graphic environments.
Python classes 
Package Description
org.scripthelper.python
Contains the classes which implements the Python scripts.
scriptHelper is a Java library allowing a simple integration between Java code and various script languages. The use case for this API is when you want to add additional functions though user scripts to an existing Java library: You can use the script like you would do regular Java code.

Example

Suppose the following Script interface:
      public interface Script {
        public int computeResult(int value);
      }
      
We can define a script wrapper around this interface:
      ScriptWrapper<Script> wrapper = new GroovyScriptWrapper<Script>() {
      };
      Script Script = wrapper.getScriptProxy();
      
And now define a Groovy script:
      public int computeResult(int value) {
        return value * 10;
      }
      
Now we can execute this script:
      File file = new File(<our script file>);
      wrapper.installScript(file);

      int result = script.computeResult(10);
      
Skip navigation links

Copyright © 2019-2024 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence