Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
**** BEGIN LICENSE BLOCK ***** Version: CPL 1.0/GPL 2.0/LGPL 2.1 The contents of this file are subject to the Common Public License Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.eclipse.org/legal/cpl-v10.html Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. Copyright (C) 2009-2012 Yoko Harada <yokolet@gmail.com> Alternatively, the contents of this file may be used under the terms of either of the GNU General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the LGPL are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of either the GPL or the LGPL, and not to allow others to use your version of this file under the terms of the CPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the GPL or the LGPL. If you do not delete the provisions above, a recipient may use your version of this file under the terms of any one of the CPL, the GPL or the LGPL. **** END LICENSE BLOCK *****
 
 package org.jruby.embed;
 
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(s):
Yoko Harada <yokolet@gmail.com>
 
 public interface EmbedRubyObjectAdapter extends RubyObjectAdapter {
    
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
 
     Object callMethod(Object receiverString methodNameObject... 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
 
     Object callMethod(Object receiverString methodNameBlock blockObject... args);

    
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
 
     <T> T callMethod(Object receiverString methodNameClass<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
 
     <T> T callMethod(Object receiverString methodNameObject singleArgClass<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
 
     <T> T callMethod(Object receiverString methodNameObject[] argsClass<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
    <T> T callMethod(Object receiverString methodNameObject[] argsBlock blockClass<T> returnType);

    
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
    <T> T callMethod(Object receiverString methodNameClass<T> returnTypeEmbedEvalUnit 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
    <T> T callMethod(Object receiverString methodNameObject[] argsClass<T> returnTypeEmbedEvalUnit 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
    <T> T callMethod(Object receiverString methodNameObject[] argsBlock blockClass<T> returnTypeEmbedEvalUnit unit);

    

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
    <T> T callSuper(Object receiverObject[] argsClass<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
    <T> T callSuper(Object receiverObject[] argsBlock blockClass<T> returnType);
    
    
Executes a method defined in Ruby script.

Parameters:
returnType is the type we want it to convert to
receiver 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 called
block is an optional Block object. Send null for no block.
args is an array of method arguments
Returns:
an instance of requested Java type
    <T> T runRubyMethod(Class<T> returnTypeObject receiverString methodNameBlock blockObject... args);
New to GrepCode? Check out our FAQ X