public class LocalGlobalVariable extends GlobalVariable
BiVariable.Type| Modifier and Type | Field and Description |
|---|---|
protected boolean |
fromRuby |
protected IRubyObject |
irubyObject |
protected Object |
javaObject |
protected Class |
javaType |
protected String |
name |
protected IRubyObject |
receiver |
| Modifier and Type | Method and Description |
|---|---|
static BiVariable |
getInstance(RubyObject receiver,
String name,
Object... javaObject)
Returns an instance of this class.
|
Object |
getJavaObject()
Returns a value of the variable this object holds in Java type.
|
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.
|
BiVariable.Type |
getType()
Returns enum type of this variable defined in
BiVariable. |
void |
inject()
Injects a global value to a parsed Ruby script.
|
static boolean |
isValidName(Object name)
Returns true if the given name is a local global type variable.
|
protected static boolean |
isValidName(String pattern,
Object name) |
void |
remove()
Removes this object from
BiVariableMap. |
static void |
retrieve(RubyObject receiver,
BiVariableMap vars)
Retrieves global variables eagerly from Ruby right after the evaluation.
|
static void |
retrieveByKey(Ruby runtime,
BiVariableMap vars,
String name)
Retrieves a global variable by key from Ruby runtime after the evaluation.
|
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,
Object... values) |
protected void |
updateRubyObject(IRubyObject rubyObject) |
isPredefined, isReceiverIdentical, retrieve, setJavaObject, tryEagerInjection, tryEagerInjectionprotected final IRubyObject receiver
protected final String name
protected Object javaObject
protected Class javaType
protected IRubyObject irubyObject
protected boolean fromRuby
public static BiVariable getInstance(RubyObject receiver, String name, Object... javaObject)
BiVariableMap.runtime - Ruby runtimename - a variable namejavaObject - Java object that should be assigned to.public static void retrieve(RubyObject receiver, BiVariableMap vars)
receiver - receiver object returned when a script is evaluated.vars - map to save retrieved global variables.public static void retrieveByKey(Ruby runtime, BiVariableMap vars, String name)
runtime - Ruby runtimevars - map to save a retrieved global variable.name - name of the global variablepublic BiVariable.Type getType()
BiVariable.getType in interface BiVariablegetType in class GlobalVariablepublic static boolean isValidName(Object name)
name - is a name to be checked.public void inject()
inject in interface BiVariableinject in class GlobalVariablepublic void remove()
BiVariableMap.remove in interface BiVariableremove in class GlobalVariableruntime - environment where a variable is removed.protected void updateRubyObject(IRubyObject rubyObject)
public IRubyObject getReceiver()
BiVariablegetReceiver in interface BiVariablepublic String getName()
BiVariablegetName in interface BiVariablepublic Object getJavaObject()
BiVariablegetJavaObject in interface BiVariablepublic 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)
Copyright © 2001-2015 JRuby. All Rights Reserved.