com.metasolutions.jfcml.helpers
Class BSFHandler
java.lang.Object
com.metasolutions.jfcml.helpers.DocumentHandler
com.metasolutions.jfcml.helpers.BSFHandler
- All Implemented Interfaces:
- Serializable
public class BSFHandler
- extends DocumentHandler
Provides Reflective access to the Bean Scripting Framework.
- Version:
- 0.9 Jun 1, 2005
- Author:
- Shawn Curry
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BSFHandler
public BSFHandler(WindowContext context)
loadScriptingEngine
public boolean loadScriptingEngine(String engineName)
- Loads a scripting engine by the specified name.
- Parameters:
engineName
- the name of the scripting language, as known to BSF
- Returns:
- true if the scripting engine can be loaded, false if it cannot.
isBSFConnected
public boolean isBSFConnected()
get
public Object get(String symbol)
- Gets a previously registered variable.
- Parameters:
symbol
- the variable name
- Returns:
- the variable, if it exists, or null if it does not.
set
public boolean set(String symbol,
Object value)
- Registers a variable in all currently loaded scripting languages.
- Parameters:
symbol
- name of the variablevalue
- the variable
- Returns:
- true, if the variable was successfully set, false if it was not.
eval
public Object eval(String spec)
eval
public Object eval(String lang,
String stmt)
- Evaluate a lexical statement in the given scripting engine.
- Parameters:
lang
- the language to usestmt
- the expression to parse
- Returns:
- the result of the expression, or null if it could not be evaluated.
Copyright 2004-2005 Shawn Curry, http://jfcml.sourceforge.net
Licensed under the Academic Free License version 2.1