Package org.jruby.javasupport
Class JavaClass
java.lang.Object
org.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.javasupport.JavaObject
org.jruby.javasupport.JavaClass
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<IRubyObject>,InstanceVariables,InternalVariables,IRubyObject,CoreObjectType
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.DataNested classes/interfaces inherited from class org.jruby.RubyBasicObject
RubyBasicObject.Finalizer -
Field Summary
FieldsFields inherited from class org.jruby.RubyObject
IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, REIFYING_OBJECT_ALLOCATORFields inherited from class org.jruby.RubyBasicObject
ALL_F, BASICOBJECT_ALLOCATOR, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, IS_OVERLAID_F, metaClass, NEVER, NIL_F, REFINED_MODULE_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, varTableStampFields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static IRubyObjectaddProxyExtender(ThreadContext context, Class<?> klass, IRubyObject extender) annotation(IRubyObject annoClass) annotation_present_p(IRubyObject annoClass) array_p()static booleanassignable(Class<?> target, Class<?> from) assignable_from_p(IRubyObject other) private static RubyArraybuildConstructors(Ruby runtime, Constructor<?>[] constructors) private static RubyArraybuildFieldResults(Ruby runtime, Field[] fields) classes()concatArrays(ThreadContext context, JavaArray original, JavaArray additional) Contatenate two Java arrays into a new one.concatArrays(ThreadContext context, JavaArray original, IRubyObject additional) The slow version for when concatenating a Java array of a different type.constructor(ThreadContext context, IRubyObject[] args) (package private) static RubyClasscreateJavaClassClass(Ruby runtime, RubyModule Java, RubyClass JavaObject) declared_constructor(ThreadContext context, IRubyObject[] args) declared_field(ThreadContext context, IRubyObject name) declared_method(ThreadContext context, IRubyObject[] args) declared_method_smart(ThreadContext context, IRubyObject[] args) emptyJavaArray(ThreadContext context) enum_p()final booleanThis override does not do a "checked" dispatch.static IRubyObjectextend_proxy(ThreadContext context, IRubyObject self, IRubyObject extender) field(ThreadContext context, IRubyObject name) fields()final_p()(package private) static JavaClassfor_name(IRubyObject recv, String name) static JavaClassfor_name(IRubyObject recv, IRubyObject name) static JavaClassforNameQuiet(Ruby runtime, String className) Deprecated.static JavaClassforNameVerbose(Ruby runtime, String className) Deprecated.static JavaClassDeprecated.static Class<?>[]getArgumentTypes(ThreadContext context, IRubyObject[] args, int offset) static Constructor[]getConstructors(Class<?> clazz) static Class<?>[]getDeclaredClasses(Class<?> clazz) static Field[]getDeclaredFields(Class<?> clazz) static Field[]static Class<?>getJavaClass(ThreadContext context, RubyModule proxy) Get the associated JavaClass for a proxy module.static Class<?>getJavaClassIfProxy(ThreadContext context, RubyModule type) Retieve a JavaClass if the passed module/class is a Java proxy.static JavaCallablegetMatchingCallable(Ruby runtime, Class<?> javaClass, String methodName, Class<?>[] argumentTypes) final RubyClassfinal RubyModulestatic RubyArraygetRubyArray(Ruby runtime, Class<?>[] classes) Deprecated.static StringgetSimpleName(Class<?> clazz) final inthashCode()This override does not do "checked" dispatch since Object usually has #hash defined.inspect()rb_obj_inspect call-seq: obj.inspect => string Returns a string containing a human-readable representation of obj.final booleanisAssignableFrom(Class<?> clazz) (package private) booleanstatic booleanisProxyType(ThreadContext context, RubyModule proxy) static IRubyObjectjava_class(ThreadContext context, RubyModule type) Deprecated.java_method(ThreadContext context, IRubyObject[] args) final Classname()new_array(IRubyObject lengthArgument) op_cmp(IRubyObject other) public_p()static JavaClassresolveType(ThreadContext context, IRubyObject type) Deprecated.resource(IRubyObject name) signers()private RubyArraytoJavaMethods(Method[] methods, boolean isStatic) static RubyArraytoRubyArray(Ruby runtime, Class<?>[] classes) Deprecated.static RaiseExceptionundefinedFieldError(Ruby runtime, String javaClassName, String name) Methods inherited from class org.jruby.javasupport.JavaObject
createJavaObjectClass, dataGetStruct, dataWrapStruct, get_java_class, getJavaClass, getValue, hash, is_java_proxy, java_class, java_type, length, marshal_dump, marshal_load, op_equal, op_equal, registerRubyMethods, ruby_synchronized, ruby_synchronized, same, to_s, to_s, toJava, wrap, wrapMethods inherited from class org.jruby.RubyObject
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, dig, dig1, dig2, eqlInternal, equalInternal, getNativeClassIndex, inspect, op_eqq, puts, specificEval, toRubyString, toStringMethods inherited from class org.jruby.RubyBasicObject
addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkCallMethod, checkFrozen, checkStringType, checkStringType19, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStructChecked, decode, display, dup, ensureInstanceVariablesSettable, eql, eql_p, equal_p, equal_p19, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, freeze, frozen_p, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getMetaClass, getMetaClass, getNativeHandle, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getSingletonClassCloneAndAttach, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hashyInspect, hasInstanceVariable, hasInstanceVariables, hasInternalVariable, hasVariables, id, infectBy, initialize, initialize_copy, initialize19, 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, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isSpecialConst, isSpecialObject, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, method, method_missing, method_missing19, method19, methods, methods, methods19, nil_p, nonFixnumHashCode, OBJ_INIT_COPY, objInitCopy, op_cmp, op_equal, op_equal_19, op_match, op_match19, op_not, op_not_equal, op_not_match, 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, singleton_method_added, singleton_method_added19, singleton_method_removed, singleton_method_removed19, singleton_method_undefined, singleton_method_undefined19, singleton_methods, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted_p, testFrozen, testFrozen, to_a, to_a, trust, type, type_deprecated, untaint, untrust, untrusted_p, validateInstanceVariable, validateInstanceVariable, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnder
-
Field Details
-
EMPTY_CLASS_ARRAY
-
constructors
-
-
Constructor Details
-
JavaClass
-
JavaClass
-
-
Method Details
-
equals
Description copied from class:RubyObjectThis override does not do a "checked" dispatch.- Overrides:
equalsin classJavaObject- See Also:
-
hashCode
public final int hashCode()Description copied from class:RubyObjectThis override does not do "checked" dispatch since Object usually has #hash defined.- Overrides:
hashCodein classJavaObject- See Also:
-
getProxyModule
-
getProxyClass
-
addProxyExtender
private static IRubyObject addProxyExtender(ThreadContext context, Class<?> klass, IRubyObject extender) -
extend_proxy
public static IRubyObject extend_proxy(ThreadContext context, IRubyObject self, IRubyObject extender) -
get
Deprecated. -
getRubyArray
Deprecated. -
toRubyArray
Deprecated. -
createJavaClassClass
-
javaClass
-
getJavaClass
Get the associated JavaClass for a proxy module. The passed module/class is assumed to be a Java proxy module/class!- Parameters:
context-proxy-- Returns:
- class
-
getJavaClassIfProxy
Retieve a JavaClass if the passed module/class is a Java proxy.- Parameters:
context-type-- Returns:
- class or null if not a Java proxy
-
isProxyType
-
java_class
Deprecated.Returns the (reified or proxied) Java class if the passed Ruby module/class has one.- Parameters:
context-type-- Returns:
- Java proxy class, Java reified class or nil
-
resolveType
Deprecated.Resolves a Java class from a passed type parameter. Uisng the rules accepted by `to_java(type)` in Ruby land.- Parameters:
context-type-- Returns:
- resolved type or null if resolution failed
-
forNameVerbose
Deprecated. -
forNameQuiet
Deprecated. -
for_name
-
for_name
-
ruby_class
-
public_p
-
protected_p
-
private_p
-
final_p
-
interface_p
-
array_p
-
enum_p
-
annotation_p
-
anonymous_class_p
-
local_class_p
-
member_class_p
-
synthetic_p
-
name
-
inspect
Description copied from class:RubyBasicObjectrb_obj_inspect call-seq: obj.inspect => string Returns a string containing a human-readable representation of obj. If not overridden, uses theto_smethod to generate the string. [ 1, 2, 3..4, 'five' ].inspect #=> "[1, 2, 3..4, \"five\"]" Time.new.inspect #=> "Wed Apr 09 08:54:39 CDT 2003"- Specified by:
inspectin interfaceIRubyObject- Overrides:
inspectin classRubyBasicObject- Returns:
- String
-
canonical_name
-
get_package
-
class_loader
-
protection_domain
-
resource
-
resource_as_stream
-
resource_as_string
-
annotation
-
annotations
-
annotations_p
-
declared_annotations
-
declared_annotations_p
-
annotation_present_p
-
modifiers
-
declaring_class
-
enclosing_class
-
enclosing_constructor
-
enclosing_method
-
enum_constants
-
generic_interfaces
-
generic_superclass
-
type_parameters
-
signers
-
getSimpleName
-
simple_name
-
superclass
-
op_cmp
-
java_instance_methods
-
declared_instance_methods
-
java_class_methods
-
declared_class_methods
-
toJavaMethods
-
java_method
-
declared_method
-
declared_method_smart
-
getMatchingCallable
public static JavaCallable getMatchingCallable(Ruby runtime, Class<?> javaClass, String methodName, Class<?>[] argumentTypes) -
getArgumentTypes
-
constructors
-
classes
-
declared_classes
-
declared_constructors
-
buildConstructors
-
constructor
-
declared_constructor
-
array_class
-
new_array
-
emptyJavaArray
-
concatArrays
Contatenate two Java arrays into a new one. The component type of the additional array must be assignable to the component type of the original array.- Parameters:
context-original-additional-- Returns:
-
concatArrays
The slow version for when concatenating a Java array of a different type.- Parameters:
context-original-additional-- Returns:
-
fields
-
declared_fields
-
buildFieldResults
-
field
-
declared_field
-
undefinedFieldError
-
interfaces
-
primitive_p
-
isPrimitive
boolean isPrimitive() -
assignable_from_p
-
isAssignableFrom
-
assignable
-
component_type
-
getConstructors
-
getDeclaredClasses
-
getDeclaredFields
-
getFields
-