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:
- java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<IRubyObject>, InstanceVariables, InternalVariables, IRubyObject, CoreObjectType
public class JavaClass
- extends JavaObject
- See Also:
- Serialized Form
Fields 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, 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, USER8_F |
Method Summary |
void |
addProxyExtender(IRubyObject extender)
|
RubyBoolean |
annotation_p()
|
IRubyObject |
annotation_present_p(IRubyObject annoClass)
|
IRubyObject |
annotation(IRubyObject annoClass)
|
RubyBoolean |
annotations_p()
|
IRubyObject |
annotations()
|
RubyBoolean |
anonymous_class_p()
|
JavaClass |
array_class()
|
RubyBoolean |
array_p()
|
RubyBoolean |
assignable_from_p(IRubyObject other)
|
static boolean |
assignable(java.lang.Class<?> thisClass,
java.lang.Class<?> otherClass)
|
IRubyObject |
canonical_name()
|
IRubyObject |
class_loader()
|
RubyArray |
classes()
|
JavaClass |
component_type()
|
IRubyObject |
concatArrays(ThreadContext context,
JavaArray original,
IRubyObject additional)
The slow version for when concatenating a Java array of a different type. |
IRubyObject |
concatArrays(ThreadContext context,
JavaArray original,
JavaArray additional)
Contatenate two Java arrays into a new one. |
JavaConstructor |
constructor(IRubyObject[] args)
|
RubyArray |
constructors()
|
static RubyClass |
createJavaClassClass(Ruby runtime,
RubyModule javaModule)
|
RubyBoolean |
declared_annotations_p()
|
IRubyObject |
declared_annotations()
|
RubyArray |
declared_class_methods()
|
RubyArray |
declared_classes()
|
JavaConstructor |
declared_constructor(IRubyObject[] args)
|
RubyArray |
declared_constructors()
|
JavaField |
declared_field(ThreadContext context,
IRubyObject name)
|
RubyArray |
declared_fields()
|
RubyArray |
declared_instance_methods()
|
JavaCallable |
declared_method_smart(IRubyObject[] args)
|
JavaMethod |
declared_method(IRubyObject[] args)
|
IRubyObject |
declaring_class()
|
IRubyObject |
emptyJavaArray(ThreadContext context)
|
IRubyObject |
enclosing_class()
|
IRubyObject |
enclosing_constructor()
|
IRubyObject |
enclosing_method()
|
IRubyObject |
enum_constants()
|
RubyBoolean |
enum_p()
|
boolean |
equals(java.lang.Object other)
This method is just a wrapper around the Ruby "==" method,
provided so that RubyObjects can be used as keys in the Java
HashMap object underlying RubyHash. |
IRubyObject |
extend_proxy(IRubyObject extender)
|
JavaField |
field(ThreadContext context,
IRubyObject name)
|
RubyArray |
fields()
|
RubyBoolean |
final_p()
|
static JavaClass |
for_name(IRubyObject recv,
IRubyObject name)
|
static JavaClass |
forNameQuiet(Ruby runtime,
java.lang.String className)
|
static JavaClass |
forNameVerbose(Ruby runtime,
java.lang.String className)
|
IRubyObject |
generic_interfaces()
|
IRubyObject |
generic_superclass()
|
IRubyObject |
get_package()
|
static JavaClass |
get(Ruby runtime,
java.lang.Class<?> klass)
|
static java.lang.reflect.Field[] |
getDeclaredFields(java.lang.Class<?> javaClass)
|
static java.lang.reflect.Field[] |
getFields(java.lang.Class<?> javaClass)
|
static JavaCallable |
getMatchingCallable(Ruby runtime,
java.lang.Class<?> javaClass,
java.lang.String methodName,
java.lang.Class<?>[] argumentTypes)
|
static java.lang.reflect.Method[] |
getMethods(java.lang.Class<?> javaClass)
|
RubyClass |
getProxyClass()
|
RubyModule |
getProxyModule()
|
static RubyArray |
getRubyArray(Ruby runtime,
java.lang.Class<?>[] classes)
|
int |
hashCode()
Override the Object#hashCode method to make sure that the Ruby
hash is actually used as the hashcode for Ruby objects. |
RubyString |
inspect()
rb_obj_inspect
call-seq:
obj.inspect => string
Returns a string containing a human-readable representation of
obj. |
RubyBoolean |
interface_p()
|
RubyArray |
interfaces()
|
RubyArray |
java_class_methods()
|
RubyArray |
java_instance_methods()
|
JavaMethod |
java_method(IRubyObject[] args)
|
IRubyObject |
javaArrayFromRubyArray(ThreadContext context,
IRubyObject fromArray)
|
IRubyObject |
javaArraySubarray(ThreadContext context,
JavaArray fromArray,
int index,
int size)
|
java.lang.Class |
javaClass()
|
RubyBoolean |
local_class_p()
|
void |
lockProxy()
|
RubyBoolean |
member_class_p()
|
IRubyObject |
modifiers()
|
RubyString |
name()
|
JavaObject |
new_array(IRubyObject lengthArgument)
|
IRubyObject |
op_cmp(IRubyObject other)
|
RubyBoolean |
primitive_p()
|
RubyBoolean |
private_p()
|
RubyBoolean |
protected_p()
|
IRubyObject |
protection_domain()
|
RubyBoolean |
public_p()
|
IRubyObject |
resource_as_stream(IRubyObject name)
|
IRubyObject |
resource_as_string(IRubyObject name)
|
IRubyObject |
resource(IRubyObject name)
|
RubyModule |
ruby_class()
|
void |
setupInterfaceModule(RubyModule module)
|
void |
setupProxy(RubyClass proxy)
|
IRubyObject |
signers()
|
RubyString |
simple_name()
|
IRubyObject |
superclass()
|
IRubyObject |
synthetic_p()
|
IRubyObject |
type_parameters()
|
static RaiseException |
undefinedFieldError(Ruby runtime,
java.lang.String javaClassName,
java.lang.String name)
|
void |
unlockProxy()
|
Methods inherited from class org.jruby.javasupport.JavaObject |
afill, aref, aset, createJavaObjectClass, dataGetStruct, dataWrapStruct, 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, wrap |
Methods inherited from class org.jruby.RubyObject |
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, eqlInternal, equalInternal, getNativeTypeIndex, initialize, op_eqq, puts, specificEval, toString |
Methods inherited from class org.jruby.RubyBasicObject |
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, dataGetStructChecked, display, dup, ensureInstanceVariablesSettable, eql_p, eql, equal_p, equal_p19, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, freeze, frozen_p, getFlag, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getMetaClass, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hashyInspect, hasInstanceVariable, hasInternalVariable, hasVariables, id_deprecated, id, infectBy, initialize_copy, initialize19, initialize19, initialize19, initialize19, initialize19, initObjectId, 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, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, method_missing19, method, method19, methods, methods, methods19, nil_p, op_cmp, op_equal_19, op_equal, 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, send19, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, 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 |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
METHOD_MANGLE
public static final java.lang.String METHOD_MANGLE
- See Also:
- Constant Field Values
DEBUG_SCALA
public static final boolean DEBUG_SCALA
- See Also:
- Constant Field Values
CAN_SET_ACCESSIBLE
public static final boolean CAN_SET_ACCESSIBLE
getProxyModule
public RubyModule getProxyModule()
getProxyClass
public RubyClass getProxyClass()
lockProxy
public void lockProxy()
unlockProxy
public void unlockProxy()
equals
public boolean equals(java.lang.Object other)
- Description copied from class:
RubyObject
- This method is just a wrapper around the Ruby "==" method,
provided so that RubyObjects can be used as keys in the Java
HashMap object underlying RubyHash.
- Overrides:
equals
in class JavaObject
hashCode
public int hashCode()
- Description copied from class:
RubyObject
- Override the Object#hashCode method to make sure that the Ruby
hash is actually used as the hashcode for Ruby objects. If the
Ruby "hash" method doesn't return a number, the Object#hashCode
implementation will be used instead.
- Overrides:
hashCode
in class JavaObject
setupProxy
public void setupProxy(RubyClass proxy)
setupInterfaceModule
public void setupInterfaceModule(RubyModule module)
addProxyExtender
public void addProxyExtender(IRubyObject extender)
extend_proxy
public IRubyObject extend_proxy(IRubyObject extender)
get
public static JavaClass get(Ruby runtime,
java.lang.Class<?> klass)
getRubyArray
public static RubyArray getRubyArray(Ruby runtime,
java.lang.Class<?>[] classes)
createJavaClassClass
public static RubyClass createJavaClassClass(Ruby runtime,
RubyModule javaModule)
forNameVerbose
public static JavaClass forNameVerbose(Ruby runtime,
java.lang.String className)
forNameQuiet
public static JavaClass forNameQuiet(Ruby runtime,
java.lang.String className)
for_name
public static JavaClass for_name(IRubyObject recv,
IRubyObject name)
ruby_class
public RubyModule ruby_class()
public_p
public RubyBoolean public_p()
protected_p
public RubyBoolean protected_p()
private_p
public RubyBoolean private_p()
javaClass
public java.lang.Class javaClass()
final_p
public RubyBoolean final_p()
interface_p
public RubyBoolean interface_p()
array_p
public RubyBoolean array_p()
enum_p
public RubyBoolean enum_p()
annotation_p
public RubyBoolean annotation_p()
anonymous_class_p
public RubyBoolean anonymous_class_p()
local_class_p
public RubyBoolean local_class_p()
member_class_p
public RubyBoolean member_class_p()
synthetic_p
public IRubyObject synthetic_p()
name
public RubyString name()
inspect
public RubyString inspect()
- Description copied from class:
RubyBasicObject
- rb_obj_inspect
call-seq:
obj.inspect => string
Returns a string containing a human-readable representation of
obj. If not overridden, uses the
to_s
method 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:
inspect
in interface IRubyObject
- Overrides:
inspect
in class RubyBasicObject
- Returns:
- String
canonical_name
public IRubyObject canonical_name()
get_package
public IRubyObject get_package()
class_loader
public IRubyObject class_loader()
protection_domain
public IRubyObject protection_domain()
resource
public IRubyObject resource(IRubyObject name)
resource_as_stream
public IRubyObject resource_as_stream(IRubyObject name)
resource_as_string
public IRubyObject resource_as_string(IRubyObject name)
annotation
public IRubyObject annotation(IRubyObject annoClass)
annotations
public IRubyObject annotations()
annotations_p
public RubyBoolean annotations_p()
declared_annotations
public IRubyObject declared_annotations()
declared_annotations_p
public RubyBoolean declared_annotations_p()
annotation_present_p
public IRubyObject annotation_present_p(IRubyObject annoClass)
modifiers
public IRubyObject modifiers()
declaring_class
public IRubyObject declaring_class()
enclosing_class
public IRubyObject enclosing_class()
enclosing_constructor
public IRubyObject enclosing_constructor()
enclosing_method
public IRubyObject enclosing_method()
enum_constants
public IRubyObject enum_constants()
generic_interfaces
public IRubyObject generic_interfaces()
generic_superclass
public IRubyObject generic_superclass()
type_parameters
public IRubyObject type_parameters()
signers
public IRubyObject signers()
simple_name
public RubyString simple_name()
superclass
public IRubyObject superclass()
op_cmp
public IRubyObject op_cmp(IRubyObject other)
java_instance_methods
public RubyArray java_instance_methods()
declared_instance_methods
public RubyArray declared_instance_methods()
java_class_methods
public RubyArray java_class_methods()
declared_class_methods
public RubyArray declared_class_methods()
java_method
public JavaMethod java_method(IRubyObject[] args)
declared_method
public JavaMethod declared_method(IRubyObject[] args)
declared_method_smart
public JavaCallable declared_method_smart(IRubyObject[] args)
getMatchingCallable
public static JavaCallable getMatchingCallable(Ruby runtime,
java.lang.Class<?> javaClass,
java.lang.String methodName,
java.lang.Class<?>[] argumentTypes)
constructors
public RubyArray constructors()
classes
public RubyArray classes()
declared_classes
public RubyArray declared_classes()
declared_constructors
public RubyArray declared_constructors()
constructor
public JavaConstructor constructor(IRubyObject[] args)
declared_constructor
public JavaConstructor declared_constructor(IRubyObject[] args)
array_class
public JavaClass array_class()
new_array
public JavaObject new_array(IRubyObject lengthArgument)
emptyJavaArray
public IRubyObject emptyJavaArray(ThreadContext context)
javaArraySubarray
public IRubyObject javaArraySubarray(ThreadContext context,
JavaArray fromArray,
int index,
int size)
concatArrays
public IRubyObject concatArrays(ThreadContext context,
JavaArray original,
JavaArray additional)
- 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
public IRubyObject concatArrays(ThreadContext context,
JavaArray original,
IRubyObject additional)
- The slow version for when concatenating a Java array of a different type.
- Parameters:
context
- original
- additional
-
- Returns:
javaArrayFromRubyArray
public IRubyObject javaArrayFromRubyArray(ThreadContext context,
IRubyObject fromArray)
fields
public RubyArray fields()
declared_fields
public RubyArray declared_fields()
field
public JavaField field(ThreadContext context,
IRubyObject name)
declared_field
public JavaField declared_field(ThreadContext context,
IRubyObject name)
undefinedFieldError
public static RaiseException undefinedFieldError(Ruby runtime,
java.lang.String javaClassName,
java.lang.String name)
interfaces
public RubyArray interfaces()
primitive_p
public RubyBoolean primitive_p()
assignable_from_p
public RubyBoolean assignable_from_p(IRubyObject other)
assignable
public static boolean assignable(java.lang.Class<?> thisClass,
java.lang.Class<?> otherClass)
component_type
public JavaClass component_type()
getDeclaredFields
public static java.lang.reflect.Field[] getDeclaredFields(java.lang.Class<?> javaClass)
getFields
public static java.lang.reflect.Field[] getFields(java.lang.Class<?> javaClass)
getMethods
public static java.lang.reflect.Method[] getMethods(java.lang.Class<?> javaClass)
Copyright © 2002-2009 JRuby Team. All Rights Reserved.