JFCML - JFC/Swing
XML Markup Language

com.metasolutions.jfcml.helpers
Class BSFHandler

java.lang.Object
  extended by com.metasolutions.jfcml.helpers.DocumentHandler
      extended by 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

Field Summary
 
Fields inherited from class com.metasolutions.jfcml.helpers.DocumentHandler
windowContext
 
Constructor Summary
BSFHandler(WindowContext context)
           
 
Method Summary
 Object eval(String spec)
           
 Object eval(String lang, String stmt)
          Evaluate a lexical statement in the given scripting engine.
 Object get(String symbol)
          Gets a previously registered variable.
 boolean isBSFConnected()
           
 boolean loadScriptingEngine(String engineName)
          Loads a scripting engine by the specified name.
 boolean set(String symbol, Object value)
          Registers a variable in all currently loaded scripting languages.
 
Methods inherited from class com.metasolutions.jfcml.helpers.DocumentHandler
getWindowContext, setWindowContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BSFHandler

public BSFHandler(WindowContext context)
Method Detail

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 variable
value - 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 use
stmt - the expression to parse
Returns:
the result of the expression, or null if it could not be evaluated.

SourceForge.net
java.net

Copyright 2004-2005 Shawn Curry, http://jfcml.sourceforge.net
Licensed under the Academic Free License version 2.1