jimm.datavision
Class Scripting

java.lang.Object
  extended by jimm.datavision.Scripting
All Implemented Interfaces:
Writeable

public class Scripting
extends java.lang.Object
implements Writeable

Bean Scripting Framework management.

Author:
Jim Menard, jimm@io.com

Field Summary
protected static java.lang.String DEFAULT_CLASS
           
protected static java.lang.String DEFAULT_LANGUAGE
           
protected  java.lang.String defaultLanguage
           
protected  java.util.Map languages
           
protected  java.util.Map managers
           
protected  Report report
           
 
Constructor Summary
Scripting(Report report)
           
 
Method Summary
 void addLanguage(java.lang.String language, java.lang.String className)
          Adds a language to our list.
 boolean canFind(java.lang.String klass)
          Returns true if we can load class klass.
 java.lang.Object eval(java.lang.String language, java.lang.String evalString, java.lang.String name)
          Evaluates an evalString using language and returns the results.
 org.apache.bsf.BSFManager getBsfManager()
          Returns BSFManager for the default language.
 org.apache.bsf.BSFManager getBsfManager(java.lang.String language)
          Returns BSFManager for language.
 java.lang.String getDefaultLanguage()
          Returns the default language name.
 java.util.Map getLanguages()
          Returns an immutable copy of the map of languages.
 void replaceLanguages(java.util.Map langs)
          Replace the contents of our language map with the contents of langs.
 void setDefaultLanguage(java.lang.String language)
          Sets the default language name.
 void writeXML(XMLWriter out)
          Writes this object as an XML tag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_LANGUAGE

protected static final java.lang.String DEFAULT_LANGUAGE
See Also:
Constant Field Values

DEFAULT_CLASS

protected static final java.lang.String DEFAULT_CLASS
See Also:
Constant Field Values

report

protected Report report

defaultLanguage

protected java.lang.String defaultLanguage

languages

protected java.util.Map languages

managers

protected java.util.Map managers
Constructor Detail

Scripting

public Scripting(Report report)
Method Detail

getLanguages

public java.util.Map getLanguages()
Returns an immutable copy of the map of languages.


addLanguage

public void addLanguage(java.lang.String language,
                        java.lang.String className)
Adds a language to our list.


replaceLanguages

public void replaceLanguages(java.util.Map langs)
Replace the contents of our language map with the contents of langs.

Parameters:
langs - maps language names to class names

getDefaultLanguage

public java.lang.String getDefaultLanguage()
Returns the default language name.


setDefaultLanguage

public void setDefaultLanguage(java.lang.String language)
Sets the default language name.


canFind

public boolean canFind(java.lang.String klass)
Returns true if we can load class klass.


eval

public java.lang.Object eval(java.lang.String language,
                             java.lang.String evalString,
                             java.lang.String name)
                      throws org.apache.bsf.BSFException
Evaluates an evalString using language and returns the results.

Parameters:
language - the language to use
evalString - the string to evaluate
name - a name (for example, a formula name) to display with error messages
Returns:
the result
Throws:
org.apache.bsf.BSFException

getBsfManager

public org.apache.bsf.BSFManager getBsfManager()
                                        throws org.apache.bsf.BSFException
Returns BSFManager for the default language.

Throws:
org.apache.bsf.BSFException

getBsfManager

public org.apache.bsf.BSFManager getBsfManager(java.lang.String language)
                                        throws org.apache.bsf.BSFException
Returns BSFManager for language.

Throws:
org.apache.bsf.BSFException

writeXML

public void writeXML(XMLWriter out)
Description copied from interface: Writeable
Writes this object as an XML tag.

Specified by:
writeXML in interface Writeable
Parameters:
out - a writer that knows how to write XML