jruby/docs BETA
Navigation
org.jruby.embed 16
E AttributeName
I EmbedEvalUnit
I EmbedRubyInstanceConfigAdapter
I EmbedRubyInterfaceAdapter
I EmbedRubyObjectAdapter
I EmbedRubyRuntimeAdapter
C EvalFailedException
A Extension
C InvokeFailedException
C IsolatedScriptingContainer
E LocalContextScope
E LocalVariableBehavior
C ParseFailedException
E PathType
E PropertyName
C ScriptingContainer
EmbedRubyObjectAdapter — members 12+
M call_method(receiver, method_name, args) Object
M call_method(receiver, method_name, block, args) Object
M call_method(receiver, method_name, return_type) T
M call_method(receiver, method_name, single_arg, return_type) T
M call_method(receiver, method_name, args, return_type) T
M call_method(receiver, method_name, args, block, return_type) T
M call_method(receiver, method_name, return_type, unit) T
M call_method(receiver, method_name, args, return_type, unit) T
M call_method(receiver, method_name, args, block, return_type, unit) T
M call_super(receiver, args, return_type) T
M call_super(receiver, args, block, return_type) T
M run_ruby_method(return_type, receiver, method_name, block, args) T
from RubyObjectAdapter
M call_method(receiver, method_name) IRubyObject
M call_method(receiver, method_name, single_arg) IRubyObject
M call_method(receiver, method_name, args) IRubyObject
M call_method(receiver, method_name, args, block) IRubyObject
M call_super(receiver, args) IRubyObject
M call_super(receiver, args, block) IRubyObject
M convert_to_java_array(array) IRubyObject[]
M convert_to_ruby_integer(obj) RubyInteger
M convert_to_ruby_string(obj) RubyString
M get_instance_variable(obj, variable_name) IRubyObject
M is_kind_of(value, ruby_module) boolean
M set_instance_variable(obj, variable_name, value) IRubyObject

org.jruby.embed.EmbedRubyObjectAdapter

interface abstract implements RubyObjectAdapter 12 members

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.

Instance Methods

call_method

Object call_method ( Object receiver, String method_name, Object[] args )
Java: callMethod(Object receiver, String methodName, Object[] args)

Executes a method defined in Ruby script.

nametypedescription
receiverObjectis an instance that will receive this method call
method_nameStringis a method name to be called
argsObject[]are method arguments.

Returns: an instance automatically converted from Ruby to Java

call_method

Object call_method ( Object receiver, String method_name, Block block, Object[] args )
Java: callMethod(Object receiver, String methodName, org.jruby.runtime.Block block, Object[] args)

Executes a method defined in Ruby script. This method is used when a Ruby method has a block in its arguments.

nametypedescription
receiverObjectis an instance that will receive this method call
method_nameStringis a method name to be called
blockorg.jruby.runtime.Blockis a block to be executed in this method
argsObject[]is an array of method arguments except a block

Returns: an instance of automatically converted Java type

call_method

T call_method ( Object receiver, String method_name, Class<T> return_type )
Java: callMethod(Object receiver, String methodName, Class<T> returnType)

Executes a method defined in Ruby script. This method is used when a Ruby method does not have any argument.

nametypedescription
receiverObjectis an instance that will receive this method call
method_nameStringis a method name to be called
return_typeClass<T>is the type we want it to convert to

Returns: an instance of requested Java type

call_method

T call_method ( Object receiver, String method_name, Object single_arg, Class<T> return_type )
Java: callMethod(Object receiver, String methodName, Object singleArg, Class<T> returnType)

Executes a method defined in Ruby script. This method is used when a Ruby method have only one argument.

nametypedescription
receiverObjectis an instance that will receive this method call
method_nameStringis a method name to be called
single_argObjectis an method argument
return_typeClass<T>returnType is the type we want it to convert to

Returns: an instance of requested Java type

call_method

T call_method ( Object receiver, String method_name, Object[] args, Class<T> return_type )
Java: callMethod(Object receiver, String methodName, Object[] args, Class<T> returnType)

Executes a method defined in Ruby script. This method is used when a Ruby method have multiple arguments.

nametypedescription
receiverObjectis an instance that will receive this method call
method_nameStringis a method name to be called
argsObject[]is an array of method arguments
return_typeClass<T>is the type we want it to convert to

Returns: an instance of requested Java type

call_method

