edu.wisc.ssec.mcidasv.jython
Class InjectCommand

java.lang.Object
  extended by edu.wisc.ssec.mcidasv.jython.Command
      extended by edu.wisc.ssec.mcidasv.jython.InjectCommand

 class InjectCommand
extends Command

This class represents a Command that injects a standard Java variable into the local namespace of an Interpreter. This is useful for allowing Jython to manipulate objects created by the IDV or McIDAS-V.


Field Summary
private  String name
          Name Jython will use to refer to object.
private  Object object
          Wrapper around the Java object that is being injected.
 
Fields inherited from class edu.wisc.ssec.mcidasv.jython.Command
console
 
Constructor Summary
InjectCommand(Console console, String name, Object object)
          Creates an injection command based upon the specified name and object.
 
Method Summary
 void execute(Interpreter interpreter)
          Attempts to inject a variable created in Java into the local namespace of interpreter.
 String toString()
           
 
Methods inherited from class edu.wisc.ssec.mcidasv.jython.Command
getInputStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private String name
Name Jython will use to refer to object.


object

private Object object
Wrapper around the Java object that is being injected.

Constructor Detail

InjectCommand

public InjectCommand(Console console,
                     String name,
                     Object object)
Creates an injection command based upon the specified name and object.

Parameters:
console - Likely not required in this context!
name - Name Jython will use to refer to object.
object - Wrapper around the Java object that is being injected.
Method Detail

execute

public void execute(Interpreter interpreter)
             throws Exception
Attempts to inject a variable created in Java into the local namespace of interpreter.

Specified by:
execute in class Command
Parameters:
interpreter - Interpreter that will execute this command.
Throws:
Exception - if PythonInterpreter.set(String, PyObject) had problems.

toString

public String toString()
Overrides:
toString in class Object