tcl.pkg.java
Class ReflectObject
java.lang.Object
tcl.pkg.java.ReflectObject
- All Implemented Interfaces:
- Command, CommandWithDispose, InternalRep
public class ReflectObject
- extends Object
- implements InternalRep, CommandWithDispose
A ReflectObject is used to create and access arbitrary Java objects using the
Java Reflection API. It wraps around a Java object (i.e., an instance of any
Java class) and expose it to Tcl scripts. The object is registered inside the
interpreter and is given a string name. Tcl scripts can manipulate this
object as long as the the reference count of the object is greater than zero.
NOCONVERT
protected static final String NOCONVERT
- See Also:
- Constant Field Values
CMD_PREFIX
protected static final String CMD_PREFIX
- See Also:
- Constant Field Values
ReflectObject
public ReflectObject()
dump
public static void dump(Interp interp)
dispose
public void dispose()
- Specified by:
dispose
in interface InternalRep
duplicate
public InternalRep duplicate()
- Specified by:
duplicate
in interface InternalRep
newInstance
public static TclObject newInstance(Interp interp,
Class cl,
Object obj)
throws TclException
- Throws:
TclException
get
public static Object get(Interp interp,
TclObject tobj)
throws TclException
- Throws:
TclException
getClass
public static Class getClass(Interp interp,
TclObject tobj)
throws TclException
- Throws:
TclException
cmdProc
public void cmdProc(Interp interp,
TclObject[] argv)
throws TclException
- Description copied from interface:
Command
- This method implements the functionality of the command. However, calling
it directly in application code will bypass execution traces. Instead,
commands should be called with WrappedCommand.invoke
- Specified by:
cmdProc
in interface Command
- Parameters:
interp
- The interpreter for setting the results and which contains the
contextargv
- the argument list for the command; objv[0[ is the command name
itself
- Throws:
TclException
- on any errors
disposeCmd
public void disposeCmd()
- Description copied from interface:
CommandWithDispose
- Called when the interpreter is removing the Tcl command
- Specified by:
disposeCmd
in interface CommandWithDispose
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2015. All rights reserved.