|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BiVariable
Represents bidirectional, both Java and Ruby, variables. Users don't instantiate
BiVariable type objects. Instead, users can get this type object from
BiVariableMap
after a variable is set to the map. Users can set variables
in Java program explicitly through put() methods in ScriptingContainer
and BiVariableMap
or equivalents. However, variables in Ruby scripts are
set in the map implicitly. When variables and constants
are used in the script, those are automatically saved in the map converting to this type.
Nested Class Summary | |
---|---|
static class |
BiVariable.Type
Defines a type correspond to Ruby's variables and constant types. |
Method Summary | |
---|---|
java.lang.Object |
getJavaObject()
Returns a value of the variable this object holds in Java type. |
java.lang.String |
getName()
Returns a name of the variable this object holds. |
IRubyObject |
getReceiver()
Returns the original receiver where this variable has been retrieved. |
IRubyObject |
getRubyObject()
Returns a value of the variable this object holds in a org.jruby.runtime.builtin.IRubyObject type. |
BiVariable.Type |
getType()
Returns one of the Ruby's variables or constant types defined by Type. |
void |
inject()
Injects a variable value to a parsed Ruby script. |
boolean |
isReceiverIdentical(RubyObject receiver)
Returns true if a given receiver is identical to the receiver this object has. |
void |
remove()
Attempts to remove this variable/constant from top self or receiver. |
void |
setJavaObject(Ruby runtime,
java.lang.Object javaObject)
Sets a Java object as a value of this object. |
void |
setRubyObject(IRubyObject rubyObject)
Sets a org.jruby.runtime.builtin.IRubyObject type, Ruby object as a value of this object. |
Method Detail |
---|
BiVariable.Type getType()
IRubyObject getReceiver()
boolean isReceiverIdentical(RubyObject receiver)
java.lang.String getName()
java.lang.Object getJavaObject()
void setJavaObject(Ruby runtime, java.lang.Object javaObject)
runtime
- is used to convert a Java object to Ruby object.javaObject
- is a variable value to be set.void inject()
IRubyObject getRubyObject()
void setRubyObject(IRubyObject rubyObject)
runtime
- is environment where a variable injection occursrubyObject
- is a variable value to be set.void remove()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |