oscript.data
Class JavaBridge.FunctionTransformer

java.lang.Object
  extended byoscript.data.JavaBridge.FunctionTransformer
Enclosing class:
JavaBridge

public abstract static class JavaBridge.FunctionTransformer
extends java.lang.Object

This abstract class is implemented by transformers that understand how to transform a script object (function) to a certain type of java class. For example, this can be used to register a tranformer that can make a wrapper that implements Runnable, or ActionListener. This way script code can simply pass a script function to java code that expects to take a, for example, ActionListener.


Constructor Summary
JavaBridge.FunctionTransformer(java.lang.Class targetClass)
          Class Constructor
 
Method Summary
 java.lang.Class getTargetClass()
          Get the type of the class that this tranformer understands how to transform to.
abstract  java.lang.Object transform(Value fxn)
          Perform the transform, and return a java object that is an instance of the class returned by getTargetClass().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaBridge.FunctionTransformer

public JavaBridge.FunctionTransformer(java.lang.Class targetClass)
Class Constructor

Parameters:
targetClass - the class to tranfrom script object to
Method Detail

getTargetClass

public java.lang.Class getTargetClass()
Get the type of the class that this tranformer understands how to transform to.


transform

public abstract java.lang.Object transform(Value fxn)
Perform the transform, and return a java object that is an instance of the class returned by getTargetClass().