org.jruby.embed
Interface EmbedRubyObjectAdapter

All Superinterfaces:
RubyObjectAdapter
All Known Implementing Classes:
EmbedRubyObjectAdapterImpl

public interface EmbedRubyObjectAdapter
extends RubyObjectAdapter

Wrapper interface of RubyObjectAdapter for embedding. Methods' arguments can have simple Java objects for easiness. Each methods converts returned object to a Java type specified in the argument.

Author:
Yoko Harada

Method Summary
 java.lang.Object callMethod(java.lang.Object receiver, java.lang.String methodName, Block block, java.lang.Object... args)
          Executes a method defined in Ruby script.
<T> T
callMethod(java.lang.Object receiver, java.lang.String methodName, java.lang.Class<T> returnType)
          Executes a method defined in Ruby script.
<T> T
callMethod(java.lang.Object receiver, java.lang.String methodName, java.lang.Class<T> returnType, EmbedEvalUnit unit)
          Executes a method defined in Ruby script.
 java.lang.Object callMethod(java.lang.Object receiver, java.lang.String methodName, java.lang.Object... args)
          Executes a method defined in Ruby script.
<T> T
callMethod(java.lang.Object receiver, java.lang.String methodName, java.lang.Object[] args, Block block, java.lang.Class<T> returnType)
          Executes a method defined in Ruby script.
<T> T
callMethod(java.lang.Object receiver, java.lang.String methodName, java.lang.Object[] args, Block block, java.lang.Class<T> returnType, EmbedEvalUnit unit)
          Executes a method defined in Ruby script.
<T> T
callMethod(java.lang.Object receiver, java.lang.String methodName, java.lang.Object[] args, java.lang.Class<T> returnType)
          Executes a method defined in Ruby script.
<T> T
callMethod(java.lang.Object receiver, java.lang.String methodName, java.lang.Object[] args, java.lang.Class<T> returnType, EmbedEvalUnit unit)
          Executes a method defined in Ruby script.
<T> T
callMethod(java.lang.Object receiver, java.lang.String methodName, java.lang.Object singleArg, java.lang.Class<T> returnType)
          Executes a method defined in Ruby script.
<T> T
callSuper(java.lang.Object receiver, java.lang.Object[] args, Block block, java.lang.Class<T> returnType)
           
<T> T
callSuper(java.lang.Object receiver, java.lang.Object[] args, java.lang.Class<T> returnType)
           
 
Methods inherited from interface org.jruby.RubyObjectAdapter
callMethod, callMethod, callMethod, callMethod, callSuper, callSuper, convertToJavaArray, convertToRubyInteger, convertToRubyString, getInstanceVariable, isKindOf, setInstanceVariable
 

Method Detail

callMethod

java.lang.Object callMethod(java.lang.Object receiver,
                            java.lang.String methodName,
                            java.lang.Object... args)
Executes a method defined in Ruby script.

Parameters:
receiver - is an instance that will receive this method call
methodName - is a method name to be called
args - are method arguments.
Returns:
an instance automatically converted from Ruby to Java

callMethod

java.lang.Object callMethod(java.lang.Object receiver,
                            java.lang.String methodName,
                            Block block,
                            java.lang.Object... args)
Executes a method defined in Ruby script. This method is used when a Ruby method has a block in its arguments.

Parameters:
receiver - is an instance that will receive this method call
methodName - is a method name to be called
args - is an array of method arguments except a block
block - is a block to be executed in this method
Returns:
an instance of automatically converted Java type

callMethod

<T> T callMethod(java.lang.Object receiver,
                 java.lang.String methodName,
                 java.lang.Class<T> returnType)
Executes a method defined in Ruby script. This method is used when a Ruby method does not have any argument.

Parameters:
receiver - is an instance that will receive this method call
methodName - is a method name to be called
returnType - is the type we want it to convert to
Returns:
an instance of requested Java type

