public final class ContextJsTools extends Object
Modifier and Type | Method and Description |
---|---|
static OverlapAnalysisContext |
evalJs(OverlapAnalysisContext ctx,
String js)
Evaluate JavaScript segment for creation of OverlapAnalysisContextFactory.
|
static String |
getHelpMessage()
Get context initialization help message.
|
static OverlapAnalysisContext |
initializeContext(String context,
String contextjs)
Initialize a context from optional name and JS hook.
|
public static OverlapAnalysisContext evalJs(OverlapAnalysisContext ctx, String js) throws ScriptException
ctx
- Already initialized context to be exposed for the scripting hook or nulljs
- JavaScript segment to evaluate; JS context in accordance with JSHELP
. Must be not null.ScriptException
- re-thrownIllegalArgumentException
- when script returned null or anything different than an
OverlapAnalysisContex
instancepublic static OverlapAnalysisContext initializeContext(String context, String contextjs) throws ScriptException
Overlap analysis contexts usually can be defined by their named factory methods or a JS hook. Additionally a JS hook can be used to customize a the context to be used.
context
- Context name; value of command line parameter "-context" or null when not specifiedcontextjs
- JS hook; value of command line parameter "-contextjs" or null when not specified. The last
statement must be the context to be used.IllegalArgumentException
- when none of the arguments specifiedScriptException
- propagated from the ScriptEnginepublic static String getHelpMessage()