Refine search
/** * Wrap the given object as in Java integration and return the wrapper. This * version uses ObjectProxyCache to guarantee the same wrapper is returned * as long as it is in use somewhere. */ @JRubyMethod(module = true, name = {"reference", "ref"}) public static IRubyObject reference(ThreadContext context, IRubyObject recv, IRubyObject obj) { return Java.getInstance(context.runtime, obj, false); }
/** * Wrap the given object as in Java integration and return the wrapper. This * version uses ObjectProxyCache to guarantee the same wrapper is returned * as long as it is in use somewhere. */ @JRubyMethod(module = true) public static IRubyObject reference(ThreadContext context, IRubyObject recv, IRubyObject obj) { Ruby runtime = context.runtime; return Java.getInstance(runtime, obj, false); }
/** * Wrap the given object as in Java integration and return the wrapper. This * version uses ObjectProxyCache to guarantee the same wrapper is returned * as long as it is in use somewhere. */ @JRubyMethod(module = true) public static IRubyObject reference(ThreadContext context, IRubyObject recv, IRubyObject obj) { Ruby runtime = context.runtime; return Java.getInstance(runtime, obj, false); }
/** * Wrap the given object as in Java integration and return the wrapper. This * version uses ObjectProxyCache to guarantee the same wrapper is returned * as long as it is in use somewhere. */ @JRubyMethod(module = true, name = {"reference", "ref"}) public static IRubyObject reference(ThreadContext context, IRubyObject recv, IRubyObject obj) { return Java.getInstance(context.runtime, obj, false); }
@JRubyMethod public IRubyObject annotations() { // note: intentionally returning the actual array returned from Java, rather // than wrapping it in a RubyArray. wave of the future, when java_class will // return the actual class, rather than a JavaClass wrapper. return Java.getInstance(getRuntime(), javaClass().getAnnotations()); }
@JRubyMethod public IRubyObject declared_annotations() { // see note above re: return type return Java.getInstance(getRuntime(), javaClass().getDeclaredAnnotations()); }
@JRubyMethod public IRubyObject annotations() { // note: intentionally returning the actual array returned from Java, rather // than wrapping it in a RubyArray. wave of the future, when java_class will // return the actual class, rather than a JavaClass wrapper. return Java.getInstance(getRuntime(), javaClass().getAnnotations()); }
@JRubyMethod public IRubyObject annotations() { // note: intentionally returning the actual array returned from Java, rather // than wrapping it in a RubyArray. wave of the future, when java_class will // return the actual class, rather than a JavaClass wrapper. return Java.getInstance(getRuntime(), javaClass().getAnnotations()); }
@JRubyMethod(name = "package") public IRubyObject get_package() { return Java.getInstance(getRuntime(), javaClass().getPackage()); }
@JRubyMethod public IRubyObject declared_annotations() { // see note above re: return type return Java.getInstance(getRuntime(), javaClass().getDeclaredAnnotations()); }
@JRubyMethod public IRubyObject annotations() { // note: intentionally returning the actual array returned from Java, rather // than wrapping it in a RubyArray. wave of the future, when java_class will // return the actual class, rather than a JavaClass wrapper. return Java.getInstance(getRuntime(), javaClass().getAnnotations()); }
@JRubyMethod public IRubyObject declared_annotations() { // see note above re: return type return Java.getInstance(getRuntime(), javaClass().getDeclaredAnnotations()); }
@JRubyMethod public IRubyObject generic_interfaces() { return Java.getInstance(getRuntime(), javaClass().getGenericInterfaces()); }
@JRubyMethod public IRubyObject generic_superclass() { return Java.getInstance(getRuntime(), javaClass().getGenericSuperclass()); }
@JRubyMethod public static IRubyObject to_java_string(ThreadContext context, IRubyObject self) { return Java.getInstance(context.runtime, self.convertToString().asJavaString()); } }
@JRubyMethod public static IRubyObject to_java_string(ThreadContext context, IRubyObject self) { return Java.getInstance(context.runtime, self.convertToString().asJavaString()); } }
@JRubyMethod public static IRubyObject to_java_string(ThreadContext context, IRubyObject self) { return Java.getInstance(context.runtime, self.convertToString().asJavaString()); } }
@JRubyMethod public IRubyObject generic_exception_types() { return Java.getInstance(getRuntime(), getGenericExceptionTypes()); }
@JRubyMethod public static IRubyObject to_java_string(ThreadContext context, IRubyObject self) { return Java.getInstance(context.runtime, self.convertToString().asJavaString()); } }
@JRubyMethod(name = { "first", "ruby_first" }) // #first ext like with array: [1, 2, 3].first(2) == [1, 2] public static IRubyObject first(final ThreadContext context, final IRubyObject self, final IRubyObject count) { final java.util.List list = unwrapIfJavaObject(self); int len = count.convertToInteger().getIntValue(); int size = list.size(); if ( len > size ) len = size; return Java.getInstance(context.runtime, list.subList(0, len)); }