org.jruby.javasupport
Class Java

java.lang.Object
  extended by org.jruby.javasupport.Java
All Implemented Interfaces:
Library

public class Java
extends java.lang.Object
implements Library


Nested Class Summary
static class Java.JavaUtilities
           
 
Constructor Summary
Java()
           
 
Method Summary
static IRubyObject access(IRubyObject recv, IRubyObject java_type)
           
static IRubyObject add_proxy_extender(IRubyObject recv, IRubyObject extender)
          Deprecated. 
static java.lang.Class argClass(IRubyObject a)
           
static java.lang.Class argClass(java.lang.Object a)
           
static int argsHashCode(java.lang.Class[] a)
           
static int argsHashCode(IRubyObject a0)
           
static int argsHashCode(IRubyObject[] a)
           
static int argsHashCode(IRubyObject a0, IRubyObject a1)
           
static int argsHashCode(IRubyObject a0, IRubyObject a1, IRubyObject a2)
           
static int argsHashCode(IRubyObject a0, IRubyObject a1, IRubyObject a2, IRubyObject a3)
           
static int argsHashCode(java.lang.Object[] a)
           
static IRubyObject concrete_proxy_inherited(IRubyObject recv, IRubyObject subclass)
           
static IRubyObject create_proxy_class(IRubyObject recv, IRubyObject constant, IRubyObject javaClass, IRubyObject module)
           
static RubyModule createJavaModule(Ruby runtime)
           
static IRubyObject define_exception_handler(IRubyObject recv, IRubyObject[] args, Block block)
           
static IRubyObject get_deprecated_interface_proxy(ThreadContext context, IRubyObject recv, IRubyObject javaClassObject)
           
static IRubyObject get_interface_module(IRubyObject recv, IRubyObject javaClassObject)
           
static IRubyObject get_java_class(IRubyObject recv, IRubyObject name)
           
static IRubyObject get_package_module_dot_format(IRubyObject recv, IRubyObject dottedName)
           
static IRubyObject get_package_module(IRubyObject recv, IRubyObject symObject)
           
static IRubyObject get_proxy_class(IRubyObject recv, IRubyObject java_class_object)
           
static IRubyObject get_proxy_or_package_under_package(ThreadContext context, IRubyObject recv, IRubyObject parentPackage, IRubyObject sym)
           
static IRubyObject get_top_level_proxy_or_package(ThreadContext context, IRubyObject recv, IRubyObject sym)
           
static IRubyObject getInstance(java.lang.Object rawJavaObject, RubyClass clazz)
          Returns a new proxy instance of type clazz for rawJavaObject, or the cached proxy if we've already seen this object.
static IRubyObject getInstance(Ruby runtime, java.lang.Object rawJavaObject)
          Returns a new proxy instance of a type corresponding to rawJavaObject's class, or the cached proxy if we've already seen this object.
static RubyModule getInterfaceModule(Ruby runtime, JavaClass javaClass)
           
static RubyModule getPackageModule(Ruby runtime, java.lang.String name)
           
static RubyModule getProxyClass(Ruby runtime, JavaClass javaClass)
           
static RubyModule getProxyOrPackageUnderPackage(ThreadContext context, Ruby runtime, RubyModule parentPackage, java.lang.String sym)
           
static RubyModule getTopLevelProxyOrPackage(ThreadContext context, Ruby runtime, java.lang.String sym)
           
static IRubyObject is_primitive_type(IRubyObject recv, IRubyObject sym)
           
static IRubyObject java_to_primitive(IRubyObject recv, IRubyObject object, Block unusedBlock)
           
static IRubyObject java_to_ruby(IRubyObject recv, IRubyObject object, Block unusedBlock)
          High-level object conversion utility function 'java_to_primitive' is the low-level version
 void load(Ruby runtime, boolean wrap)
           
static JavaCallable matching_method_internal(IRubyObject recv, java.util.Map cache, JavaCallable[] methods, java.lang.Object[] args, int len)
           
static IRubyObject matching_method(IRubyObject recv, IRubyObject methods, IRubyObject args)
           
static JavaCallable matchingCallableArityFour(IRubyObject recv, java.util.Map cache, JavaCallable[] methods, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3)
           
static JavaCallable matchingCallableArityN(IRubyObject recv, java.util.Map cache, JavaCallable[] methods, IRubyObject[] args, int argsLength)
           
static ParameterTypes matchingCallableArityN(IRubyObject recv, java.util.Map cache, ParameterTypes[] methods, IRubyObject[] args, int argsLength)
           
static JavaCallable matchingCallableArityOne(IRubyObject recv, java.util.Map cache, JavaCallable[] methods, IRubyObject arg0)
           
static JavaCallable matchingCallableArityThree(IRubyObject recv, java.util.Map cache, JavaCallable[] methods, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)
           
static JavaCallable matchingCallableArityTwo(IRubyObject recv, java.util.Map cache, JavaCallable[] methods, IRubyObject arg0, IRubyObject arg1)
           
static IRubyObject new_instance_for(IRubyObject recv, IRubyObject java_object)
          Returns a new proxy instance of type (RubyClass)recv for the wrapped java_object, or the cached proxy if we've already seen this object.
static IRubyObject new_proxy_instance(IRubyObject recv, IRubyObject[] args, Block block)
          Deprecated. 
static IRubyObject new_proxy_instance2(IRubyObject recv, IRubyObject wrapper, IRubyObject ifcs, Block block)
           
static IRubyObject primitive_match(IRubyObject recv, IRubyObject t1, IRubyObject t2)
           
static boolean primitive_match(java.lang.Object v1, java.lang.Object v2)
           
static IRubyObject primitive_to_java(IRubyObject recv, IRubyObject object, Block unusedBlock)
           
static IRubyObject ruby_to_java(IRubyObject recv, IRubyObject object, Block unusedBlock)
          High-level object conversion utility.
static IRubyObject to_java_object(IRubyObject recv)
           
static IRubyObject valid_constant_name_p(IRubyObject recv, IRubyObject name)
           
static IRubyObject wrap(IRubyObject recv, IRubyObject java_object)
           
static IRubyObject wrap(Ruby runtime, IRubyObject java_object)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Java

public Java()
Method Detail

load

public void load(Ruby runtime,
                 boolean wrap)
          throws java.io.IOException
Specified by:
load in interface Library
Throws:
java.io.IOException

createJavaModule

public static RubyModule createJavaModule(Ruby runtime)

is_primitive_type

public static IRubyObject is_primitive_type(IRubyObject recv,
                                            IRubyObject sym)

create_proxy_class

public static IRubyObject create_proxy_class(IRubyObject recv,
                                             IRubyObject constant,
                                             IRubyObject javaClass,
                                             IRubyObject module)

get_java_class

public static IRubyObject get_java_class(IRubyObject recv,
                                         IRubyObject name)

new_instance_for

public static IRubyObject new_instance_for(IRubyObject recv,
                                           IRubyObject java_object)
Returns a new proxy instance of type (RubyClass)recv for the wrapped java_object, or the cached proxy if we've already seen this object.

Parameters:
recv - the class for this object
java_object - the java object wrapped in a JavaObject wrapper
Returns:
the new or cached proxy for the specified Java object

getInstance

public static IRubyObject getInstance(java.lang.Object rawJavaObject,
                                      RubyClass clazz)
Returns a new proxy instance of type clazz for rawJavaObject, or the cached proxy if we've already seen this object.

Parameters:
rawJavaObject -
clazz -
Returns:
the new or cached proxy for the specified Java object

getInstance

public static IRubyObject getInstance(Ruby runtime,
                                      java.lang.Object rawJavaObject)
Returns a new proxy instance of a type corresponding to rawJavaObject's class, or the cached proxy if we've already seen this object. Note that primitives and strings are not coerced to corresponding Ruby types; use JavaUtil.convertJavaToUsableRubyObject to get coerced types or proxies as appropriate.

Parameters:
runtime -
rawJavaObject -
Returns:
the new or cached proxy for the specified Java object
See Also:
JavaUtil.convertJavaToUsableRubyObject

to_java_object

public static IRubyObject to_java_object(IRubyObject recv)

add_proxy_extender

@Deprecated
public static IRubyObject add_proxy_extender(IRubyObject recv,
                                                        IRubyObject extender)
Deprecated. 

Add a new proxy extender. This is used by JavaUtilities to allow adding methods to a given type's proxy and all types descending from that proxy's Java class.


getInterfaceModule

public static RubyModule getInterfaceModule(Ruby runtime,
                                            JavaClass javaClass)

get_interface_module

public static IRubyObject get_interface_module(IRubyObject recv,
                                               IRubyObject javaClassObject)

get_deprecated_interface_proxy

public static IRubyObject get_deprecated_interface_proxy(ThreadContext context,
                                                         IRubyObject recv,
                                                         IRubyObject javaClassObject)

getProxyClass

public static RubyModule getProxyClass(Ruby runtime,
                                       JavaClass javaClass)

get_proxy_class

public static IRubyObject get_proxy_class(IRubyObject recv,
                                          IRubyObject java_class_object)

concrete_proxy_inherited

public static IRubyObject concrete_proxy_inherited(IRubyObject recv,
                                                   IRubyObject subclass)

getPackageModule

public static RubyModule getPackageModule(Ruby runtime,
                                          java.lang.String name)

get_package_module

public static IRubyObject get_package_module(IRubyObject recv,
                                             IRubyObject symObject)

get_package_module_dot_format

public static IRubyObject get_package_module_dot_format(IRubyObject recv,
                                                        IRubyObject dottedName)

getProxyOrPackageUnderPackage

public static RubyModule getProxyOrPackageUnderPackage(ThreadContext context,
                                                       Ruby runtime,
                                                       RubyModule parentPackage,
                                                       java.lang.String sym)

get_proxy_or_package_under_package

public static IRubyObject get_proxy_or_package_under_package(ThreadContext context,
                                                             IRubyObject recv,
                                                             IRubyObject parentPackage,
                                                             IRubyObject sym)

getTopLevelProxyOrPackage

public static RubyModule getTopLevelProxyOrPackage(ThreadContext context,
                                                   Ruby runtime,
                                                   java.lang.String sym)

get_top_level_proxy_or_package

public static IRubyObject get_top_level_proxy_or_package(ThreadContext context,
                                                         IRubyObject recv,
                                                         IRubyObject sym)

matching_method

public static IRubyObject matching_method(IRubyObject recv,
                                          IRubyObject methods,
                                          IRubyObject args)

argsHashCode

public static int argsHashCode(java.lang.Object[] a)

argsHashCode

public static int argsHashCode(java.lang.Class[] a)

argsHashCode

public static int argsHashCode(IRubyObject a0)

argsHashCode

public static int argsHashCode(IRubyObject a0,
                               IRubyObject a1)

argsHashCode

public static int argsHashCode(IRubyObject a0,
                               IRubyObject a1,
                               IRubyObject a2)

argsHashCode

public static int argsHashCode(IRubyObject a0,
                               IRubyObject a1,
                               IRubyObject a2,
                               IRubyObject a3)

argsHashCode

public static int argsHashCode(IRubyObject[] a)

argClass

public static java.lang.Class argClass(java.lang.Object a)

argClass

public static java.lang.Class argClass(IRubyObject a)

matching_method_internal

public static JavaCallable matching_method_internal(IRubyObject recv,
                                                    java.util.Map cache,
                                                    JavaCallable[] methods,
                                                    java.lang.Object[] args,
                                                    int len)

matchingCallableArityN

public static ParameterTypes matchingCallableArityN(IRubyObject recv,
                                                    java.util.Map cache,
                                                    ParameterTypes[] methods,
                                                    IRubyObject[] args,
                                                    int argsLength)

matchingCallableArityN

public static JavaCallable matchingCallableArityN(IRubyObject recv,
                                                  java.util.Map cache,
                                                  JavaCallable[] methods,
                                                  IRubyObject[] args,
                                                  int argsLength)

matchingCallableArityOne

public static JavaCallable matchingCallableArityOne(IRubyObject recv,
                                                    java.util.Map cache,
                                                    JavaCallable[] methods,
                                                    IRubyObject arg0)

matchingCallableArityTwo

public static JavaCallable matchingCallableArityTwo(IRubyObject recv,
                                                    java.util.Map cache,
                                                    JavaCallable[] methods,
                                                    IRubyObject arg0,
                                                    IRubyObject arg1)

matchingCallableArityThree

public static JavaCallable matchingCallableArityThree(IRubyObject recv,
                                                      java.util.Map cache,
                                                      JavaCallable[] methods,
                                                      IRubyObject arg0,
                                                      IRubyObject arg1,
                                                      IRubyObject arg2)

matchingCallableArityFour

public static JavaCallable matchingCallableArityFour(IRubyObject recv,
                                                     java.util.Map cache,
                                                     JavaCallable[] methods,
                                                     IRubyObject arg0,
                                                     IRubyObject arg1,
                                                     IRubyObject arg2,
                                                     IRubyObject arg3)

access

public static IRubyObject access(IRubyObject recv,
                                 IRubyObject java_type)

valid_constant_name_p

public static IRubyObject valid_constant_name_p(IRubyObject recv,
                                                IRubyObject name)

primitive_match

public static boolean primitive_match(java.lang.Object v1,
                                      java.lang.Object v2)

primitive_match

public static IRubyObject primitive_match(IRubyObject recv,
                                          IRubyObject t1,
                                          IRubyObject t2)

wrap

public static IRubyObject wrap(IRubyObject recv,
                               IRubyObject java_object)

wrap

public static IRubyObject wrap(Ruby runtime,
                               IRubyObject java_object)

define_exception_handler

public static IRubyObject define_exception_handler(IRubyObject recv,
                                                   IRubyObject[] args,
                                                   Block block)

primitive_to_java

public static IRubyObject primitive_to_java(IRubyObject recv,
                                            IRubyObject object,
                                            Block unusedBlock)

java_to_ruby

public static IRubyObject java_to_ruby(IRubyObject recv,
                                       IRubyObject object,
                                       Block unusedBlock)
High-level object conversion utility function 'java_to_primitive' is the low-level version


ruby_to_java

public static IRubyObject ruby_to_java(IRubyObject recv,
                                       IRubyObject object,
                                       Block unusedBlock)
High-level object conversion utility.


java_to_primitive

public static IRubyObject java_to_primitive(IRubyObject recv,
                                            IRubyObject object,
                                            Block unusedBlock)

new_proxy_instance

@Deprecated
public static IRubyObject new_proxy_instance(IRubyObject recv,
                                                        IRubyObject[] args,
                                                        Block block)
Deprecated. 


new_proxy_instance2

public static IRubyObject new_proxy_instance2(IRubyObject recv,
                                              IRubyObject wrapper,
                                              IRubyObject ifcs,
                                              Block block)


Copyright © 2002-2007 JRuby Team. All Rights Reserved.