T call_method ( Object receiver, String method_name, Object[] args, Block block, Class<T> return_type )
Java: callMethod(Object receiver, String methodName, Object[] args, org.jruby.runtime.Block block, 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.

nametypedescription
receiverObjectis an instance that will receive this method call
method_nameStringis a method name to be called
argsObject[]is an array of method arguments except a block
blockorg.jruby.runtime.Blockis a block to be executed in this method
return_typeClass<T>is the type we want it to convert to

Returns: an instance of requested Java type

call_method

T call_method ( Object receiver, String method_name, Class<T> return_type, EmbedEvalUnit unit )
Java: callMethod(Object receiver, String methodName, Class<T> returnType, org.jruby.embed.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.

nametypedescription
receiverObjectis an instance that will receive this method call
method_nameStringis a method name to be called
return_typeClass<T>is the type we want it to convert to
unitorg.jruby.embed.EmbedEvalUnitis parsed unit

Returns: an instance of requested Java type

call_method

T call_method ( Object receiver, String method_name, Object[] args, Class<T> return_type, EmbedEvalUnit unit )
Java: callMethod(Object receiver, String methodName, Object[] args, Class<T> returnType, org.jruby.embed.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.

nametypedescription
receiverObjectis an instance that will receive this method call
method_nameStringis a method name to be called
argsObject[]is an array of method arguments
return_typeClass<T>is the type we want it to convert to
unitorg.jruby.embed.EmbedEvalUnitis parsed unit

Returns: an instance of requested Java type

call_method

T call_method ( Object receiver, String method_name, Object[] args, Block block, Class<T> return_type, EmbedEvalUnit unit )
Java: callMethod(Object receiver, String methodName, Object[] args, org.jruby.runtime.Block block, Class<T> returnType, org.jruby.embed.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.

nametypedescription
receiverObjectis an instance that will receive this method call
method_nameStringis a method name to be called
argsObject[]is an array of method arguments except a block
blockorg.jruby.runtime.Blockis a block to be executed in this method
return_typeClass<T>is the type we want it to convert to
unitorg.jruby.embed.EmbedEvalUnitis parsed unit

Returns: is the type we want it to convert to

call_super

T call_super ( Object receiver, Object[] args, Class<T> return_type )
Java: callSuper(Object receiver, Object[] args, Class<T> returnType)
nametypedescription
receiverObjectis an instance that will receive this method call
argsObject[]is an array of method arguments
return_typeClass<T>is the type we want it to convert to

Returns: is the type we want it to convert to

call_super

T call_super ( Object receiver, Object[] args, Block block, Class<T> return_type )
Java: callSuper(Object receiver, Object[] args, org.jruby.runtime.Block block, Class<T> returnType)
nametypedescription
receiverObjectis an instance that will receive this method call
argsObject[]is an array of method arguments except a block
blockorg.jruby.runtime.Blockis a block to be executed in this method
return_typeClass<T>is the type we want it to convert to

Returns: is the type we want it to convert to

run_ruby_method

T run_ruby_method ( Class<T> return_type, Object receiver, String method_name, Block block, Object[] args )
Java: runRubyMethod(Class<T> returnType, Object receiver, String methodName, org.jruby.runtime.Block block, Object[] args)

Executes a method defined in Ruby script.

nametypedescription
return_typeClass<T>is the type we want it to convert to
receiverObjectis 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.
method_nameStringis a method name to be called
blockorg.jruby.runtime.Blockis an optional Block object. Send null for no block.
argsObject[]is an array of method arguments

Returns: an instance of requested Java type

Inherited

from RubyObjectAdapter

call_method

IRubyObject call_method ( IRubyObject receiver, String method_name )
Java: callMethod(org.jruby.runtime.builtin.IRubyObject receiver, String methodName)

call_method

IRubyObject call_method ( IRubyObject receiver, String method_name, IRubyObject single_arg )
Java: callMethod(org.jruby.runtime.builtin.IRubyObject receiver, String methodName, org.jruby.runtime.builtin.IRubyObject singleArg)

call_method

IRubyObject call_method ( IRubyObject receiver, String method_name, IRubyObject[] args )
Java: callMethod(org.jruby.runtime.builtin.IRubyObject receiver, String methodName, org.jruby.runtime.builtin.IRubyObject[] args)

call_method

IRubyObject call_method ( IRubyObject receiver, String method_name, IRubyObject[] args, Block block )
Java: callMethod(org.jruby.runtime.builtin.IRubyObject receiver, String methodName, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)

call_super

IRubyObject call_super ( IRubyObject receiver, IRubyObject[] args )
Java: callSuper(org.jruby.runtime.builtin.IRubyObject receiver, org.jruby.runtime.builtin.IRubyObject[] args)

call_super

IRubyObject call_super ( IRubyObject receiver, IRubyObject[] args, Block block )
Java: callSuper(org.jruby.runtime.builtin.IRubyObject receiver, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)

convert_to_java_array

IRubyObject[] convert_to_java_array ( IRubyObject array )
Java: convertToJavaArray(org.jruby.runtime.builtin.IRubyObject array)

convert_to_ruby_integer

RubyInteger convert_to_ruby_integer ( IRubyObject obj )
Java: convertToRubyInteger(org.jruby.runtime.builtin.IRubyObject obj)

convert_to_ruby_string

RubyString convert_to_ruby_string ( IRubyObject obj )
Java: convertToRubyString(org.jruby.runtime.builtin.IRubyObject obj)

get_instance_variable

IRubyObject get_instance_variable ( IRubyObject obj, String variable_name )
Java: getInstanceVariable(org.jruby.runtime.builtin.IRubyObject obj, String variableName)

is_kind_of

boolean is_kind_of ( IRubyObject value, RubyModule ruby_module )
Java: isKindOf(org.jruby.runtime.builtin.IRubyObject value, org.jruby.RubyModule rubyModule)

set_instance_variable

IRubyObject set_instance_variable ( IRubyObject obj, String variable_name, IRubyObject value )
Java: setInstanceVariable(org.jruby.runtime.builtin.IRubyObject obj, String variableName, org.jruby.runtime.builtin.IRubyObject value)