Top Inners Fields Constructors Methods
org.jruby.javasupport

public Class Java

extends Object
implements Library
Class Inheritance
All Implemented Interfaces
org.jruby.runtime.load.Library
Annotations
@JRubyModule
name:Java
Imports
java.lang.reflect.AccessibleObject, .Constructor, .Member, .InvocationHandler, .InvocationTargetException, .Method, .Modifier, .Proxy, java.util.ArrayList, .Map, .Arrays, .HashSet, .List, .Set, java.util.regex.Matcher, .Pattern, java.math.BigDecimal, .BigInteger, java.util.concurrent.ConcurrentHashMap, com.headius.backport9.modules.Modules, org.jcodings.Encoding, org.jruby.*, org.jruby.api.Access, org.jruby.exceptions.NameError, .TypeError, .RaiseException, org.jruby.javasupport.binding.Initializer, org.jruby.javasupport.proxy.JavaProxyClass, .JavaProxyConstructor, org.jruby.runtime.Arity, .Block, .Constants, .Helpers, .Visibility, .ThreadContext, org.jruby.runtime.builtin.IRubyObject, org.jruby.runtime.load.Library, org.jruby.anno.JRubyMethod, .JRubyModule, org.jruby.internal.runtime.methods.DynamicMethod, .JavaMethod.JavaMethodN, .JavaMethod.JavaMethodZero, org.jruby.java.addons.ArrayJavaAddons, .ClassJavaAddons, .IOJavaAddons, .KernelJavaAddons, .StringJavaAddons, org.jruby.java.codegen.RealClassGenerator, org.jruby.java.dispatch.CallableSelector, .CallableSelector.CallableCache, org.jruby.java.proxies.ArrayJavaProxy, .ArrayJavaProxyCreator, .ConcreteJavaProxy, .MapJavaProxy, .InterfaceJavaProxy, .JavaInterfaceTemplate, .JavaProxy, .RubyObjectHolderProxy, org.jruby.java.util.SystemPropertiesMap, org.jruby.util.*, org.jruby.util.cli.Options, org.jruby.util.collections.NonBlockingHashMapLong

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
private static class
private static class
private static class
public static class
public static class
Java.JCtorCache

Used for concrete reified classes.

public static class
public static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
private static final Pattern
public static final boolean
public static final boolean

Constructor Summary

AccessConstructor and Description
public
Java()

Method Summary

Modifier and TypeMethod and Description
private static void
public static IRubyObject
allocateProxy(Object javaObject, RubyClass clazz)

private static boolean
private static boolean
bindJavaPackageOrClassMethod(ThreadContext context, final String name, final RubyModule packageOrClass)

private static boolean
bindJavaPackageOrClassMethod(ThreadContext context, final RubyModule parentPackage, final String name, final RubyModule packageOrClass)

private static RubyModule
cacheConstant(ThreadContext context, final RubyModule owner, final String constName, final RubyModule packageOrClass, final boolean hidden)

public static JavaObject
castToJavaObject(ThreadContext context, IRubyObject newValue)
References Deprecated JavaObject is deprecated or references (maybe indirectly) at least one deprecated element.

private static <T extends ParameterTypes> T
checkCallableForArity(final int arity, final T[] callables, final int index)

private static void
checkJavaReservedNames(ThreadContext context, final String name, final boolean allowPrimitives)

public static IRubyObject
concrete_proxy_inherited(final IRubyObject clazz, final IRubyObject subclazz)
Deprecated

public static IRubyObject
const_missing(final ThreadContext context, final IRubyObject self, final IRubyObject name)

private static boolean
constantNotSetOrDifferent(ThreadContext context, final RubyModule target, final String constName, final RubyModule proxyClass)

public static IRubyObject
constructProxy(Ruby runtime, Constructor<? extends IRubyObject> proxyConstructor, RubyClass clazz)

public static IRubyObject
create_proxy_class(IRubyObject self, IRubyObject name, IRubyObject javaClass, IRubyObject mod)
Deprecated since 9.4.

public static RubyModule
private static RubyModule
createPackageModule(ThreadContext context, final RubyModule parentModule, final String name, final String packageString)

private static RubyClass
createProxyClass(ThreadContext context, final RubyClass proxyClass, final Class<?> javaClass, final RubyClass superClass, boolean invokeInherited)

pack-priv static RubyModule
createProxyClassForClass(final Ruby runtime, final Class<?> clazz)

pack-priv static <T extends ParameterTypes> ArrayList<T>
findCallablesForArity(final int arity, final T[] callables)

private static void
generateClassProxy(ThreadContext context, Class<?> clazz, RubyClass proxy, RubyClass superClass)

private static void
generateInterfaceProxy(ThreadContext context, final Class<T> javaClass, final RubyModule proxy)

public static Class<T>
public static IRubyObject
get_inner_class(final ThreadContext context, final RubyModule self, final IRubyObject name)

public static RubyModule
get_interface_module(final Ruby runtime, final IRubyObject java_class)
Deprecated since 10.0.

public static RubyModule
get_interface_module(ThreadContext context, final IRubyObject java_class)

public static RubyModule
get_package_module(final IRubyObject self, final IRubyObject name)
Deprecated since 10.0.

public static RubyModule
get_package_module(ThreadContext context, final IRubyObject self, final IRubyObject name)

public static IRubyObject
get_package_module_dot_format(ThreadContext context, final IRubyObject self, final IRubyObject dottedName)

public static RubyModule
get_proxy_class(final IRubyObject self, final IRubyObject java_class)
Deprecated since 10.0.

public static RubyModule
get_proxy_class(ThreadContext context, IRubyObject self, final IRubyObject java_class)

public static IRubyObject
get_proxy_or_package_under_package(final ThreadContext context, final IRubyObject self, final IRubyObject parentPackage, final IRubyObject name)

public static IRubyObject
public static Method

Returns:

the sole un-implemented method for a functional-style interface or null

Note

This method is internal and might be subject to change, do not assume its part of JRuby's API!

getFunctionalInterfaceMethod
(final Class<?> iface)

public static IRubyObject
getInstance(Ruby runtime, Object rawJavaObject)

Same as Java#getInstance(runtime, rawJavaObject, false).

public static IRubyObject

Returns:

the new (or cached) proxy for the specified Java object
getInstance
(Ruby
the JRuby runtime
runtime
,
Object
the object to get a wrapper for
rawJavaObject
,
boolean
whether to force the use of the proxy cache
forceCache
)

Returns a new proxy instance of a type corresponding to rawJavaObject's class, or the cached proxy if we've already seen this object.

public static RubyModule
getInterfaceModule(final Ruby runtime, final JavaClass javaClass)
Deprecated since 9.4-.

public static RubyModule
getInterfaceModule(final Ruby runtime, final Class<T> javaClass)
Deprecated since 10.0.

public static RubyModule
getInterfaceModule(ThreadContext context, final Class<T> javaClass)

public static Class<T>[]
public static Class<T>
getJavaClass(final Ruby runtime, final String className)
Deprecated since 10.0.

public static Class<T>
getJavaClass(ThreadContext context, final String className)

public static Class<T>
getJavaClass(final Ruby runtime, final String className, boolean initialize)
Deprecated since 10.0.

public static Class<T>
getJavaClass(ThreadContext context, final String className, boolean initialize)

public static RubyModule
getJavaPackageModule(final Ruby runtime, final Package pkg)

public static RubyModule
getJavaPackageModule(final Ruby runtime, final String packageString)
Deprecated since 10.0.

public static RubyModule
getJavaPackageModule(ThreadContext context, final String packageString)

private static String
private static RubyModule
getPackageModule(ThreadContext context, final String name)

public static RubyModule
getProxyClass(Ruby runtime, JavaClass javaClass)
Deprecated

public static RubyModule
getProxyClass(final Ruby runtime, final Class<?> clazz)
Deprecated since 10.0.

public static RubyModule
getProxyClass(ThreadContext context, final Class<?> clazz)

public static RubyClass
getProxyClassForObject(Ruby runtime, Object object)
Deprecated since 10.0.

