public class RubyClass extends RubyModule
RubyModule.CacheEntryFactory, RubyModule.ConstantEntry, RubyModule.JavaClassKindOf, RubyModule.KindOf, RubyModule.MethodClumper, RubyModule.ModuleKernelMethods, RubyModule.ProfilingCacheEntryFactory, RubyModule.RespondToMissingMethod, RubyModule.SynchronizedCacheEntryFactory, RubyModule.WrapperCacheEntryFactory
RubyObject.Data
RubyBasicObject.Finalizer
Modifier and Type | Field and Description |
---|---|
static ObjectAllocator |
CLASS_ALLOCATOR |
static int |
CS_IDX_INITIALIZE |
static String[] |
CS_NAMES |
protected static ObjectMarshal |
DEFAULT_OBJECT_MARSHAL |
protected ObjectMarshal |
marshal |
protected Ruby |
runtime |
baseName, cachedMethods, ERR_FROZEN_CONST_TYPE, ERR_FROZEN_CVAR_TYPE, ERR_INSECURE_SET_CLASS_VAR, ERR_INSECURE_SET_CONSTANT, generation, generationObject, id, includingHierarchies, index, kindOf, methodInvalidator, MODULE_ALLOCATOR, NormalCacheEntryFactory, parent, SCOPE_CAPTURING_METHODS, superClass
FIELD_ALLOCATED_CLASSES, FIELD_ALLOCATORS, IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, OBJECT_VAR0_ALLOCATOR, OBJECT_VAR1_ALLOCATOR, OBJECT_VAR2_ALLOCATOR, OBJECT_VAR3_ALLOCATOR, OBJECT_VAR4_ALLOCATOR, OBJECT_VAR5_ALLOCATOR, OBJECT_VAR6_ALLOCATOR, OBJECT_VAR7_ALLOCATOR, OBJECT_VAR8_ALLOCATOR, OBJECT_VAR9_ALLOCATOR, REIFYING_OBJECT_ALLOCATOR
ALL_F, BASICOBJECT_ALLOCATOR, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, NEVER, NIL_F, STAMP_OFFSET, TAINTED_F, UNDEF, UNTRUSTED_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F, VAR_TABLE_OFFSET, varTable, varTableStamp
NULL_ARRAY
Modifier | Constructor and Description |
---|---|
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.
|
Modifier and Type | Method and Description |
---|---|
void |
addClassAnnotation(Class annotation,
Map fields) |
void |
addFieldAnnotation(String fieldName,
Class annotation,
Map fields) |
void |
addFieldSignature(String fieldName,
Class type) |
void |
addInvalidatorsAndFlush(List<Invalidator> invalidators) |
void |
addMethodAnnotation(String methodName,
Class annotation,
Map fields) |
void |
addMethodSignature(String methodName,
Class[] types) |
void |
addParameterAnnotation(String method,
int i,
Class annoClass,
Map<String,Object> value) |
void |
addSubclass(RubyClass subclass)
Add a new subclass to the weak set of subclasses.
|
IRubyObject |
allocate() |
void |
becomeSynchronized() |
static void |
checkInheritable(IRubyObject superClass)
rb_check_inheritable
|
static RubyClass |
createBootstrapClass(Ruby runtime,
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,
String name) |
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
String name,
Block block) |
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
String name,
IRubyObject arg) |
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
String name,
IRubyObject[] args) |
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
String name,
IRubyObject[] args,
Block block) |
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
String name,
IRubyObject arg,
Block block) |
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
String name,
IRubyObject arg0,
IRubyObject arg1) |
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
String name,
IRubyObject arg0,
IRubyObject arg1,
Block block) |
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
String name,
IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2) |
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
String name,
IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
Block block) |
IRubyObject |
finvokeChecked(ThreadContext context,
IRubyObject self,
String name) |
ObjectAllocator |
getAllocator() |
CallSite |
getBaseCallSite(int idx) |
CallSite[] |
getBaseCallSites() |
Map<Class,Map<String,Object>> |
getClassAnnotations() |
Ruby |
getClassRuntime() |
CallSite[] |
getExtraCallSites() |
VariableAccessorField |
getFFIHandleAccessorField() |
VariableAccessor |
getFFIHandleAccessorForRead() |
VariableAccessor |
getFFIHandleAccessorForWrite() |
Map<String,Map<Class,Map<String,Object>>> |
getFieldAnnotations() |
Map<String,Class> |
getFieldSignatures() |
ObjectMarshal |
getMarshal() |
Map<String,Map<Class,Map<String,Object>>> |
getMethodAnnotations() |
Map<String,Class[]> |
getMethodSignatures() |
VariableAccessorField |
getNativeHandleAccessorField() |
VariableAccessor |
getNativeHandleAccessorForWrite() |
int |
getNativeTypeIndex()
This is overridden in the other concrete Java builtins to provide a fast way
to determine what type they are.
|
VariableAccessorField |
getObjectGroupAccessorField() |
VariableAccessor |
getObjectGroupAccessorForRead() |
VariableAccessor |
getObjectGroupAccessorForWrite() |
VariableAccessorField |
getObjectIdAccessorField() |
Map<String,List<Map<Class,Map<String,Object>>>> |
getParameterAnnotations() |
RubyClass |
getRealClass() |
Class |
getReifiedClass() |
VariableAccessor |
getVariableAccessorForRead(String name) |
VariableAccessor |
getVariableAccessorForWrite(String name) |
Map<String,VariableAccessor> |
getVariableAccessorsForRead() |
String[] |
getVariableNames()
Get an array of all the known instance variable names.
|
Map<String,VariableAccessor> |
getVariableTableCopy() |
VariableTableManager |
getVariableTableManager() |
int |
getVariableTableSize() |
int |
getVariableTableSizeWithExtras() |
boolean |
hasObjectID() |
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) |
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,
String name,
IRubyObject[] args,
CallType callType,
Block block)
Deprecated.
|
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
String name,
CallType callType) |
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
String name,
CallType callType,
Block block) |
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
String name,
IRubyObject[] args,
CallType callType) |
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
String name,
IRubyObject[] args,
CallType callType,
Block block) |
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
String name,
IRubyObject arg,
CallType callType) |
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
String name,
IRubyObject arg,
CallType callType,
Block block) |
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
String name,
IRubyObject arg0,
IRubyObject arg1,
CallType callType) |
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
String name,
IRubyObject arg0,
IRubyObject arg1,
CallType callType,
Block block) |
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
String name,
IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
CallType callType) |
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
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 |
isReifiable()
Whether this class can be reified into a Java class.
|
boolean |
isSingleton() |
RubyClass |
makeMetaClass(RubyClass superClass)
rb_make_metaclass
|
void |
marshal(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,
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,
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,
Block block)
rb_class_new_instance
|
IRubyObject |
newInstance(ThreadContext context,
IRubyObject[] args,
Block block) |
IRubyObject |
newInstance(ThreadContext context,
IRubyObject arg0,
Block block) |
IRubyObject |
newInstance(ThreadContext context,
IRubyObject arg0,
IRubyObject arg1,
Block block) |
IRubyObject |
newInstance(ThreadContext context,
IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
Block block) |
boolean |
notVisibleAndNotMethodMissing(DynamicMethod method,
String name,
IRubyObject caller,
CallType callType) |
void |
reify() |
void |
reify(boolean useChildLoader) |
void |
reify(String classDumpDir) |
void |
reify(String classDumpDir,
boolean useChildLoader)
Stand up a real Java class for the backing store of this object
|
void |
reifyWithAncestors() |
void |
reifyWithAncestors(boolean useChildLoader) |
void |
reifyWithAncestors(String classDumpDir) |
void |
reifyWithAncestors(String classDumpDir,
boolean useChildLoader)
Reify this class, first reifying all its ancestors.
|
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(Class cls)
Set a reflective allocator that calls a no-arg constructor on the given
class.
|
void |
setMarshal(ObjectMarshal marshal) |
protected void |
setModuleSuperClass(RubyClass superClass) |
void |
setReifiedClass(Class newReifiedClass) |
void |
setRubyClassAllocator(Class cls)
Set a reflective allocator that calls the "standard" Ruby object
constructor (Ruby, RubyClass) on the given class.
|
void |
setRubyStaticAllocator(Class cls)
Set a reflective allocator that calls the "standard" Ruby object
constructor (Ruby, RubyClass) on the given class via a static
__allocate__ method intermediate.
|
void |
smartDump(MarshalStream stream,
IRubyObject target)
Marshal the given object to the marshaling stream, being "smart" and
caching how to do that marshaling.
|
IRubyObject |
smartLoadNewUser(IRubyObject target,
IRubyObject data)
Load marshaled data into a blank target object using marshal_load, being
"smart" and caching the mechanism for invoking marshal_load.
|
IRubyObject |
smartLoadOldUser(IRubyObject data)
Load marshaled data into a blank target object using _load, being
"smart" and caching the mechanism for invoking _load.
|
Collection<RubyClass> |
subclasses(boolean includeDescendants) |
IRubyObject |
superclass(ThreadContext context)
Return the real super class of this class.
|
Object |
toJava(Class klass)
Convert the object to the specified Java class, if possible.
|
Object |
unmarshal(UnmarshalStream unmarshalStream) |
static RubyClass |
unmarshalFrom(UnmarshalStream input) |
addClassProvider, addIncludingHierarchy, addMethod, addMethodAtBootTimeOnly, addMethodInternal, addModuleFunction, addReadAttribute, addReadWriteAttribute, addWriteAttribute, alias_method, ancestors, ancestors, append_features, attr_accessor, attr_accessor, attr_reader, attr_reader, attr_writer, attr, attr19, checkMethodBound, checkValidBindTargetFrom, class_variable_defined_p, class_variable_get, class_variable_get19, class_variable_set, class_variable_set19, class_variables, class_variables19, cloneMethods, const_defined_p, const_defined_p19, const_get_1_9, const_get_2_0, const_get, const_missing, const_set, constantEntryFetch, constants, constants19, constants19, constantsCommon, constantsCommon, constantsCommon19, constantTableContains, constantTableFetch, constantTableRemove, constantTableStore, createModuleClass, define_method, define_method, define_method, defineAlias, defineAliases, defineAnnotatedConstant, defineAnnotatedConstants, defineAnnotatedMethod, defineAnnotatedMethod, defineAnnotatedMethod, defineAnnotatedMethod, defineAnnotatedMethods, defineAnnotatedMethodsIndividually, defineAutoload, defineClassUnder, defineConstant, defineFastMethod, defineFastMethod, defineFastModuleFunction, defineFastPrivateMethod, defineFastProtectedMethod, defineFastPublicModuleFunction, defineMethod, defineModuleFunction, defineModuleUnder, defineOrGetClassUnder, defineOrGetModuleUnder, definePrivateMethod, definePublicModuleFunction, deleteClassVariable, deleteConstant, discoverInstanceVariables, ensureClassVariablesSettable, ensureConstantsSettable, equals, executeUnder, exportMethod, extend_object, extended, fastFetchClassVariable, fastFetchConstant, fastGetClass, fastGetClassVar, fastGetConstant, fastGetConstant, fastGetConstantAt, fastGetConstantFrom, fastGetConstantFromConstMissing, fastGetConstantFromNoConstMissing, fastHasClassVariable, fastHasConstant, fastIsClassVarDefined, fastIsConstantDefined, fastIsConstantDefined19, fastIsConstantDefined19, fastSetClassVar, fastSetConstant, fastStoreClassVariable, fastStoreConstant, fetchClassVariable, fetchConstant, fetchConstant, findImplementer, finishAutoload, freeze, getAncestorList, getAutoloadConstant, getAutoloadFile, getBaseName, getCacheProxy, getCacheToken, getClass, getClassVar, getClassVariableNameList, getClassVariables, getClassVariablesForRead, getConstant, getConstant, getConstant, getConstantAt, getConstantAt, getConstantAtSpecial, getConstantFrom, getConstantFromConstMissing, getConstantFromNoConstMissing, getConstantFromNoConstMissing, getConstantMap, getConstantMapForWrite, getConstantNames, getConstantNames, getConstantNoConstMissing, getConstantNoConstMissing, getConstantNoConstMissing, getGeneration, getGenerationObject, getInvalidator, getJavaProxy, getMethods, getMethodsForWrite, getName, getNonIncludedClass, getParent, getSimpleName, getStoredConstantList, getStoredConstantNameList, getSuperClass, hasClassVariable, hasConstant, hash, hashCode, hasInternalModuleVariable, hasModuleInHierarchy, include_p, include, included_modules, included, includeModule, initialize, instance_method, instance_methods, instance_methods19, invalidateCacheDescendantsInner, invalidateConstantCache, invalidateCoreClasses, isClassVarDefined, isConstantDefined, isIncluded, isInstance, isKindOfModule, isMethodBound, isMethodBound, isMethodBuiltin, isSame, isSynchronized, marshalTo, method_added, method_defined_p, method_removed, method_undefined, mix, mix, module_eval, module_eval, module_eval, module_eval, module_eval, module_exec, module_exec, module_function, name, name19, needsImplementer, nesting, newIncludeClass, newMethod, newMethod, newMethod, newModule, newModule, op_cmp, op_eqq, op_equal, op_ge, op_gt, op_le, op_lt, populateInstanceMethodNames, private_class_method, private_constant, private_constant, private_instance_methods, private_instance_methods19, private_method_defined, protected_instance_methods, protected_instance_methods19, protected_method_defined, public_class_method, public_constant, public_constant, public_instance_methods, public_instance_methods19, public_method_defined, rbPrivate, rbProtected, rbPublic, remove_class_variable, remove_class_variable19, remove_const, remove_method, removeClassProvider, removeClassVariable, removeCvar, removeMethod, resolveUndefConstant, retrieveMethod, searchInternalModuleVariable, searchMethod, searchMethodInner, searchWithCache, setBaseName, setCacheProxy, setClassVar, setConstant, setConstantQuiet, setInternalModuleVariable, setJavaProxy, setMethodVisibility, setParent, setSuperClass, storeClassVariable, storeConstant, syncClassVariables, syncConstants, to_s, undef_method, undef, undefineMethod, updateGeneration, validateClassVariable, validateConstant, visitInterpretedMethods
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, eqlInternal, equalInternal, initialize, initialize, inspect, puts, specificEval, toString
addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkFrozen, checkStringType, checkStringType19, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, display, dup, ensureInstanceVariablesSettable, eql_p, eql, equal_p, equal_p19, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, frozen_p, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getJavaClass, getMetaClass, getNativeHandle, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hashyInspect, hasInstanceVariable, hasInternalVariable, hasVariables, id_deprecated, id, infectBy, initialize19, inspect, inspectHashCode, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval19, instance_eval19, instance_eval19, instance_eval19, instance_exec, instance_exec19, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, instance_variables19, isBuiltin, isFalse, isFrozen, isImmediate, isNil, isTaint, isTrue, isUntrusted, kind_of_p, method_missing19, method, method19, methods, methods, methods19, nil_p, op_cmp, op_equal_19, op_match, op_match19, op_not_equal, op_not_match, op_not, private_methods, private_methods19, protected_methods, protected_methods19, public_methods, public_methods19, rbClone, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respond_to_p19, respond_to_p19, respondsTo, respondsToMissing, respondsToMissing, send, send, send, send, send, send19, send19, send19, send19, setFFIHandle, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setNativeHandle, setTaint, setUntrusted, setVariable, singleton_method_added19, singleton_method_removed19, singleton_method_undefined19, singleton_methods, singleton_methods19, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted_p, testFrozen, testFrozen, to_a, trust, type_deprecated, type, untaint, untrust, untrusted_p, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnder
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 String[] CS_NAMES
protected RubyClass(Ruby runtime, RubyClass superClass, boolean objectSpace)
protected RubyClass(Ruby runtime)
protected RubyClass(Ruby runtime, RubyClass superClazz)
public ObjectAllocator getAllocator()
public void setAllocator(ObjectAllocator allocator)
public void setClassAllocator(Class cls)
cls
- The class on which to call the default constructor to allocatepublic void setRubyClassAllocator(Class cls)
cls
- The class from which to grab a standard Ruby constructorpublic void setRubyStaticAllocator(Class cls)
cls
- The class from which to grab a standard Ruby __allocate__
method.public IRubyObject allocate()
public CallSite getBaseCallSite(int idx)
public CallSite[] getBaseCallSites()
public CallSite[] getExtraCallSites()
public VariableTableManager getVariableTableManager()
public boolean hasObjectID()
public Map<String,VariableAccessor> getVariableAccessorsForRead()
public VariableAccessor getVariableAccessorForWrite(String name)
public VariableAccessor getVariableAccessorForRead(String name)
public VariableAccessorField getObjectIdAccessorField()
public VariableAccessorField getNativeHandleAccessorField()
public VariableAccessor getNativeHandleAccessorForWrite()
public VariableAccessorField getFFIHandleAccessorField()
public VariableAccessor getFFIHandleAccessorForRead()
public VariableAccessor getFFIHandleAccessorForWrite()
public VariableAccessorField getObjectGroupAccessorField()
public VariableAccessor getObjectGroupAccessorForRead()
public VariableAccessor getObjectGroupAccessorForWrite()
public int getVariableTableSize()
public int getVariableTableSizeWithExtras()
public String[] getVariableNames()
public Map<String,VariableAccessor> getVariableTableCopy()
public int getNativeTypeIndex()
RubyObject
getNativeTypeIndex
in interface CoreObjectType
getNativeTypeIndex
in class RubyModule
ClassIndex
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, String name, RubyClass superClass, ObjectAllocator allocator)
runtime
- we need itpublic 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, String name, ObjectAllocator allocator, RubyModule parent, boolean setParent)
public static RubyClass newClass(Ruby runtime, RubyClass superClass, 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, String name, IRubyObject[] args, CallType callType, Block block)
public boolean notVisibleAndNotMethodMissing(DynamicMethod method, String name, IRubyObject caller, CallType callType)
public IRubyObject invoke(ThreadContext context, IRubyObject self, String name, CallType callType, Block block)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, String name, Block block)
public IRubyObject invoke(ThreadContext context, IRubyObject self, String name, IRubyObject[] args, CallType callType, Block block)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, String name, IRubyObject[] args, Block block)
public IRubyObject invoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg, CallType callType, Block block)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg, Block block)
public IRubyObject invoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, CallType callType, Block block)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, Block block)
public IRubyObject invoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, CallType callType, Block block)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
public IRubyObject invoke(ThreadContext context, IRubyObject self, String name, CallType callType)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, String name)
public IRubyObject finvokeChecked(ThreadContext context, IRubyObject self, String name)
public IRubyObject invoke(ThreadContext context, IRubyObject self, String name, IRubyObject[] args, CallType callType)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, String name, IRubyObject[] args)
public IRubyObject invoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg, CallType callType)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg)
public IRubyObject invoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, CallType callType)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1)
public IRubyObject invoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, CallType callType)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)
public IRubyObject invokeInherited(ThreadContext context, IRubyObject self, IRubyObject subclass)
public IRubyObject newInstance(ThreadContext context, Block block)
public IRubyObject newInstance(ThreadContext context, IRubyObject arg0, Block block)
public IRubyObject newInstance(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block)
public IRubyObject newInstance(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
public IRubyObject newInstance(ThreadContext context, IRubyObject[] args, Block block)
public IRubyObject initialize(ThreadContext context, Block block)
initialize
in class RubyModule
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 Collection<RubyClass> 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 withpublic void becomeSynchronized()
becomeSynchronized
in class RubyModule
public void invalidateCacheDescendants()
invalidateCacheDescendants
in class RubyModule
public void addInvalidatorsAndFlush(List<Invalidator> invalidators)
public Ruby getClassRuntime()
public final RubyClass getRealClass()
public IRubyObject inherited(ThreadContext context, IRubyObject arg)
public void inherit(RubyClass superClazz)
public IRubyObject superclass(ThreadContext context)
public static void checkInheritable(IRubyObject superClass)
public final ObjectMarshal getMarshal()
public final void setMarshal(ObjectMarshal marshal)
public final void marshal(Object obj, MarshalStream marshalStream) throws IOException
IOException
public final Object unmarshal(UnmarshalStream unmarshalStream) throws IOException
IOException
public static void marshalTo(RubyClass clazz, MarshalStream output) throws IOException
IOException
public static RubyClass unmarshalFrom(UnmarshalStream input) throws IOException
IOException
public boolean isReifiable()
public void reifyWithAncestors()
public void reifyWithAncestors(String classDumpDir)
public void reifyWithAncestors(boolean useChildLoader)
public void reifyWithAncestors(String classDumpDir, boolean useChildLoader)
classDumpDir
- the path in which to dump reified class bytesuseChildLoader
- whether to load the class into its own child classloaderpublic void reify()
public void reify(String classDumpDir)
public void reify(boolean useChildLoader)
public void reify(String classDumpDir, boolean useChildLoader)
classDumpDir
- Directory to save reified java classpublic void setReifiedClass(Class newReifiedClass)
public Class getReifiedClass()
public Map<String,List<Map<Class,Map<String,Object>>>> getParameterAnnotations()
public void addParameterAnnotation(String method, int i, Class annoClass, Map<String,Object> value)
public void addMethodAnnotation(String methodName, Class annotation, Map fields)
public Object toJava(Class klass)
IRubyObject
toJava
in interface IRubyObject
toJava
in class RubyBasicObject
klass
- The target type to which the object should be converted.IRubyObject.toJava(java.lang.Class)
public void smartDump(MarshalStream stream, IRubyObject target) throws IOException
stream
- The stream to which to marshal the datatarget
- The object whose data should be marshaledIOException
- If there is an IO exception while writing to the
stream.public IRubyObject smartLoadNewUser(IRubyObject target, IRubyObject data)
target
- The blank target object into which marshal_load will
deserialize the given datadata
- The marshaled datapublic IRubyObject smartLoadOldUser(IRubyObject data)
data
- The marshaled data, to be reconstituted into an object by
_loadCopyright © 2001-2014 JRuby. All Rights Reserved.