Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.batik.script.jpython
Class JPythonInterpreter  view JPythonInterpreter download JPythonInterpreter.java

java.lang.Object
  extended byorg.apache.batik.script.jpython.JPythonInterpreter
All Implemented Interfaces:
org.apache.batik.script.Interpreter, org.apache.batik.i18n.Localizable

public class JPythonInterpreter
extends java.lang.Object
implements org.apache.batik.script.Interpreter

A simple implementation of Interpreter interface to use JPython python parser.

Version:
$Id: JPythonInterpreter.java,v 1.10 2005/03/27 08:58:35 cam Exp $

Field Summary
private  PythonInterpreter interpreter
           
 
Constructor Summary
JPythonInterpreter()
           
 
Method Summary
 void bindObject(java.lang.String name, java.lang.Object object)
          This method should register a particular Java Object in the environment of the interpreter.
 void dispose()
          This method can dispose resources used by the interpreter when it is no longer used.
 java.lang.Object evaluate(java.io.Reader scriptreader)
          This method should evaluate a piece of script.
 java.lang.Object evaluate(java.io.Reader scriptreader, java.lang.String description)
          This method should evaluate a piece of script associated to a given description.
 java.lang.Object evaluate(java.lang.String script)
          This method should evaluate a piece of script using a String instead of a Reader.
 java.lang.String formatMessage(java.lang.String key, java.lang.Object[] args)
          Creates and returns a localized message, given the key of the message in the resource bundle and the message parameters.
 java.util.Locale getLocale()
          Returns the current locale or null if the locale currently used is the default one.
 void setLocale(java.util.Locale locale)
          Provides a way to the user to specify a locale which override the default one.
 void setOut(java.io.Writer out)
          This method should change the output Writer that will be used when output function of the scripting langage is used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

interpreter

private PythonInterpreter interpreter
Constructor Detail

JPythonInterpreter

public JPythonInterpreter()
Method Detail

evaluate

public java.lang.Object evaluate(java.io.Reader scriptreader)
                          throws org.apache.batik.script.InterpreterException,
                                 java.io.IOException
Description copied from interface: org.apache.batik.script.Interpreter
This method should evaluate a piece of script.

Specified by:
evaluate in interface org.apache.batik.script.Interpreter

evaluate

public java.lang.Object evaluate(java.io.Reader scriptreader,
                                 java.lang.String description)
                          throws org.apache.batik.script.InterpreterException,
                                 java.io.IOException
Description copied from interface: org.apache.batik.script.Interpreter
This method should evaluate a piece of script associated to a given description.

Specified by:
evaluate in interface org.apache.batik.script.Interpreter

evaluate

public java.lang.Object evaluate(java.lang.String script)
                          throws org.apache.batik.script.InterpreterException
Description copied from interface: org.apache.batik.script.Interpreter
This method should evaluate a piece of script using a String instead of a Reader. This usually allows do easily do some caching.

Specified by:
evaluate in interface org.apache.batik.script.Interpreter

dispose

public void dispose()
Description copied from interface: org.apache.batik.script.Interpreter
This method can dispose resources used by the interpreter when it is no longer used. Be careful, you SHOULD NOT use this interpreter instance after calling this method.

Specified by:
dispose in interface org.apache.batik.script.Interpreter

bindObject

public void bindObject(java.lang.String name,
                       java.lang.Object object)
Description copied from interface: org.apache.batik.script.Interpreter
This method should register a particular Java Object in the environment of the interpreter.

Specified by:
bindObject in interface org.apache.batik.script.Interpreter

setOut

public void setOut(java.io.Writer out)
Description copied from interface: org.apache.batik.script.Interpreter
This method should change the output Writer that will be used when output function of the scripting langage is used.

Specified by:
setOut in interface org.apache.batik.script.Interpreter

getLocale

public java.util.Locale getLocale()
Description copied from interface: org.apache.batik.i18n.Localizable
Returns the current locale or null if the locale currently used is the default one.

Specified by:
getLocale in interface org.apache.batik.i18n.Localizable

setLocale

public void setLocale(java.util.Locale locale)
Description copied from interface: org.apache.batik.i18n.Localizable
Provides a way to the user to specify a locale which override the default one. If null is passed to this method, the used locale becomes the global one.

Specified by:
setLocale in interface org.apache.batik.i18n.Localizable

formatMessage

public java.lang.String formatMessage(java.lang.String key,
                                      java.lang.Object[] args)
Description copied from interface: org.apache.batik.i18n.Localizable
Creates and returns a localized message, given the key of the message in the resource bundle and the message parameters. The messages in the resource bundle must have the syntax described in the java.text.MessageFormat class documentation.

Specified by:
formatMessage in interface org.apache.batik.i18n.Localizable