public static RubyClass
private static RubyModule
getProxyClassOrNull(ThreadContext context, final String className)

pack-priv static RubyModule
getProxyOrPackageUnderPackage(final ThreadContext context, final RubyModule parentPackage, final String name, final boolean cacheMethod)

private static RubyModule
getProxyUnderClass(final ThreadContext context, final RubyModule enclosingClass, final String name)

public static Constructor<? extends IRubyObject>
getRealClassConstructor(final Ruby runtime, Class<? extends IRubyObject> proxyImplClass)

private static RubyModule
getTopLevelProxyOrPackage(ThreadContext context, final String name, final boolean cacheMethod)

pack-priv static RaiseException
initCause(final RaiseException ex, final Throwable cause)

private static int
private static IRubyObject
invokeProxyClassInherited(final ThreadContext context, final IRubyObject clazz, final IRubyObject subclazz)

public static <T extends AccessibleObject & Member> boolean
isAccessible(T member)

Check if the given member would be accessible without using the deprecated AccessibleObject.isAccessible.

private static boolean
public static boolean
isProxyType(final RubyModule proxy)

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

public static IRubyObject
java_to_ruby(IRubyObject recv, IRubyObject object, Block unusedBlock)
Deprecated

High-level object conversion utility function 'java_to_primitive' is the low-level version

public void
load(Ruby runtime, boolean wrap)

Implements org.jruby.runtime.load.Library.load.

public static Class<T>
loadJavaClass(final Ruby runtime, final String className)
Deprecated since 10.0.

public static Class<T>
loadJavaClass(ThreadContext context, final String className)

pack-priv static Class<T>
loadJavaClass(final Ruby runtime, final String className, boolean initialize)

private static RaiseException
private static RaiseException
private static int
public static IRubyObject
method_missing(ThreadContext context, final IRubyObject self, final IRubyObject name)

public static IRubyObject
method_missing(ThreadContext context, final IRubyObject self, final IRubyObject[] args)

public static IRubyObject
new_proxy_instance2(IRubyObject recv, final IRubyObject wrapper, final IRubyObject interfaces, Block block)
Deprecated since 10.0.

public static IRubyObject
new_proxy_instance2(ThreadContext context, IRubyObject recv, final IRubyObject wrapper, final IRubyObject interfaces, Block block)

public static Object
newInterfaceImpl(final IRubyObject wrapper, Class<T>[] interfaces)
Deprecated since 10.0.

public static Object
newInterfaceImpl(ThreadContext context, final IRubyObject wrapper, Class<T>[] interfaces)

private static Object
newProxyInterfaceImpl(final IRubyObject wrapper, final Class<T>[] interfaces, final ClassLoader loader)

public static Class<?>
resolveClassType(final ThreadContext context, final IRubyObject type)

pack-priv static Class<?>
private static Class<?>
private static Class<T>
public static RubyModule
resolveType(final Ruby runtime, final IRubyObject type)
Deprecated since 10.0.

public static RubyModule
resolveType(ThreadContext context, final IRubyObject type)

public static IRubyObject
ruby_to_java(final IRubyObject recv, IRubyObject object, Block unusedBlock)
Deprecated

High-level object conversion utility.

public static RubyModule
setProxyClass(final Ruby runtime, final RubyModule target, final String constName, final Class<?> javaClass)
Deprecated since 10.0.

public static RubyModule
setProxyClass(ThreadContext context, final RubyModule target, final String constName, final Class<?> javaClass)

private static void
setProxyClass(ThreadContext context, final RubyModule target, final String constName, final RubyModule proxyClass, final boolean validateConstant)

private static void
setupJavaSubclass(final ThreadContext context, final RubyClass subclass)

public static <T extends AccessibleObject & Member> boolean
trySetAccessible(T member)

Try to set the given member to be accessible, considering open modules and avoiding the actual setAccessible call when it would produce a JPMS warning.

public static Class<?>
public static IRubyObject
wrap(Ruby runtime, IRubyObject java_object)
Deprecated

public static IRubyObject
wrapJavaObject(Ruby runtime, Object object)
Deprecated since 10.0.

public static IRubyObject
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait