public class EmbedRubyObjectAdapterImpl extends Object implements EmbedRubyObjectAdapter
EmbedRubyObjectAdapter. Users get an instance of this
class by newObjectAdapter() method of ScriptingContainer.| Modifier and Type | Class and Description |
|---|---|
static class |
EmbedRubyObjectAdapterImpl.MethodType |
| Constructor and Description |
|---|
EmbedRubyObjectAdapterImpl(ScriptingContainer container) |
| Modifier and Type | Method and Description |
|---|---|
IRubyObject |
callMethod(IRubyObject receiver,
String methodName) |
IRubyObject |
callMethod(IRubyObject receiver,
String methodName,
IRubyObject singleArg) |
IRubyObject |
callMethod(IRubyObject receiver,
String methodName,
IRubyObject[] args) |
IRubyObject |
callMethod(IRubyObject receiver,
String methodName,
IRubyObject[] args,
Block block) |
Object |
callMethod(Object receiver,
String methodName,
Block block,
Object... args)
Executes a method defined in Ruby script.
|
<T> T |
callMethod(Object receiver,
String methodName,
Class<T> returnType)
Executes a method defined in Ruby script.
|
<T> T |
callMethod(Object receiver,
String methodName,
Class<T> returnType,
EmbedEvalUnit unit)
Executes a method defined in Ruby script.
|
Object |
callMethod(Object receiver,
String methodName,
Object... args)
Executes a method defined in Ruby script.
|
<T> T |
callMethod(Object receiver,
String methodName,
Object[] args,
Block block,
Class<T> returnType)
Executes a method defined in Ruby script.
|
<T> T |
callMethod(Object receiver,
String methodName,
Object[] args,
Block block,
Class<T> returnType,
EmbedEvalUnit unit)
Executes a method defined in Ruby script.
|
<T> T |
callMethod(Object receiver,
String methodName,
Object[] args,
Class<T> returnType)
Executes a method defined in Ruby script.
|
<T> T |
callMethod(Object receiver,
String methodName,
Object[] args,
Class<T> returnType,
EmbedEvalUnit unit)
Executes a method defined in Ruby script.
|
<T> T |
callMethod(Object receiver,
String methodName,
Object singleArg,
Class<T> returnType)
Executes a method defined in Ruby script.
|
IRubyObject |
callSuper(IRubyObject receiver,
IRubyObject[] args) |
IRubyObject |
callSuper(IRubyObject receiver,
IRubyObject[] args,
Block block) |
<T> T |
callSuper(Object receiver,
Object[] args,
Block block,
Class<T> returnType) |
<T> T |
callSuper(Object receiver,
Object[] args,
Class<T> returnType) |
IRubyObject[] |
convertToJavaArray(IRubyObject array) |
RubyInteger |
convertToRubyInteger(IRubyObject obj) |
RubyString |
convertToRubyString(IRubyObject obj) |
IRubyObject |
getInstanceVariable(IRubyObject obj,
String variableName) |
boolean |
isKindOf(IRubyObject value,
RubyModule rubyModule) |
<T> T |
runRubyMethod(Class<T> returnType,
Object receiver,
String methodName,
Block block,
Object... args)
Executes a method defined in Ruby script.
|
IRubyObject |
setInstanceVariable(IRubyObject obj,
String variableName,
IRubyObject value) |
public EmbedRubyObjectAdapterImpl(ScriptingContainer container)
public boolean isKindOf(IRubyObject value, RubyModule rubyModule)
isKindOf in interface RubyObjectAdapterpublic IRubyObject[] convertToJavaArray(IRubyObject array)
convertToJavaArray in interface RubyObjectAdapterpublic RubyInteger convertToRubyInteger(IRubyObject obj)
convertToRubyInteger in interface RubyObjectAdapterpublic RubyString convertToRubyString(IRubyObject obj)
convertToRubyString in interface RubyObjectAdapterpublic IRubyObject setInstanceVariable(IRubyObject obj, String variableName, IRubyObject value)
setInstanceVariable in interface RubyObjectAdapterpublic IRubyObject getInstanceVariable(IRubyObject obj, String variableName)
getInstanceVariable in interface RubyObjectAdapterpublic IRubyObject callMethod(IRubyObject receiver, String methodName)
callMethod in interface RubyObjectAdapterpublic IRubyObject callMethod(IRubyObject receiver, String methodName, IRubyObject singleArg)
callMethod in interface RubyObjectAdapterpublic IRubyObject callMethod(IRubyObject receiver, String methodName, IRubyObject[] args)
callMethod in interface RubyObjectAdapterpublic IRubyObject callMethod(IRubyObject receiver, String methodName, IRubyObject[] args, Block block)
callMethod in interface RubyObjectAdapterpublic IRubyObject callSuper(IRubyObject receiver, IRubyObject[] args)
callSuper in interface RubyObjectAdapterpublic IRubyObject callSuper(IRubyObject receiver, IRubyObject[] args, Block block)
callSuper in interface RubyObjectAdapterpublic <T> T callMethod(Object receiver, String methodName, Class<T> returnType)
EmbedRubyObjectAdaptercallMethod in interface EmbedRubyObjectAdapterreceiver - is an instance that will receive this method callmethodName - is a method name to be calledreturnType - is the type we want it to convert topublic <T> T callMethod(Object receiver, String methodName, Object singleArg, Class<T> returnType)
EmbedRubyObjectAdaptercallMethod in interface EmbedRubyObjectAdapterreceiver - is an instance that will receive this method callmethodName - is a method name to be calledsingleArg - is an method argumentreturnType - returnType is the type we want it to convert topublic <T> T callMethod(Object receiver, String methodName, Object[] args, Class<T> returnType)
EmbedRubyObjectAdaptercallMethod in interface EmbedRubyObjectAdapterreceiver - is an instance that will receive this method callmethodName - is a method name to be calledargs - is an array of method argumentsreturnType - is the type we want it to convert topublic <T> T callMethod(Object receiver, String methodName, Object[] args, Block block, Class<T> returnType)
EmbedRubyObjectAdaptercallMethod in interface EmbedRubyObjectAdapterreceiver - is an instance that will receive this method callmethodName - is a method name to be calledargs - is an array of method arguments except a blockblock - is a block to be executed in this methodreturnType - is the type we want it to convert topublic <T> T callMethod(Object receiver, String methodName, Class<T> returnType, EmbedEvalUnit unit)
EmbedRubyObjectAdaptercallMethod in interface EmbedRubyObjectAdapterreceiver - is an instance that will receive this method callmethodName - is a method name to be calledreturnType - is the type we want it to convert tounit - is parsed unitpublic <T> T callMethod(Object receiver, String methodName, Object[] args, Class<T> returnType, EmbedEvalUnit unit)
EmbedRubyObjectAdaptercallMethod in interface EmbedRubyObjectAdapterreceiver - is an instance that will receive this method callmethodName - is a method name to be calledargs - is an array of method argumentsreturnType - is the type we want it to convert tounit - is parsed unitpublic <T> T callMethod(Object receiver, String methodName, Object[] args, Block block, Class<T> returnType, EmbedEvalUnit unit)
EmbedRubyObjectAdaptercallMethod in interface EmbedRubyObjectAdapterreceiver - is an instance that will receive this method callmethodName - is a method name to be calledargs - is an array of method arguments except a blockblock - is a block to be executed in this methodreturnType - is the type we want it to convert tounit - is parsed unitpublic <T> T callSuper(Object receiver, Object[] args, Class<T> returnType)
callSuper in interface EmbedRubyObjectAdapterreceiver - is an instance that will receive this method callargs - is an array of method argumentsreturnType - is the type we want it to convert topublic <T> T callSuper(Object receiver, Object[] args, Block block, Class<T> returnType)
callSuper in interface EmbedRubyObjectAdapterreceiver - is an instance that will receive this method callargs - is an array of method arguments except a blockblock - is a block to be executed in this methodreturnType - is the type we want it to convert topublic Object callMethod(Object receiver, String methodName, Object... args)
EmbedRubyObjectAdaptercallMethod in interface EmbedRubyObjectAdapterreceiver - is an instance that will receive this method callmethodName - is a method name to be calledargs - are method arguments.public Object callMethod(Object receiver, String methodName, Block block, Object... args)
EmbedRubyObjectAdaptercallMethod in interface EmbedRubyObjectAdapterreceiver - is an instance that will receive this method callmethodName - is a method name to be calledblock - is a block to be executed in this methodargs - is an array of method arguments except a blockpublic <T> T runRubyMethod(Class<T> returnType, Object receiver, String methodName, Block block, Object... args)
EmbedRubyObjectAdapterrunRubyMethod in interface EmbedRubyObjectAdapterreturnType - is the type we want it to convert toreceiver - is an instance that will receive this method call. The receiver
can be null or other Java objects. The null will be converted to
RubyNil or wrapped in RubyObject.methodName - is a method name to be calledblock - is an optional Block object. Send null for no block.args - is an array of method argumentsCopyright © 2001-2015 JRuby. All Rights Reserved.