|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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.RubyModule |
|---|
RubyModule.ConstantTableEntry, RubyModule.KindOf, RubyModule.MethodClumper, RubyModule.ModuleKernelMethods |
| Nested classes/interfaces inherited from class org.jruby.RubyObject |
|---|
RubyObject.Finalizer, RubyObject.ObjectMethods, RubyObject.VariableTableEntry |
| Field Summary |
|---|
| Fields inherited from class org.jruby.RubyClass |
|---|
CLASS_ALLOCATOR, DEFAULT_OBJECT_MARSHAL, marshal |
| Fields inherited from class org.jruby.RubyObject |
|---|
ALL_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, NEVER, NIL_F, OBJECT_ALLOCATOR, TAINTED_F, UNDEF, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, VARIABLE_TABLE_DEFAULT_CAPACITY, VARIABLE_TABLE_EMPTY_TABLE, VARIABLE_TABLE_LOAD_FACTOR, VARIABLE_TABLE_MAXIMUM_CAPACITY, variableTable, variableTableSize, variableTableThreshold |
| 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 java.util.Map |
constantTableGetMap()
Deprecated. |
protected java.util.Map |
constantTableGetMap(java.util.Map map)
Deprecated. |
protected int |
constantTableGetSize()
|
protected RubyModule.ConstantTableEntry[] |
constantTableGetTable()
|
protected IRubyObject |
constantTableRemove(java.lang.String name)
|
protected IRubyObject |
constantTableStore(java.lang.String name,
IRubyObject value)
|
protected void |
constantTableSync(java.util.List<Variable<IRubyObject>> vars)
|
java.util.Map<java.lang.String,DynamicMethod> |
getMethods()
|
java.lang.String |
getName()
Generate a fully-qualified class name or a #-style name for anonymous and singleton classes. |
RubyModule |
getNonIncludedClass()
|
RubyClass |
getRealClass()
|
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)
Overridden newIncludeClass implementation to allow attaching future includes to the correct module (i.e. |
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 IRubyObject |
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 IRubyObject |
variableTableFastStore(java.lang.String internedName,
IRubyObject value)
Will store the value under the specified name, where the name needs to be an interned Java String. |
protected IRubyObject |
variableTableFetch(java.lang.String name)
Fetch an object from the variable table based on the name. |
protected java.util.Map |
variableTableGetMap()
Deprecated. |
protected java.util.Map |
variableTableGetMap(java.util.Map map)
Deprecated. |
protected int |
variableTableGetSize()
Get the size of the variable table. |
protected RubyObject.VariableTableEntry[] |
variableTableGetTable()
Get the actual table used to save variable entries. |
protected IRubyObject |
variableTableReadLocked(RubyObject.VariableTableEntry entry)
Reads the value of the specified entry, locked on the current object. |
protected IRubyObject |
variableTableRemove(java.lang.String name)
Removes the entry with the specified name from the variable table, and returning the removed value. |
protected IRubyObject |
variableTableStore(java.lang.String name,
IRubyObject value)
Store a value in the variable store under the specific name. |
protected void |
variableTableSync(java.util.List<Variable<IRubyObject>> vars)
Synchronize the variable table with the argument. |
| Methods inherited from class org.jruby.RubyClass |
|---|
addSubclass, allocate, checkInheritable, createBootstrapClass, createClassClass, getAllocator, getClassRuntime, getMarshal, getNativeTypeIndex, inherit, inherited, initialize_copy, initialize, invoke, invoke, invoke, invokeInherited, isSingleton, makeMetaClass, marshal, marshalTo, newClass, newClass, newInstance, setAllocator, setMarshal, subclasses, subclasses, superclass, unmarshal, unmarshalFrom |
| 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 |
|---|
public IncludedModuleWrapper newIncludeClass(RubyClass superClass)
newIncludeClass in class RubyModuleRubyModule.newIncludeClass(RubyClass)public boolean isModule()
RubyObject
isModule in interface IRubyObjectisModule in class RubyClass(someObject instanceof RubyModule) instead.public boolean isClass()
RubyObject
isClass in interface IRubyObjectisClass in class RubyClass(someObject instanceof RubyClass/MetaClass) instead.public boolean isIncluded()
RubyModule
isIncluded in class RubyModulepublic boolean isImmediate()
RubyObject
isImmediate in interface IRubyObjectisImmediate in class RubyObjectpublic void setMetaClass(RubyClass newRubyClass)
RubyObject
setMetaClass in class RubyObjectpublic java.util.Map<java.lang.String,DynamicMethod> getMethods()
getMethods 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 RubyObjectprotected boolean variableTableContains(java.lang.String name)
RubyObject
variableTableContains in class RubyObjectprotected boolean variableTableFastContains(java.lang.String internedName)
RubyObject
variableTableFastContains in class RubyObjectprotected IRubyObject variableTableFetch(java.lang.String name)
RubyObject
variableTableFetch in class RubyObjectprotected IRubyObject variableTableFastFetch(java.lang.String internedName)
RubyObject
variableTableFastFetch in class RubyObject
protected IRubyObject variableTableStore(java.lang.String name,
IRubyObject value)
RubyObject
variableTableStore in class RubyModule
protected IRubyObject variableTableFastStore(java.lang.String internedName,
IRubyObject value)
RubyObject
variableTableFastStore in class RubyModuleprotected IRubyObject variableTableRemove(java.lang.String name)
RubyObject
variableTableRemove in class RubyModuleprotected RubyObject.VariableTableEntry[] variableTableGetTable()
RubyObject
variableTableGetTable in class RubyObjectprotected int variableTableGetSize()
RubyObject
variableTableGetSize in class RubyObjectprotected void variableTableSync(java.util.List<Variable<IRubyObject>> vars)
RubyObject
variableTableSync in class RubyModuleprotected IRubyObject variableTableReadLocked(RubyObject.VariableTableEntry entry)
RubyObject
variableTableReadLocked in class RubyModule@Deprecated protected java.util.Map variableTableGetMap()
variableTableGetMap in class RubyObject@Deprecated protected java.util.Map variableTableGetMap(java.util.Map map)
variableTableGetMap in class RubyObjectprotected 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 RubyModuleprotected RubyModule.ConstantTableEntry[] constantTableGetTable()
constantTableGetTable in class RubyModuleprotected int constantTableGetSize()
constantTableGetSize in class RubyModuleprotected void constantTableSync(java.util.List<Variable<IRubyObject>> vars)
constantTableSync in class RubyModule@Deprecated protected java.util.Map constantTableGetMap()
constantTableGetMap in class RubyModule@Deprecated protected java.util.Map constantTableGetMap(java.util.Map map)
constantTableGetMap in class RubyModule
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||