本文整理了Java中org.jruby.RubyModule.putMethod
方法的一些代码示例,展示了RubyModule.putMethod
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RubyModule.putMethod
方法的具体详情如下:
包路径:org.jruby.RubyModule
类名称:RubyModule
方法名:putMethod
暂无
代码示例来源:origin: org.jruby/jruby-complete
/**
* This method is not intended for use by normal users; it is a fast-path
* method that skips synchronization and hierarchy invalidation to speed
* boot-time method definition.
*
* @param id The name to which to bind the method
* @param method The method to bind
* @deprecated No longer used, internal API!
*/
public final void addMethodAtBootTimeOnly(String id, DynamicMethod method) {
putMethod(getRuntime(), id, method);
}
代码示例来源:origin: org.jruby/jruby-core
public void populate(RubyModule cls, Class clazz) {
JavaMethod javaMethod;
DynamicMethod moduleMethod, aliasedMethod;
Ruby runtime = cls.getRuntime();
javaMethod = new org.jruby.RubyContinuation$INVOKER$i$0$0$call(cls, Visibility.PUBLIC, "call");
populateMethod(javaMethod, -1, "call", false, false, org.jruby.RubyContinuation.class, "call", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG0_ARY);
aliasedMethod = cls.putMethod(runtime, "call", javaMethod);
cls.putMethod(runtime, "[]", javaMethod);
runtime.addBoundMethods("org.jruby.RubyContinuation", "call", "call");
}
static {
代码示例来源:origin: org.jruby/jruby-complete
public void populate(RubyModule cls, Class clazz) {
JavaMethod javaMethod;
DynamicMethod moduleMethod, aliasedMethod;
Ruby runtime = cls.getRuntime();
javaMethod = new org.jruby.RubyContinuation$INVOKER$i$0$0$call(cls, Visibility.PUBLIC, "call");
populateMethod(javaMethod, -1, "call", false, false, org.jruby.RubyContinuation.class, "call", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG0_ARY);
aliasedMethod = cls.putMethod(runtime, "call", javaMethod);
cls.putMethod(runtime, "[]", javaMethod);
runtime.addBoundMethods("org.jruby.RubyContinuation", "call", "call");
}
static {
代码示例来源:origin: org.jruby/jruby-complete
/**
* @note Internal API - only public as its used by generated code!
* @param id
* @param method
* @param oldName
*/ // NOTE: used by AnnotationBinder
public void putAlias(String id, DynamicMethod method, String oldName) {
if (id.equals(oldName)) return;
putMethod(getRuntime(), id, new AliasMethod(this, method, oldName));
}
代码示例来源:origin: org.jruby/jruby-complete
public void populate(RubyModule cls, Class clazz) {
JavaMethod javaMethod;
DynamicMethod moduleMethod, aliasedMethod;
Ruby runtime = cls.getRuntime();
javaMethod = new org.jruby.RubyStopIteration$INVOKER$i$0$0$result(cls, Visibility.PUBLIC, "result");
populateMethod(javaMethod, 0, "result", false, false, org.jruby.RubyStopIteration.class, "result", org.jruby.runtime.builtin.IRubyObject.class, ARG0);
aliasedMethod = cls.putMethod(runtime, "result", javaMethod);
runtime.addBoundMethods("org.jruby.RubyStopIteration", "result", "result");
}
static {
代码示例来源:origin: org.jruby/jruby-complete
public void populate(RubyModule cls, Class clazz) {
JavaMethod javaMethod;
DynamicMethod moduleMethod, aliasedMethod;
Ruby runtime = cls.getRuntime();
javaMethod = new org.jruby.ext.set.EnumerableExt$INVOKER$s$0$0$to_set(cls, Visibility.PUBLIC, "to_set");
populateMethod(javaMethod, -1, "to_set", true, false, org.jruby.ext.set.EnumerableExt.class, "to_set", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG1_ARY_BLOCK);
aliasedMethod = cls.putMethod(runtime, "to_set", javaMethod);
runtime.addBoundMethods("org.jruby.ext.set.EnumerableExt", "to_set", "to_set");
}
static {
代码示例来源:origin: org.jruby/jruby-core
public void populate(RubyModule cls, Class clazz) {
JavaMethod javaMethod;
DynamicMethod moduleMethod, aliasedMethod;
Ruby runtime = cls.getRuntime();
javaMethod = new org.jruby.javasupport.Java$ByteArrayProxyMethods$INVOKER$s$0$0$to_s(cls, Visibility.PUBLIC, "to_s");
populateMethod(javaMethod, 0, "to_s", true, false, org.jruby.javasupport.Java.ByteArrayProxyMethods.class, "to_s", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG1);
aliasedMethod = cls.putMethod(runtime, "to_s", javaMethod);
runtime.addBoundMethods("org.jruby.javasupport.Java.ByteArrayProxyMethods", "to_s", "to_s");
}
static {
代码示例来源:origin: org.jruby/jruby-core
public void populate(RubyModule cls, Class clazz) {
JavaMethod javaMethod;
DynamicMethod moduleMethod, aliasedMethod;
Ruby runtime = cls.getRuntime();
javaMethod = new org.jruby.ext.set.EnumerableExt$INVOKER$s$0$0$to_set(cls, Visibility.PUBLIC, "to_set");
populateMethod(javaMethod, -1, "to_set", true, false, org.jruby.ext.set.EnumerableExt.class, "to_set", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG1_ARY_BLOCK);
aliasedMethod = cls.putMethod(runtime, "to_set", javaMethod);
runtime.addBoundMethods("org.jruby.ext.set.EnumerableExt", "to_set", "to_set");
}
static {
代码示例来源:origin: org.jruby/jruby-core
public void populate(RubyModule cls, Class clazz) {
JavaMethod javaMethod;
DynamicMethod moduleMethod, aliasedMethod;
Ruby runtime = cls.getRuntime();
javaMethod = new org.jruby.javasupport.Java$OldStyleExtensionInherited$INVOKER$s$1$0$inherited(cls, Visibility.PUBLIC, "inherited");
populateMethod(javaMethod, 1, "inherited", true, false, org.jruby.javasupport.Java.OldStyleExtensionInherited.class, "inherited", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG2);
aliasedMethod = cls.putMethod(runtime, "inherited", javaMethod);
runtime.addBoundMethods("org.jruby.javasupport.Java.OldStyleExtensionInherited", "inherited", "inherited");
}
static {
代码示例来源:origin: org.jruby/jruby-complete
public void populate(RubyModule cls, Class clazz) {
JavaMethod javaMethod;
DynamicMethod moduleMethod, aliasedMethod;
Ruby runtime = cls.getRuntime();
javaMethod = new org.jruby.RubyBoolean$INVOKER$i$0$0$hash(cls, Visibility.PUBLIC, "hash");
populateMethod(javaMethod, 0, "hash", false, false, org.jruby.RubyBoolean.class, "hash", org.jruby.RubyFixnum.class, CONTEXT_ARG0);
aliasedMethod = cls.putMethod(runtime, "hash", javaMethod);
runtime.addBoundMethods("org.jruby.RubyBoolean", "hash", "hash");
}
static {
代码示例来源:origin: org.jruby/jruby-complete
public void populate(RubyModule cls, Class clazz) {
JavaMethod javaMethod;
DynamicMethod moduleMethod, aliasedMethod;
Ruby runtime = cls.getRuntime();
javaMethod = new org.jruby.ext.net.protocol.NetProtocolBufferedIO$INVOKER$s$1$0$initialize(cls, Visibility.PRIVATE, "initialize");
populateMethod(javaMethod, 1, "initialize", true, false, org.jruby.ext.net.protocol.NetProtocolBufferedIO.class, "initialize", org.jruby.runtime.builtin.IRubyObject.class, ARG2);
aliasedMethod = cls.putMethod(runtime, "initialize", javaMethod);
runtime.addBoundMethods("org.jruby.ext.net.protocol.NetProtocolBufferedIO", "initialize", "initialize");
}
static {
代码示例来源:origin: org.jruby/jruby-complete
public void populate(RubyModule cls, Class clazz) {
JavaMethod javaMethod;
DynamicMethod moduleMethod, aliasedMethod;
Ruby runtime = cls.getRuntime();
javaMethod = new org.jruby.ext.net.protocol.NetProtocolBufferedIO$NativeImpl$INVOKER$s$0$0$rbuf_fill(cls, Visibility.PUBLIC, "rbuf_fill");
populateMethod(javaMethod, 0, "rbuf_fill", true, false, org.jruby.ext.net.protocol.NetProtocolBufferedIO.NativeImpl.class, "rbuf_fill", org.jruby.runtime.builtin.IRubyObject.class, ARG1);
aliasedMethod = cls.putMethod(runtime, "rbuf_fill", javaMethod);
runtime.addBoundMethods("org.jruby.ext.net.protocol.NetProtocolBufferedIO.NativeImpl", "rbuf_fill", "rbuf_fill");
}
static {
代码示例来源:origin: org.jruby/jruby-complete
public void populate(RubyModule cls, Class clazz) {
JavaMethod javaMethod;
DynamicMethod moduleMethod, aliasedMethod;
Ruby runtime = cls.getRuntime();
javaMethod = new org.jruby.ext.ffi.AbstractInvoker$INVOKER$i$2$0$attach(cls, Visibility.PUBLIC, "attach");
populateMethod(javaMethod, 2, "attach", false, false, org.jruby.ext.ffi.AbstractInvoker.class, "attach", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG2);
aliasedMethod = cls.putMethod(runtime, "attach", javaMethod);
runtime.addBoundMethods("org.jruby.ext.ffi.AbstractInvoker", "attach", "attach");
}
static {
代码示例来源:origin: org.jruby/jruby-complete
public void populate(RubyModule cls, Class clazz) {
JavaMethod javaMethod;
DynamicMethod moduleMethod, aliasedMethod;
Ruby runtime = cls.getRuntime();
javaMethod = new org.jruby.javasupport.Java$ByteArrayProxyMethods$INVOKER$s$0$0$to_s(cls, Visibility.PUBLIC, "to_s");
populateMethod(javaMethod, 0, "to_s", true, false, org.jruby.javasupport.Java.ByteArrayProxyMethods.class, "to_s", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG1);
aliasedMethod = cls.putMethod(runtime, "to_s", javaMethod);
runtime.addBoundMethods("org.jruby.javasupport.Java.ByteArrayProxyMethods", "to_s", "to_s");
}
static {
代码示例来源:origin: org.jruby/jruby-complete
public void populate(RubyModule cls, Class clazz) {
JavaMethod javaMethod;
DynamicMethod moduleMethod, aliasedMethod;
Ruby runtime = cls.getRuntime();
javaMethod = new org.jruby.ext.ffi.StructLayout$ArrayField$INVOKER$i$0$1$initialize(cls, Visibility.PRIVATE, "initialize");
populateMethod(javaMethod, -1, "initialize", false, false, org.jruby.ext.ffi.StructLayout.ArrayField.class, "initialize", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG0_ARY);
aliasedMethod = cls.putMethod(runtime, "initialize", javaMethod);
runtime.addBoundMethods("org.jruby.ext.ffi.StructLayout.ArrayField", "initialize", "initialize");
}
static {
代码示例来源:origin: org.jruby/jruby-complete
public void populate(RubyModule cls, Class clazz) {
JavaMethod javaMethod;
DynamicMethod moduleMethod, aliasedMethod;
Ruby runtime = cls.getRuntime();
javaMethod = new org.jruby.javasupport.ext.JavaUtil$Iterator$INVOKER$s$0$0$each(cls, Visibility.PUBLIC, "each");
populateMethod(javaMethod, 0, "each", true, false, org.jruby.javasupport.ext.JavaUtil.Iterator.class, "each", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG1_BLOCK);
aliasedMethod = cls.putMethod(runtime, "each", javaMethod);
runtime.addBoundMethods("org.jruby.javasupport.ext.JavaUtil.Iterator", "each", "each");
}
static {
代码示例来源:origin: org.jruby/jruby-complete
public void populate(RubyModule cls, Class clazz) {
JavaMethod javaMethod;
DynamicMethod moduleMethod, aliasedMethod;
Ruby runtime = cls.getRuntime();
javaMethod = new org.jruby.javasupport.ext.JavaUtil$Enumeration$INVOKER$s$0$0$each(cls, Visibility.PUBLIC, "each");
populateMethod(javaMethod, 0, "each", true, false, org.jruby.javasupport.ext.JavaUtil.Enumeration.class, "each", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG1_BLOCK);
aliasedMethod = cls.putMethod(runtime, "each", javaMethod);
runtime.addBoundMethods("org.jruby.javasupport.ext.JavaUtil.Enumeration", "each", "each");
}
static {
代码示例来源:origin: org.jruby/jruby-complete
public void populate(RubyModule cls, Class clazz) {
JavaMethod javaMethod;
DynamicMethod moduleMethod, aliasedMethod;
Ruby runtime = cls.getRuntime();
javaMethod = new org.jruby.javasupport.ext.JavaLang$Comparable$INVOKER$s$1$0$cmp(cls, Visibility.PUBLIC, "<=>");
populateMethod(javaMethod, 1, "cmp", true, false, org.jruby.javasupport.ext.JavaLang.Comparable.class, "cmp", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG2);
aliasedMethod = cls.putMethod(runtime, "<=>", javaMethod);
runtime.addBoundMethods("org.jruby.javasupport.ext.JavaLang.Comparable", "cmp", "<=>");
}
static {
代码示例来源:origin: org.jruby/jruby-complete
public void populate(RubyModule cls, Class clazz) {
JavaMethod javaMethod;
DynamicMethod moduleMethod, aliasedMethod;
Ruby runtime = cls.getRuntime();
javaMethod = new org.jruby.ext.ffi.StructLayout$CharArrayProxy$INVOKER$i$0$0$to_s(cls, Visibility.PUBLIC, "to_s");
populateMethod(javaMethod, 0, "to_s", false, false, org.jruby.ext.ffi.StructLayout.CharArrayProxy.class, "to_s", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG0);
aliasedMethod = cls.putMethod(runtime, "to_s", javaMethod);
runtime.addBoundMethods("org.jruby.ext.ffi.StructLayout.CharArrayProxy", "to_s", "to_s");
}
static {
代码示例来源:origin: org.jruby/jruby-complete
public final void addMethodInternal(String name, DynamicMethod method) {
synchronized (methodLocation.getMethodsForWrite()) {
putMethod(getRuntime(), name, method);
invalidateCoreClasses();
invalidateCacheDescendants();
}
}