|
||||||||||
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
public class RubyClass
Nested Class Summary | |
---|---|
static class |
RubyClass.SpecificArityNew
|
static class |
RubyClass.VariableAccessor
|
Nested classes/interfaces inherited from class org.jruby.RubyModule |
---|
RubyModule.Generation, RubyModule.KindOf, RubyModule.MethodClumper, RubyModule.ModuleKernelMethods |
Nested classes/interfaces inherited from class org.jruby.RubyObject |
---|
RubyObject.ObjectMethods |
Nested classes/interfaces inherited from class org.jruby.RubyBasicObject |
---|
RubyBasicObject.BasicObjectMethods, RubyBasicObject.Finalizer |
Field Summary | |
---|---|
static ObjectAllocator |
CLASS_ALLOCATOR
|
static int |
CS_IDX_INITIALIZE
|
static java.lang.String[] |
CS_NAMES
|
protected static ObjectMarshal |
DEFAULT_OBJECT_MARSHAL
|
protected ObjectMarshal |
marshal
|
protected Ruby |
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, parent, SCOPE_CAPTURING_METHODS, superClass |
Fields inherited from class org.jruby.RubyObject |
---|
OBJECT_ALLOCATOR |
Fields inherited from class org.jruby.RubyBasicObject |
---|
ALL_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 |
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject |
---|
NULL_ARRAY |
Constructor Summary | |
---|---|
protected |
RubyClass(Ruby runtime)
used by CLASS_ALLOCATOR (any Class' class will be a Class!) also used to bootstrap Object class |
protected |
RubyClass(Ruby runtime,
RubyClass superClazz)
rb_class_boot (for plain Classes) also used to bootstrap Module and Class classes |
protected |
RubyClass(Ruby runtime,
RubyClass superClass,
boolean objectSpace)
separate path for MetaClass and IncludedModuleWrapper construction (rb_class_boot version for MetaClasses) no marshal, allocator initialization and addSubclass(this) here! |
protected |
RubyClass(Ruby runtime,
RubyClass superClazz,
CallSite[] extraCallSites)
A constructor which allows passing in an array of supplementary call sites. |
protected |
RubyClass(Ruby runtime,
RubyClass superClass,
RubyModule.Generation generation,
boolean objectSpace)
separate path for MetaClass and IncludedModuleWrapper construction (rb_class_boot version for MetaClasses) no marshal, allocator initialization and addSubclass(this) here! |
Method Summary | |
---|---|
void |
addSubclass(RubyClass subclass)
Add a new subclass to the weak set of subclasses. |
IRubyObject |
allocate()
|
static void |
checkInheritable(IRubyObject superClass)
rb_check_inheritable |
static RubyClass |
createBootstrapClass(Ruby runtime,
java.lang.String name,
RubyClass superClass,
ObjectAllocator allocator)
boot_defclass Create an initial Object meta class before Module and Kernel dependencies have squirreled themselves together. |
static void |
createClassClass(Ruby runtime,
RubyClass classClass)
|
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
java.lang.String name)
|
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
Block block)
|
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg)
|
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject[] args)
|
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject[] args,
Block block)
|
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg,
Block block)
|
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg0,
IRubyObject arg1)
|
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg0,
IRubyObject arg1,
Block block)
|
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2)
|
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
Block block)
|
ObjectAllocator |
getAllocator()
|
CallSite[] |
getBaseCallSites()
|
Ruby |
getClassRuntime()
|
CallSite[] |
getExtraCallSites()
|
ObjectMarshal |
getMarshal()
|
int |
getNativeTypeIndex()
This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are. |
RubyClass |
getRealClass()
|
RubyClass.VariableAccessor |
getVariableAccessorForRead(java.lang.String name)
|
RubyClass.VariableAccessor |
getVariableAccessorForWrite(java.lang.String name)
|
java.util.Map<java.lang.String,RubyClass.VariableAccessor> |
getVariableAccessorsForRead()
|
java.util.Map<java.lang.String,RubyClass.VariableAccessor> |
getVariableAccessorsForWrite()
|
java.util.Map<java.lang.String,RubyClass.VariableAccessor> |
getVariableTableCopy()
|
int |
getVariableTableSize()
|
void |
inherit(RubyClass superClazz)
rb_class_inherited (reversed semantics!) |
IRubyObject |
inherited(ThreadContext context,
IRubyObject arg)
|
IRubyObject |
initialize_copy(IRubyObject original)
rb_class_init_copy |
IRubyObject |
initialize(ThreadContext context,
Block block)
rb_class_initialize |
IRubyObject |
initialize(ThreadContext context,
IRubyObject superObject,
Block block)
|
IRubyObject |
initialize19(ThreadContext context,
Block block)
|
IRubyObject |
initialize19(ThreadContext context,
IRubyObject superObject,
Block block)
|
protected void |
invalidateCacheDescendants()
Invalidate all subclasses of this class by walking the set of all subclasses and asking them to invalidate themselves. |
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
int methodIndex,
java.lang.String name,
IRubyObject[] args,
CallType callType,
Block block)
Deprecated. |
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
CallType callType)
|
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
CallType callType,
Block block)
|
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject[] args,
CallType callType)
|
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject[] args,
CallType callType,
Block block)
|
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg,
CallType callType)
|
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg,
CallType callType,
Block block)
|
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg0,
IRubyObject arg1,
CallType callType)
|
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg0,
IRubyObject arg1,
CallType callType,
Block block)
|
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
CallType callType)
|
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
CallType callType,
Block block)
|
IRubyObject |
invokeInherited(ThreadContext context,
IRubyObject self,
IRubyObject subclass)
|
boolean |
isClass()
Specifically polymorphic method that are meant to be overridden by classes to specify that they are classes in an easy way. |
boolean |
isModule()
Specifically polymorphic method that are meant to be overridden by modules to specify that they are modules in an easy way. |
boolean |
isSingleton()
|
RubyClass |
makeMetaClass(RubyClass superClass)
rb_make_metaclass |
void |
marshal(java.lang.Object obj,
MarshalStream marshalStream)
|
static void |
marshalTo(RubyClass clazz,
MarshalStream output)
|
static RubyClass |
newClass(Ruby runtime,
RubyClass superClass)
Construct a new class with the given name scoped under Object (global) and with Object as its immediate superclass. |
static RubyClass |
newClass(Ruby runtime,
RubyClass superClass,
CallSite[] extraCallSites)
A variation on newClass that allow passing in an array of supplementary call sites to improve dynamic invocation. |
static RubyClass |
newClass(Ruby runtime,
RubyClass superClass,
java.lang.String name,
ObjectAllocator allocator,
RubyModule parent,
boolean setParent)
Construct a new class with the given name, allocator, parent class, and containing class. |
static RubyClass |
newClass(Ruby runtime,
RubyClass superClass,
java.lang.String name,
ObjectAllocator allocator,
RubyModule parent,
boolean setParent,
CallSite[] extraCallSites)
A variation on newClass that allows passing in an array of supplementary call sites to improve dynamic invocation performance. |
IRubyObject |
newInstance(ThreadContext context,
IRubyObject[] args,
Block block)
rb_class_new_instance |
boolean |
notVisibleAndNotMethodMissing(DynamicMethod method,
java.lang.String name,
IRubyObject caller,
CallType callType)
|
void |
removeSubclass(RubyClass subclass)
Remove a subclass from the weak set of subclasses. |
void |
replaceSubclass(RubyClass subclass,
RubyClass newSubclass)
Replace an existing subclass with a new one. |
void |
setAllocator(ObjectAllocator allocator)
|
void |
setClassAllocator(java.lang.Class cls)
Set an allocator that calls the default constructor for a given class. |
void |
setMarshal(ObjectMarshal marshal)
|
protected void |
setModuleSuperClass(RubyClass superClass)
|
java.util.Collection |
subclasses(boolean includeDescendants)
|
IRubyObject |
superclass(ThreadContext context)
Return the real super class of this class. |
IRubyObject |
superclass19(ThreadContext context)
|
java.lang.Object |
unmarshal(UnmarshalStream unmarshalStream)
|
static RubyClass |
unmarshalFrom(UnmarshalStream input)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final ObjectAllocator CLASS_ALLOCATOR
protected static final ObjectMarshal DEFAULT_OBJECT_MARSHAL
protected final Ruby runtime
protected ObjectMarshal marshal
public static final int CS_IDX_INITIALIZE
public static final java.lang.String[] CS_NAMES
Constructor Detail |
---|
protected RubyClass(Ruby runtime, RubyClass superClass, boolean objectSpace)
protected RubyClass(Ruby runtime, RubyClass superClass, RubyModule.Generation generation, boolean objectSpace)
protected RubyClass(Ruby runtime)
protected RubyClass(Ruby runtime, RubyClass superClazz)
protected RubyClass(Ruby runtime, RubyClass superClazz, CallSite[] extraCallSites)
Method Detail |
---|
public static void createClassClass(Ruby runtime, RubyClass classClass)
public ObjectAllocator getAllocator()
public void setAllocator(ObjectAllocator allocator)
public void setClassAllocator(java.lang.Class cls)
cls
- The class on which to call the default constructor to allocatepublic IRubyObject allocate()
public CallSite[] getBaseCallSites()
public CallSite[] getExtraCallSites()
public java.util.Map<java.lang.String,RubyClass.VariableAccessor> getVariableAccessorsForRead()
public java.util.Map<java.lang.String,RubyClass.VariableAccessor> getVariableAccessorsForWrite()
public RubyClass.VariableAccessor getVariableAccessorForWrite(java.lang.String name)
public RubyClass.VariableAccessor getVariableAccessorForRead(java.lang.String name)
public int getVariableTableSize()
public java.util.Map<java.lang.String,RubyClass.VariableAccessor> getVariableTableCopy()
public int getNativeTypeIndex()
RubyObject
getNativeTypeIndex
in interface CoreObjectType
getNativeTypeIndex
in class RubyModule
org.jruby.runtime.ClassInde
public boolean isModule()
RubyBasicObject
isModule
in interface IRubyObject
isModule
in class RubyModule
(someObject instanceof RubyModule)
instead.public boolean isClass()
RubyBasicObject
isClass
in interface IRubyObject
isClass
in class RubyModule
(someObject instanceof RubyClass/MetaClass)
instead.public boolean isSingleton()
isSingleton
in class RubyModule
public static RubyClass createBootstrapClass(Ruby runtime, java.lang.String name, RubyClass superClass, ObjectAllocator allocator)
runtime
- we need it
public static RubyClass newClass(Ruby runtime, RubyClass superClass)
public static RubyClass newClass(Ruby runtime, RubyClass superClass, CallSite[] extraCallSites)
public static RubyClass newClass(Ruby runtime, RubyClass superClass, java.lang.String name, ObjectAllocator allocator, RubyModule parent, boolean setParent)
public static RubyClass newClass(Ruby runtime, RubyClass superClass, java.lang.String name, ObjectAllocator allocator, RubyModule parent, boolean setParent, CallSite[] extraCallSites)
public RubyClass makeMetaClass(RubyClass superClass)
makeMetaClass
in class RubyBasicObject
@Deprecated public IRubyObject invoke(ThreadContext context, IRubyObject self, int methodIndex, java.lang.String name, IRubyObject[] args, CallType callType, Block block)
public boolean notVisibleAndNotMethodMissing(DynamicMethod method, java.lang.String name, IRubyObject caller, CallType callType)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, CallType callType, Block block)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, Block block)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject[] args, CallType callType, Block block)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject[] args, Block block)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg, CallType callType, Block block)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg, Block block)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, CallType callType, Block block)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, Block block)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, CallType callType, Block block)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, CallType callType)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject[] args, CallType callType)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject[] args)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg, CallType callType)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, CallType callType)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, CallType callType)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)
public IRubyObject invokeInherited(ThreadContext context, IRubyObject self, IRubyObject subclass)
public IRubyObject newInstance(ThreadContext context, IRubyObject[] args, Block block)
public IRubyObject initialize(ThreadContext context, Block block)
public IRubyObject initialize(ThreadContext context, IRubyObject superObject, Block block)
public IRubyObject initialize19(ThreadContext context, Block block)
public IRubyObject initialize19(ThreadContext context, IRubyObject superObject, Block block)
public IRubyObject initialize_copy(IRubyObject original)
initialize_copy
in class RubyModule
protected void setModuleSuperClass(RubyClass superClass)
public java.util.Collection subclasses(boolean includeDescendants)
public void addSubclass(RubyClass subclass)
subclass
- The subclass to addpublic void removeSubclass(RubyClass subclass)
subclass
- The subclass to removepublic void replaceSubclass(RubyClass subclass, RubyClass newSubclass)
subclass
- The subclass to removenewSubclass
- The subclass to replace it withprotected void invalidateCacheDescendants()
invalidateCacheDescendants
in class RubyModule
public Ruby getClassRuntime()
public RubyClass getRealClass()
public IRubyObject inherited(ThreadContext context, IRubyObject arg)
public void inherit(RubyClass superClazz)
public IRubyObject superclass(ThreadContext context)
public IRubyObject superclass19(ThreadContext context)
public static void checkInheritable(IRubyObject superClass)
public final ObjectMarshal getMarshal()
public final void setMarshal(ObjectMarshal marshal)
public final void marshal(java.lang.Object obj, MarshalStream marshalStream) throws java.io.IOException
java.io.IOException
public final java.lang.Object unmarshal(UnmarshalStream unmarshalStream) throws java.io.IOException
java.io.IOException
public static void marshalTo(RubyClass clazz, MarshalStream output) throws java.io.IOException
java.io.IOException
public static RubyClass unmarshalFrom(UnmarshalStream input) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |