abstract class AbstractVariable extends java.lang.Object implements BiVariable
BiVariable.Type| Modifier and Type | Field and Description |
|---|---|
protected boolean |
fromRuby |
protected IRubyObject |
irubyObject |
protected java.lang.Object |
javaObject |
protected java.lang.Class |
javaType |
protected java.lang.String |
name |
protected IRubyObject |
receiver |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractVariable(IRubyObject receiver,
java.lang.String name,
boolean fromRuby)
Constructor used when this variable is originaed from Java.
|
protected |
AbstractVariable(IRubyObject receiver,
java.lang.String name,
boolean fromRuby,
IRubyObject rubyObject)
Constructor when the variable is originated from Ruby.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) ThreadContext |
getCurrentContext() |
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.
|
protected static RubyModule |
getRubyClass(Ruby runtime) |
IRubyObject |
getRubyObject()
Returns a value of the variable this object holds in
a org.jruby.runtime.builtin.IRubyObject type.
|
(package private) Ruby |
getRuntime() |
(package private) RubyObject |
getTopSelf() |
(package private) static RubyObject |
getTopSelf(IRubyObject receiver) |
boolean |
isReceiverIdentical(RubyObject receiver)
Returns true if a given receiver is identical to the receiver this object has.
|
protected static boolean |
isValidName(java.lang.String pattern,
java.lang.Object name) |
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.
|
protected void |
updateByJavaObject(Ruby runtime,
java.lang.Object... values) |
protected void |
updateRubyObject(IRubyObject rubyObject) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetType, inject, removeprotected final IRubyObject receiver
protected final java.lang.String name
protected java.lang.Object javaObject
protected java.lang.Class javaType
protected IRubyObject irubyObject
protected boolean fromRuby
protected AbstractVariable(IRubyObject receiver, java.lang.String name, boolean fromRuby)
runtime - name - fromRuby - values - protected AbstractVariable(IRubyObject receiver, java.lang.String name, boolean fromRuby, IRubyObject rubyObject)
receiver - a receiver object that this variable/constant is originally in. When
the variable/constant is originated from Ruby, receiver may not be null.name - fromRuby - rubyObject - final Ruby getRuntime()
final ThreadContext getCurrentContext()
final RubyObject getTopSelf()
static RubyObject getTopSelf(IRubyObject receiver)
protected void updateByJavaObject(Ruby runtime, java.lang.Object... values)
protected void updateRubyObject(IRubyObject rubyObject)
public IRubyObject getReceiver()
BiVariablegetReceiver in interface BiVariablepublic boolean isReceiverIdentical(RubyObject receiver)
isReceiverIdentical in interface BiVariablepublic java.lang.String getName()
BiVariablegetName in interface BiVariablepublic java.lang.Object getJavaObject()
BiVariablegetJavaObject in interface BiVariablepublic void setJavaObject(Ruby runtime, java.lang.Object javaObject)
BiVariablesetJavaObject in interface BiVariableruntime - is used to convert a Java object to Ruby object.javaObject - is a variable value to be set.public IRubyObject getRubyObject()
BiVariablegetRubyObject in interface BiVariablepublic void setRubyObject(IRubyObject rubyObject)
BiVariablesetRubyObject in interface BiVariablerubyObject - is a variable value to be set.protected static RubyModule getRubyClass(Ruby runtime)
protected static boolean isValidName(java.lang.String pattern,
java.lang.Object name)