callMethod

<T> T callMethod(java.lang.Object receiver,
                 java.lang.String methodName,
                 java.lang.Object singleArg,
                 java.lang.Class<T> returnType)
Executes a method defined in Ruby script. This method is used when a Ruby method have only one argument.

Parameters:
receiver - is an instance that will receive this method call
methodName - is a method name to be called
singleArg - is an method argument
returnType - returnType is the type we want it to convert to
Returns:
an instance of requested Java type

callMethod

<T> T callMethod(java.lang.Object receiver,
                 java.lang.String methodName,
                 java.lang.Object[] args,
                 java.lang.Class<T> returnType)
Executes a method defined in Ruby script. This method is used when a Ruby method have multiple arguments.

Parameters:
receiver - is an instance that will receive this method call
methodName - is a method name to be called
args - is an array of method arguments
returnType - is the type we want it to convert to
Returns:
an instance of requested Java type

callMethod

<T> T callMethod(java.lang.Object receiver,
                 java.lang.String methodName,
                 java.lang.Object[] args,
                 Block block,
                 java.lang.Class<T> returnType)
Executes a method defined in Ruby script. This method is used when a Ruby method have multiple arguments, one of which is a block.

Parameters:
receiver - is an instance that will receive this method call
methodName - is a method name to be called
args - is an array of method arguments except a block
block - is a block to be executed in this method
returnType - is the type we want it to convert to
Returns:
an instance of requested Java type

callMethod

<T> T callMethod(java.lang.Object receiver,
                 java.lang.String methodName,
                 java.lang.Class<T> returnType,
                 EmbedEvalUnit unit)
Executes a method defined in Ruby script. This method is used when a Ruby method does not have any argument, and users want to inject Ruby's local variables' values from Java.

Parameters:
receiver - is an instance that will receive this method call
methodName - is a method name to be called
returnType - is the type we want it to convert to
unit - is parsed unit
Returns:
an instance of requested Java type

callMethod

<T> T callMethod(java.lang.Object receiver,
                 java.lang.String methodName,
                 java.lang.Object[] args,
                 java.lang.Class<T> returnType,
                 EmbedEvalUnit unit)
Executes a method defined in Ruby script. This method is used when a Ruby method have multiple arguments, and users want to inject Ruby's local variables' values from Java.

Parameters:
receiver - is an instance that will receive this method call
methodName - is a method name to be called
args - is an array of method arguments
returnType - is the type we want it to convert to
unit - is parsed unit
Returns:
an instance of requested Java type

callMethod

<T> T callMethod(java.lang.Object receiver,
                 java.lang.String methodName,
                 java.lang.Object[] args,
                 Block block,
                 java.lang.Class<T> returnType,
                 EmbedEvalUnit unit)
Executes a method defined in Ruby script. This method is used when a Ruby method have multiple arguments, one of which is a block, and users want to inject Ruby's local variables' values from Java.

Parameters:
receiver - is an instance that will receive this method call
methodName - is a method name to be called
args - is an array of method arguments except a block
block - is a block to be executed in this method
returnType - is the type we want it to convert to
unit - is parsed unit
Returns:
is the type we want it to convert to

callSuper

<T> T callSuper(java.lang.Object receiver,
                java.lang.Object[] args,
                java.lang.Class<T> returnType)
Parameters:
receiver - is an instance that will receive this method call
args - is an array of method arguments
returnType - is the type we want it to convert to
Returns:
is the type we want it to convert to

callSuper

<T> T callSuper(java.lang.Object receiver,
                java.lang.Object[] args,
                Block block,
                java.lang.Class<T> returnType)
Parameters:
receiver - is an instance that will receive this method call
args - is an array of method arguments except a block
block - is a block to be executed in this method
returnType - is the type we want it to convert to
Returns:
is the type we want it to convert to


Copyright © 2002-2009 JRuby Team. All Rights Reserved.