|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.RubyModule
org.jruby.RubyClass
org.jruby.IncludedModuleWrapper
public final class IncludedModuleWrapper
This class is used to provide an intermediate superclass for modules and classes that include other modules. It inserts itself as the immediate superClass of the includer, but defers all module methods to the actual superclass. Multiple of these intermediate superclasses can be added for multiple included modules. This allows the normal superclass-based searches (searchMethod, getConstant, etc) to traverse the superclass ancestors as normal while the included modules do not actually show up in direct inheritance traversal.
RubyModule,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.jruby.RubyClass |
|---|
RubyClass.VariableAccessor |
| Nested classes/interfaces inherited from class org.jruby.RubyModule |
|---|
RubyModule.CacheEntryFactory, RubyModule.KindOf, RubyModule.MethodClumper, RubyModule.ModuleKernelMethods, RubyModule.ProfilingCacheEntryFactory, RubyModule.RespondToMissingMethod, RubyModule.SynchronizedCacheEntryFactory, RubyModule.WrapperCacheEntryFactory |
| Nested classes/interfaces inherited from class org.jruby.RubyObject |
|---|
RubyObject.Data |
| Nested classes/interfaces inherited from class org.jruby.RubyBasicObject |
|---|
RubyBasicObject.Finalizer |
| Field Summary |
|---|
| Fields inherited from class org.jruby.RubyClass |
|---|
CLASS_ALLOCATOR, CS_IDX_INITIALIZE, CS_NAMES, DEFAULT_OBJECT_MARSHAL, marshal, runtime |
| Fields inherited from class org.jruby.RubyModule |
|---|
classId, ERR_FROZEN_CONST_TYPE, ERR_FROZEN_CVAR_TYPE, ERR_INSECURE_SET_CLASS_VAR, ERR_INSECURE_SET_CONSTANT, generation, id, includingHierarchies, index, kindOf, MODULE_ALLOCATOR, NormalCacheEntryFactory, parent, SCOPE_CAPTURING_METHODS, superClass |
| Fields inherited from class org.jruby.RubyObject |
|---|
OBJECT_ALLOCATOR, REIFYING_OBJECT_ALLOCATOR |
| Fields inherited from class org.jruby.RubyBasicObject |
|---|
ALL_F, BASICOBJECT_ALLOCATOR, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, NEVER, NIL_F, TAINTED_F, UNDEF, UNTRUSTED_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F |
| Fields inherited from interface org.jruby.runtime.builtin.IRubyObject |
|---|
NULL_ARRAY |
| Constructor Summary | |
|---|---|
IncludedModuleWrapper(Ruby runtime,
RubyClass superClass,
RubyModule delegate)
|
|
| Method Summary | |
|---|---|
void |
addMethod(java.lang.String name,
DynamicMethod method)
|
protected boolean |
constantTableContains(java.lang.String name)
|
protected boolean |
constantTableFastContains(java.lang.String internedName)
|
protected IRubyObject |
constantTableFastFetch(java.lang.String internedName)
|
protected IRubyObject |
constantTableFastStore(java.lang.String internedName,
IRubyObject value)
|
protected IRubyObject |
constantTableFetch(java.lang.String name)
|
protected IRubyObject |
constantTableRemove(java.lang.String name)
|
protected IRubyObject |
constantTableStore(java.lang.String name,
IRubyObject value)
|
protected java.util.Map<java.lang.String,IRubyObject> |
getClassVariables()
|
protected java.util.Map<java.lang.String,IRubyObject> |
getClassVariablesForRead()
|
java.util.Collection<java.lang.String> |
getConstantNames()
|
java.util.Map<java.lang.String,DynamicMethod> |
getMethods()
|
java.util.Map<java.lang.String,DynamicMethod> |
getMethodsForWrite()
|
java.lang.String |
getName()
Generate a fully-qualified class name or a #-style name for anonymous and singleton classes. |
RubyModule |
getNonIncludedClass()
|
RubyClass |
getRealClass()
|
java.util.List<java.lang.String> |
getStoredConstantNameList()
Deprecated. |
IRubyObject |
id()
We don't want to reveal ourselves to Ruby code, so delegate this operation. |
boolean |
isClass()
Specifically polymorphic method that are meant to be overridden by classes to specify that they are classes in an easy way. |
boolean |
isImmediate()
Is object immediate (def: Fixnum, Symbol, true, false, nil?). |
boolean |
isIncluded()
Is this module one that in an included one (e.g. |
boolean |
isModule()
Specifically polymorphic method that are meant to be overridden by modules to specify that they are modules in an easy way. |
protected boolean |
isSame(RubyModule module)
|
IncludedModuleWrapper |
newIncludeClass(RubyClass superClass)
Deprecated. |
void |
setMetaClass(RubyClass newRubyClass)
Makes it possible to change the metaclass of an object. |
void |
setMethods(java.util.Map newMethods)
|
protected boolean |
variableTableContains(java.lang.String name)
Checks if the variable table contains a variable of the specified name. |
protected boolean |
variableTableFastContains(java.lang.String internedName)
Checks if the variable table contains the the variable of the specified name, where the precondition is that the name must be an interned Java String. |
protected java.lang.Object |
variableTableFastFetch(java.lang.String internedName)
Fetch an object from the variable table based on the name, where the name must be an interned Java String. |
protected java.lang.Object |
variableTableFastStore(java.lang.String internedName,
java.lang.Object value)
Will store the value under the specified name, where the name needs to be an interned Java String. |
protected java.lang.Object |
variableTableFetch(java.lang.String name)
Fetch an object from the variable table based on the name. |
protected java.lang.Object |
variableTableRemove(java.lang.String name)
Removes the entry with the specified name from the variable table, and returning the removed value. |
protected java.lang.Object |
variableTableStore(java.lang.String name,
java.lang.Object value)
Store a value in the variable store under the specific name. |
protected void |
variableTableSync(java.util.List<Variable<java.lang.Object>> vars)
Synchronize the variable table with the argument. |
| Methods inherited from class org.jruby.RubyObject |
|---|
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, eqlInternal, equalInternal, initialize, puts, specificEval, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IncludedModuleWrapper(Ruby runtime,
RubyClass superClass,
RubyModule delegate)
| Method Detail |
|---|
@Deprecated public IncludedModuleWrapper newIncludeClass(RubyClass superClass)
newIncludeClass in class RubyModuleRubyModule.newIncludeClass(RubyClass)public boolean isModule()
RubyBasicObject
isModule in interface IRubyObjectisModule in class RubyClass(someObject instanceof RubyModule) instead.public boolean isClass()
RubyBasicObject
isClass in interface IRubyObjectisClass in class RubyClass(someObject instanceof RubyClass/MetaClass) instead.public boolean isIncluded()
RubyModule
isIncluded in class RubyModulepublic boolean isImmediate()
RubyBasicObject
isImmediate in interface IRubyObjectisImmediate in class RubyBasicObjectpublic void setMetaClass(RubyClass newRubyClass)
RubyBasicObject
setMetaClass in class RubyBasicObjectpublic java.util.Map<java.lang.String,DynamicMethod> getMethods()
getMethods in class RubyModulepublic java.util.Map<java.lang.String,DynamicMethod> getMethodsForWrite()
getMethodsForWrite in class RubyModule
public void addMethod(java.lang.String name,
DynamicMethod method)
addMethod in class RubyModulepublic void setMethods(java.util.Map newMethods)
public java.lang.String getName()
RubyModule
getName in class RubyModulepublic RubyModule getNonIncludedClass()
getNonIncludedClass in class RubyModulepublic RubyClass getRealClass()
getRealClass in class RubyClassprotected boolean isSame(RubyModule module)
isSame in class RubyModulepublic IRubyObject id()
id in interface IRubyObjectid in class RubyBasicObjectprotected java.util.Map<java.lang.String,IRubyObject> getClassVariables()
getClassVariables in class RubyModuleprotected java.util.Map<java.lang.String,IRubyObject> getClassVariablesForRead()
getClassVariablesForRead in class RubyModuleprotected boolean variableTableContains(java.lang.String name)
RubyBasicObject
variableTableContains in class RubyBasicObjectprotected boolean variableTableFastContains(java.lang.String internedName)
RubyBasicObject
variableTableFastContains in class RubyBasicObjectprotected java.lang.Object variableTableFetch(java.lang.String name)
RubyBasicObject
variableTableFetch in class RubyBasicObjectprotected java.lang.Object variableTableFastFetch(java.lang.String internedName)
RubyBasicObject
variableTableFastFetch in class RubyBasicObject
protected java.lang.Object variableTableStore(java.lang.String name,
java.lang.Object value)
RubyBasicObject
variableTableStore in class RubyBasicObject
protected java.lang.Object variableTableFastStore(java.lang.String internedName,
java.lang.Object value)
RubyBasicObject
variableTableFastStore in class RubyBasicObjectprotected java.lang.Object variableTableRemove(java.lang.String name)
RubyBasicObject
variableTableRemove in class RubyBasicObjectprotected void variableTableSync(java.util.List<Variable<java.lang.Object>> vars)
RubyBasicObject
variableTableSync in class RubyBasicObjectprotected boolean constantTableContains(java.lang.String name)
constantTableContains in class RubyModuleprotected boolean constantTableFastContains(java.lang.String internedName)
constantTableFastContains in class RubyModuleprotected IRubyObject constantTableFetch(java.lang.String name)
constantTableFetch in class RubyModuleprotected IRubyObject constantTableFastFetch(java.lang.String internedName)
constantTableFastFetch in class RubyModule
protected IRubyObject constantTableStore(java.lang.String name,
IRubyObject value)
constantTableStore in class RubyModule
protected IRubyObject constantTableFastStore(java.lang.String internedName,
IRubyObject value)
constantTableFastStore in class RubyModuleprotected IRubyObject constantTableRemove(java.lang.String name)
constantTableRemove in class RubyModule@Deprecated public java.util.List<java.lang.String> getStoredConstantNameList()
getStoredConstantNameList in class RubyModulepublic java.util.Collection<java.lang.String> getConstantNames()
getConstantNames in class RubyModule
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||