public class RubyClass extends RubyModule
Modifier and Type | Class and Description |
---|---|
static class |
RubyClass.CS_NAMES |
RubyModule.AutoloadMethod, 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 |
protected static ObjectMarshal |
DEFAULT_OBJECT_MARSHAL |
protected ObjectMarshal |
marshal |
protected Ruby |
runtime |
baseName, cachedMethods, CACHEPROXY_F, classIndex, generation, generationObject, id, includingHierarchies, index, IS_OVERLAID_F, kindOf, methodInvalidator, methodLocation, methods, MODULE_ALLOCATOR, NEEDSIMPL_F, NormalCacheEntryFactory, OMOD_SHARED, parent, REFINED_MODULE_F, SCOPE_CAPTURING_METHODS, superClass
IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_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, UNTRUST_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F, USER9_F, USERA_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(java.lang.Class annotation,
java.util.Map fields) |
void |
addFieldAnnotation(java.lang.String fieldName,
java.lang.Class annotation,
java.util.Map fields) |
void |
addFieldSignature(java.lang.String fieldName,
java.lang.Class type) |
void |
addInvalidatorsAndFlush(java.util.List<Invalidator> invalidators) |
void |
addMethodAnnotation(java.lang.String methodName,
java.lang.Class annotation,
java.util.Map fields) |
void |
addMethodSignature(java.lang.String methodName,
java.lang.Class[] types) |
void |
addParameterAnnotation(java.lang.String method,
int i,
java.lang.Class annoClass,
java.util.Map<java.lang.String,java.lang.Object> value) |
void |
addSubclass(RubyClass subclass)
Add a new subclass to the weak set of subclasses.
|
IRubyObject |
allocate() |
void |
becomeSynchronized() |
static boolean |
checkFuncallCallable(ThreadContext context,
DynamicMethod method,
CallType callType,
IRubyObject self) |
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) |
IRubyObject |
finvokeChecked(ThreadContext context,
IRubyObject self,
JavaSites.CheckedSites sites)
Safely attempt to invoke the given method name on self, using respond_to? and method_missing as appropriate.
|
IRubyObject |
finvokeChecked(ThreadContext context,
IRubyObject self,
JavaSites.CheckedSites sites,
IRubyObject... args)
Safely attempt to invoke the given method name on self, using respond_to? and method_missing as appropriate.
|
IRubyObject |
finvokeChecked(ThreadContext context,
IRubyObject self,
java.lang.String name)
Safely attempt to invoke the given method name on self, using respond_to? and method_missing as appropriate.
|
IRubyObject |
finvokeChecked(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject... args)
Safely attempt to invoke the given method name on self, using respond_to? and method_missing as appropriate.
|
ObjectAllocator |
getAllocator() |
CallSite |
getBaseCallSite(int idx) |
CallSite[] |
getBaseCallSites() |
java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>> |
getClassAnnotations() |
Ruby |
getClassRuntime() |
CallSite[] |
getExtraCallSites() |
VariableAccessorField |
getFFIHandleAccessorField()
Deprecated.
|
VariableAccessor |
getFFIHandleAccessorForRead() |
VariableAccessor |
getFFIHandleAccessorForWrite() |
java.util.Map<java.lang.String,java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>>> |
getFieldAnnotations() |
java.util.Map<java.lang.String,java.lang.Class> |
getFieldSignatures() |
ObjectMarshal |
getMarshal() |
java.util.Map<java.lang.String,java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>>> |
getMethodAnnotations() |
java.util.Map<java.lang.String,java.lang.Class[]> |
getMethodSignatures() |
ClassIndex |
getNativeClassIndex()
This is overridden in the other concrete Java builtins to provide a fast way
to determine what type they are.
|
VariableAccessorField |
getObjectGroupAccessorField()
Deprecated.
|
VariableAccessor |
getObjectGroupAccessorForRead() |
VariableAccessor |
getObjectGroupAccessorForWrite() |
VariableAccessorField |
getObjectIdAccessorField()
Deprecated.
|
java.util.Map<java.lang.String,java.util.List<java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>>>> |
getParameterAnnotations() |
RubyClass |
getRealClass() |
java.lang.Class<? extends IRubyObject> |
getReifiedClass() |
VariableAccessor |
getVariableAccessorForRead(java.lang.String name) |
VariableAccessor |
getVariableAccessorForWrite(java.lang.String name) |
java.util.Map<java.lang.String,VariableAccessor> |
getVariableAccessorsForRead() |
java.lang.String[] |
getVariableNames()
Get an array of all the known instance variable names.
|
java.util.Map<java.lang.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,
java.lang.String name,
IRubyObject[] args,
CallType callType,
Block block)
Deprecated.
|
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
CallType callType)
Deprecated.
Use finvoke if you do not want visibility-checking or invokeFrom if you do.
|
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
CallType callType,
Block block)
Deprecated.
Use finvoke if you do not want visibility-checking or invokeFrom if you do.
|
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject[] args,
CallType callType)
Deprecated.
Use finvoke if you do not want visibility-checking or invokeFrom if you do.
|
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject[] args,
CallType callType,
Block block)
Deprecated.
Use finvoke if you do not want visibility-checking or invokeFrom if you do.
|
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg,
CallType callType)
Deprecated.
Use finvoke if you do not want visibility-checking or invokeFrom if you do.
|
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg,
CallType callType,
Block block)
Deprecated.
Use finvoke if you do not want visibility-checking or invokeFrom if you do.
|
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg0,
IRubyObject arg1,
CallType callType)
Deprecated.
Use finvoke if you do not want visibility-checking or invokeFrom if you do.
|
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg0,
IRubyObject arg1,
CallType callType,
Block block)
Deprecated.
Use finvoke if you do not want visibility-checking or invokeFrom if you do.
|
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
CallType callType)
Deprecated.
Use finvoke if you do not want visibility-checking or invokeFrom if you do.
|
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
CallType callType,
Block block)
Deprecated.
Use finvoke if you do not want visibility-checking or invokeFrom if you do.
|
IRubyObject |
invokeFrom(ThreadContext context,
CallType callType,
IRubyObject caller,
IRubyObject self,
java.lang.String name)
Same behavior as finvoke, but uses the given caller object to check visibility if callType demands it.
|
IRubyObject |
invokeFrom(ThreadContext context,
CallType callType,
IRubyObject caller,
IRubyObject self,
java.lang.String name,
Block block)
Same behavior as finvoke, but uses the given caller object to check visibility if callType demands it.
|
IRubyObject |
invokeFrom(ThreadContext context,
CallType callType,
IRubyObject caller,
IRubyObject self,
java.lang.String name,
IRubyObject arg)
Same behavior as finvoke, but uses the given caller object to check visibility if callType demands it.
|
IRubyObject |
invokeFrom(ThreadContext context,
CallType callType,
IRubyObject caller,
IRubyObject self,
java.lang.String name,
IRubyObject[] args)
Same behavior as finvoke, but uses the given caller object to check visibility if callType demands it.
|
IRubyObject |
invokeFrom(ThreadContext context,
CallType callType,
IRubyObject caller,
IRubyObject self,
java.lang.String name,
IRubyObject[] args,
Block block)
Same behavior as finvoke, but uses the given caller object to check visibility if callType demands it.
|
IRubyObject |
invokeFrom(ThreadContext context,
CallType callType,
IRubyObject caller,
IRubyObject self,
java.lang.String name,
IRubyObject arg,
Block block)
Same behavior as finvoke, but uses the given caller object to check visibility if callType demands it.
|
IRubyObject |
invokeFrom(ThreadContext context,
CallType callType,
IRubyObject caller,
IRubyObject self,
java.lang.String name,
IRubyObject arg0,
IRubyObject arg1)
Same behavior as finvoke, but uses the given caller object to check visibility if callType demands it.
|
IRubyObject |
invokeFrom(ThreadContext context,
CallType callType,
IRubyObject caller,
IRubyObject self,
java.lang.String name,
IRubyObject arg0,
IRubyObject arg1,
Block block)
Same behavior as finvoke, but uses the given caller object to check visibility if callType demands it.
|
IRubyObject |
invokeFrom(ThreadContext context,
CallType callType,
IRubyObject caller,
IRubyObject self,
java.lang.String name,
IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2)
Same behavior as finvoke, but uses the given caller object to check visibility if callType demands it.
|
IRubyObject |
invokeFrom(ThreadContext context,
CallType callType,
IRubyObject caller,
IRubyObject self,
java.lang.String name,
IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
Block block)
Same behavior as finvoke, but uses the given caller object to check visibility if callType demands it.
|
IRubyObject |
invokeInherited(ThreadContext context,
IRubyObject self,
IRubyObject subclass) |
IRubyObject |
invokePublic(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg)
MRI: rb_funcallv_public
|
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() |
void |
marshal(java.lang.Object obj,
MarshalStream marshalStream) |
static void |
marshalTo(RubyClass clazz,
MarshalStream output) |
static java.lang.Class<? extends IRubyObject> |
nearestReifiedClass(RubyClass klass) |
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,
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,
java.lang.String name,
IRubyObject caller,
CallType callType) |
static boolean |
rbMethodCallStatus(ThreadContext context,
DynamicMethod method,
CallType callType,
IRubyObject self) |
void |
reify() |
void |
reify(boolean useChildLoader) |
void |
reify(java.lang.String classDumpDir) |
void |
reify(java.lang.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(java.lang.String classDumpDir) |
void |
reifyWithAncestors(java.lang.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(java.lang.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(java.lang.Class<? extends IRubyObject> reifiedClass) |
void |
setRubyClassAllocator(java.lang.Class<? extends IRubyObject> clazz)
Set a reflective allocator that calls the "standard" Ruby object
constructor (Ruby, RubyClass) on the given class.
|
void |
setRubyStaticAllocator(java.lang.Class<?> clazz)
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.
|
java.util.Collection<RubyClass> |
subclasses() |
java.util.Collection<RubyClass> |
subclasses(boolean includeDescendants) |
IRubyObject |
superclass(ThreadContext context)
Return the real super class of this class.
|
<T> T |
toJava(java.lang.Class<T> target)
Convert the object to the specified Java class, if possible.
|
java.lang.Object |
unmarshal(UnmarshalStream unmarshalStream) |
static RubyClass |
unmarshalFrom(UnmarshalStream input) |
addClassProvider, addIncludingHierarchy, addMethod, addMethodAtBootTimeOnly, addMethodInternal, addMethodSymbols, addModuleFunction, addReadAttribute, addReadWriteAttribute, addWriteAttribute, alias_method, ancestors, ancestors, append_features, attr_accessor, attr_accessor, attr_reader, attr_reader, attr_writer, attr, attr19, checkForCyclicPrepend, checkFrozen, checkValidBindTargetFrom, class_variable_defined_p, class_variable_get, class_variable_get19, class_variable_set, class_variable_set19, class_variables, 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, constants, constants19, constants19, constantsCommon, constantsCommon, constantsCommon19, constantTableContains, constantTableFetch, constantTableRemove, constantTableStore, constantTableStore, constantTableStore, createModuleClass, define_method, define_method, define_method, defineAlias, defineAliases, defineAnnotatedConstant, defineAnnotatedConstants, defineAnnotatedMethod, defineAnnotatedMethod, defineAnnotatedMethod, defineAnnotatedMethod, defineAnnotatedMethods, defineAnnotatedMethodsIndividually, defineAutoload, defineClassUnder, defineConstant, defineMethodFromBlock, defineMethodFromCallable, defineModuleUnder, defineOrGetClassUnder, defineOrGetClassUnder, defineOrGetModuleUnder, deleteClassVariable, deleteConstant, deprecate_constant, deprecate_constant, deprecateConstant, discoverInstanceVariables, ensureClassVariablesSettable, ensureConstantsSettable, equals, 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, getAutoloadConstant, getAutoloadFile, getBaseName, getCacheProxy, getCacheToken, getClass, getClassIndex, getClassVar, getClassVar, getClassVariableNameList, getClassVariables, getClassVariablesForRead, getClassVarQuiet, getConstant, getConstant, getConstant, getConstantAt, getConstantAt, getConstantAtSpecial, getConstantFrom, getConstantFromConstMissing, getConstantFromNoConstMissing, getConstantFromNoConstMissing, getConstantMap, getConstantMapForWrite, getConstantNames, getConstantNames, getConstantNoConstMissing, getConstantNoConstMissing, getConstantNoConstMissing, getConstantNoConstMissingSkipAutoload, getConstantNoConstMissingSKipAutoload, getDelegate, getGeneration, getGenerationObject, getIdTest, getInvalidator, getJavaProxy, getMethodLocation, getMethods, getMethodsForWrite, getModule, getName, getNonIncludedClass, getParent, getRefinements, getSimpleName, getStoredConstantList, getStoredConstantNameList, getSuperClass, hasClassVariable, hasConstant, hash, hashCode, hasInternalModuleVariable, hasModuleInHierarchy, hasModuleInPrepends, hasPrepends, include_p, include, include, included_modules, included, includeModule, initialize, instance_method, instance_methods, instance_methods19, instanceMethods, instanceMethods, invalidateCacheDescendantsInner, invalidateConstantCache, invalidateConstantCaches, invalidateCoreClasses, isClassVarDefined, isConstantDefined, isIncluded, isInstance, isKindOfModule, isMethodBound, isMethodBound, isMethodBuiltin, isPrepended, isRefinement, isSame, isSynchronized, loadPopulatorFor, 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, newIdTest, newIncludeClass, newMethod, newMethod, newMethod, newModule, newModule, op_cmp, op_eqq, op_equal, op_ge, op_gt, op_le, op_lt, prepend_features, prepend, prepended, prependModule, 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_method, public_instance_methods, public_instance_methods19, public_method_defined, putAlias, putMethod, rbPrivate, rbProtected, rbPublic, refine, remove_class_variable, remove_class_variable19, remove_const, remove_method, removeClassProvider, removeClassVariable, removeMethod, resolveUndefConstant, respondsToMethod, retrieveMethod, rubyBaseName, rubyName, searchInternalModuleVariable, searchMethod, searchMethodCommon, searchMethodInner, searchMethodWithRefinementsInner, searchWithCache, searchWithCache, searchWithRefinements, setBaseName, setCacheProxy, setClassVar, setConstant, setConstant, setConstantQuiet, setConstantVisibility, setInternalModuleVariable, setJavaProxy, setMethodLocation, setMethodVisibility, setParent, setRefinements, setSuperClass, singleton_class_p, storeClassVariable, storeConstant, storeConstant, syncClassVariables, syncConstants, to_s, undef_method, undef, undefinedMethodMessage, undefineMethod, updateGeneration, used_modules, using, usingModule, validateClassVariable, validateClassVariable, validateClassVariable, validateConstant, validateConstant
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, dig, eqlInternal, equalInternal, inspect, puts, specificEval, toRubyString, toString
addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkCallMethod, checkStringType, checkStringType19, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, decode, 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, getMetaClass, getNativeHandle, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getSingletonClassCloneAndAttach, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hashyInspect, hasInstanceVariable, hasInternalVariable, hasVariables, id, infectBy, initialize, 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, isSpecialConst, isSpecialObject, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, method_missing, method_missing19, method, method19, methods, methods, methods19, nil_p, nonFixnumHashCode, OBJ_INIT_COPY, objInitCopy, 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, rbClone, rbInspect, 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_added, singleton_method_added19, singleton_method_removed, singleton_method_removed19, singleton_method_undefined, singleton_method_undefined19, singleton_method, singleton_methods, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted_p, testFrozen, testFrozen, to_a, trust, type_deprecated, type, untaint, untrust, untrusted_p, validateInstanceVariable, validateInstanceVariable, 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
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(java.lang.Class cls)
cls
- The class on which to call the default constructor to allocatepublic void setRubyClassAllocator(java.lang.Class<? extends IRubyObject> clazz)
clazz
- The class from which to grab a standard Ruby constructorpublic void setRubyStaticAllocator(java.lang.Class<?> clazz)
clazz
- 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 java.util.Map<java.lang.String,VariableAccessor> getVariableAccessorsForRead()
public VariableAccessor getVariableAccessorForWrite(java.lang.String name)
public VariableAccessor getVariableAccessorForRead(java.lang.String name)
public VariableAccessor getFFIHandleAccessorForRead()
public VariableAccessor getFFIHandleAccessorForWrite()
public VariableAccessor getObjectGroupAccessorForRead()
public VariableAccessor getObjectGroupAccessorForWrite()
public int getVariableTableSize()
public int getVariableTableSizeWithExtras()
public java.lang.String[] getVariableNames()
public java.util.Map<java.lang.String,VariableAccessor> getVariableTableCopy()
public ClassIndex getNativeClassIndex()
RubyObject
getNativeClassIndex
in interface CoreObjectType
getNativeClassIndex
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, java.lang.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, 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 boolean notVisibleAndNotMethodMissing(DynamicMethod method, java.lang.String name, IRubyObject caller, CallType callType)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, Block block)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject[] args, Block block)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg, Block block)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, Block block)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name)
public IRubyObject invokeFrom(ThreadContext context, CallType callType, IRubyObject caller, IRubyObject self, java.lang.String name, Block block)
public IRubyObject invokeFrom(ThreadContext context, CallType callType, IRubyObject caller, IRubyObject self, java.lang.String name, IRubyObject[] args, Block block)
public IRubyObject invokeFrom(ThreadContext context, CallType callType, IRubyObject caller, IRubyObject self, java.lang.String name, IRubyObject arg, Block block)
public IRubyObject invokeFrom(ThreadContext context, CallType callType, IRubyObject caller, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, Block block)
public IRubyObject invokeFrom(ThreadContext context, CallType callType, IRubyObject caller, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
public IRubyObject invokeFrom(ThreadContext context, CallType callType, IRubyObject caller, IRubyObject self, java.lang.String name)
public IRubyObject invokeFrom(ThreadContext context, CallType callType, IRubyObject caller, IRubyObject self, java.lang.String name, IRubyObject[] args)
public IRubyObject invokeFrom(ThreadContext context, CallType callType, IRubyObject caller, IRubyObject self, java.lang.String name, IRubyObject arg)
public IRubyObject invokeFrom(ThreadContext context, CallType callType, IRubyObject caller, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1)
public IRubyObject invokeFrom(ThreadContext context, CallType callType, IRubyObject caller, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)
public IRubyObject invokePublic(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg)
public final IRubyObject finvokeChecked(ThreadContext context, IRubyObject self, java.lang.String name)
public final IRubyObject finvokeChecked(ThreadContext context, IRubyObject self, JavaSites.CheckedSites sites)
public final IRubyObject finvokeChecked(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject... args)
public final IRubyObject finvokeChecked(ThreadContext context, IRubyObject self, JavaSites.CheckedSites sites, IRubyObject... args)
public static boolean checkFuncallCallable(ThreadContext context, DynamicMethod method, CallType callType, IRubyObject self)
public static boolean rbMethodCallStatus(ThreadContext context, DynamicMethod method, CallType callType, IRubyObject self)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject[] args)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1)
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, 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 final java.util.Collection<RubyClass> subclasses()
public java.util.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(java.util.List<Invalidator> invalidators)
public final 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(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
public boolean isReifiable()
public void reifyWithAncestors()
public void reifyWithAncestors(java.lang.String classDumpDir)
public void reifyWithAncestors(boolean useChildLoader)
public void reifyWithAncestors(java.lang.String classDumpDir, boolean useChildLoader)
classDumpDir
- the path in which to dump reified class bytesuseChildLoader
- whether to load the class into its own child classloaderpublic final void reify()
public final void reify(java.lang.String classDumpDir)
public final void reify(boolean useChildLoader)
public void reify(java.lang.String classDumpDir, boolean useChildLoader)
classDumpDir
- Directory to save reified java classpublic void setReifiedClass(java.lang.Class<? extends IRubyObject> reifiedClass)
public java.lang.Class<? extends IRubyObject> getReifiedClass()
public static java.lang.Class<? extends IRubyObject> nearestReifiedClass(RubyClass klass)
public java.util.Map<java.lang.String,java.util.List<java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>>>> getParameterAnnotations()
public void addParameterAnnotation(java.lang.String method, int i, java.lang.Class annoClass, java.util.Map<java.lang.String,java.lang.Object> value)
public java.util.Map<java.lang.String,java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>>> getMethodAnnotations()
public java.util.Map<java.lang.String,java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>>> getFieldAnnotations()
public void addMethodAnnotation(java.lang.String methodName, java.lang.Class annotation, java.util.Map fields)
public void addFieldAnnotation(java.lang.String fieldName, java.lang.Class annotation, java.util.Map fields)
public java.util.Map<java.lang.String,java.lang.Class[]> getMethodSignatures()
public java.util.Map<java.lang.String,java.lang.Class> getFieldSignatures()
public void addMethodSignature(java.lang.String methodName, java.lang.Class[] types)
public void addFieldSignature(java.lang.String fieldName, java.lang.Class type)
public java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>> getClassAnnotations()
public void addClassAnnotation(java.lang.Class annotation, java.util.Map fields)
public <T> T toJava(java.lang.Class<T> target)
IRubyObject
toJava
in interface IRubyObject
toJava
in class RubyModule
target
- The target type to which the object should be converted.IRubyObject.toJava(java.lang.Class<T>)
public void smartDump(MarshalStream stream, IRubyObject target) throws java.io.IOException
stream
- The stream to which to marshal the datatarget
- The object whose data should be marshaledjava.io.IOException
- 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
_load@Deprecated public IRubyObject invoke(ThreadContext context, IRubyObject self, int methodIndex, java.lang.String name, IRubyObject[] args, CallType callType, Block block)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, CallType callType, Block block)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject[] args, CallType callType, Block block)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg, CallType callType, Block block)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, CallType callType, 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 invoke(ThreadContext context, IRubyObject self, java.lang.String name, CallType callType)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject[] args, CallType callType)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg, CallType callType)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, CallType callType)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, CallType callType)
@Deprecated public VariableAccessorField getObjectIdAccessorField()
@Deprecated public VariableAccessorField getFFIHandleAccessorField()
@Deprecated public VariableAccessorField getObjectGroupAccessorField()
Copyright © 2001-2019 JRuby. All Rights Reserved.