org.hecl.java
Class JavaCmd
- java.lang.Object
-
- org.hecl.java.JavaCmd
-
- All Implemented Interfaces:
- ClassCommand, Command
public class JavaCmd extends java.lang.Object implements ClassCommand, Command
TheJavaCmdclass is utilized to implement Hecl commands that can interact with Java classes. The real work is done in the Reflector class, which maps between Hecl and Java types.
-
-
Constructor Summary
Constructors Constructor and Description JavaCmd(java.lang.String clsname)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description ThingcmdCode(Interp interp, Thing[] argv)ThecmdCodemethod takes an interpreter and an array of Things, performs some calculations, and returns aThingrepresenting the computed value, ornull.java.lang.ClassgetCmdClass()java.lang.StringgetCmdName()static voidload(Interp ip, java.lang.String cname, java.lang.String cmd)Thingmethod(Interp interp, ClassCommandInfo context, Thing[] argv)Themethodmethod takes an interpreter, a class information and an array of Things, performs some calculations, and returns aThingwhich may benull.static voidunload(Interp ip)
-
-
-
Constructor Detail
-
JavaCmd
public JavaCmd(java.lang.String clsname) throws HeclException- Throws:
HeclException
-
-
Method Detail
-
cmdCode
public Thing cmdCode(Interp interp, Thing[] argv) throws HeclException
Description copied from interface:CommandThecmdCodemethod takes an interpreter and an array of Things, performs some calculations, and returns aThingrepresenting the computed value, ornull.- Specified by:
cmdCodein interfaceCommand- Parameters:
interp- anInterpvalueargv- aThing[]value- Returns:
- A
Thingrepresenting the computed value, ornull. - Throws:
HeclException- if an error occurs
-
method
public Thing method(Interp interp, ClassCommandInfo context, Thing[] argv) throws HeclException
Description copied from interface:ClassCommandThemethodmethod takes an interpreter, a class information and an array of Things, performs some calculations, and returns aThingwhich may benull. The interpreter calls this method when it detects anObjectThingas first argument of a command on the script level and detects a command handler for the class of the value of theObjectThing.- Specified by:
methodin interfaceClassCommand- Parameters:
interp- anInterpvaluecontext- A reference to theClassInfo>describing further details of th emethod.argv- AThing[]array holding the parameters for the method. The 0th element is the object, the 1st element is the method.- Throws:
HeclException- if an error occurs
-
getCmdClass
public java.lang.Class getCmdClass()
-
getCmdName
public java.lang.String getCmdName()
-
load
public static void load(Interp ip, java.lang.String cname, java.lang.String cmd) throws HeclException
- Throws:
HeclException
-
unload
public static void unload(Interp ip)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG