delight.nashornsandbox.NashornSandboxes Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of delight-nashorn-sandbox Show documentation
Show all versions of delight-nashorn-sandbox Show documentation
A safe sandbox to execute JavaScript code from Nashorn.
The newest version!
package delight.nashornsandbox;
import delight.nashornsandbox.internal.NashornSandboxImpl;
/**
* The Nashorn sandbox factory.
*
*
* Created on 2015-08-07
*
*
* @author mxro
* @version $Id$
*/
@SuppressWarnings("all")
public class NashornSandboxes {
/**
* Creates a new sandbox instance.
*
* @return The newly created sandbox instance.
*/
public static NashornSandbox create() {
return new NashornSandboxImpl();
}
/**
*
Create a sandbox while supplying arguments for the engine such as '--no-java'.
*
More information on available parameters can be found in the following:
*
* - Nashorn DEVELOPER README
* - Source Code Options.properties
*
* @param args Options for initializing the Nashorn engine.
* @return A newly created sandbox instance.
*/
public static NashornSandbox create(String... args) {
return new NashornSandboxImpl(args);
}
}