org.jruby.RubyClass.putMethod()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(19.2k)|赞(0)|评价(0)|浏览(65)

本文整理了Java中org.jruby.RubyClass.putMethod方法的一些代码示例,展示了RubyClass.putMethod的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RubyClass.putMethod方法的具体详情如下:
包路径:org.jruby.RubyClass
类名称:RubyClass
方法名:putMethod

RubyClass.putMethod介绍

暂无

代码示例

代码示例来源:origin: org.jruby/jruby-complete

public void populate(RubyModule cls, Class clazz) {
  JavaMethod javaMethod;
  DynamicMethod moduleMethod, aliasedMethod;
  RubyClass singletonClass = cls.getSingletonClass();
  Ruby runtime = cls.getRuntime();
  javaMethod = new org.jruby.ext.ffi.io.FileDescriptorIO$INVOKER$s$1$0$newInstance(singletonClass, Visibility.PUBLIC, "new");
  populateMethod(javaMethod, 1, "newInstance", true, false, org.jruby.ext.ffi.io.FileDescriptorIO.class, "newInstance", org.jruby.ext.ffi.io.FileDescriptorIO.class, CONTEXT_ARG2);
  aliasedMethod = singletonClass.putMethod(runtime, "new", javaMethod);
  javaMethod = new org.jruby.ext.ffi.io.FileDescriptorIO$INVOKER$s$1$0$wrap(singletonClass, Visibility.PUBLIC, "wrap");
  populateMethod(javaMethod, 1, "wrap", true, false, org.jruby.ext.ffi.io.FileDescriptorIO.class, "wrap", org.jruby.RubyIO.class, CONTEXT_ARG2);
  aliasedMethod = singletonClass.putMethod(runtime, "wrap", javaMethod);
  runtime.addBoundMethods("org.jruby.ext.ffi.io.FileDescriptorIO", "newInstance", "new", "wrap", "wrap");
}
static {

代码示例来源:origin: org.jruby/jruby-complete

public void populate(RubyModule cls, Class clazz) {
  JavaMethod javaMethod;
  DynamicMethod moduleMethod, aliasedMethod;
  RubyClass singletonClass = cls.getSingletonClass();
  Ruby runtime = cls.getRuntime();
  javaMethod = new org.jruby.ext.digest.RubyDigest$INVOKER$s$1$0$hexencode(singletonClass, Visibility.PUBLIC, "hexencode");
  populateMethod(javaMethod, 1, "hexencode", true, false, org.jruby.ext.digest.RubyDigest.class, "hexencode", org.jruby.RubyString.class, ARG2);
  aliasedMethod = singletonClass.putMethod(runtime, "hexencode", javaMethod);
  javaMethod = new org.jruby.ext.digest.RubyDigest$INVOKER$s$1$0$bubblebabble(singletonClass, Visibility.PUBLIC, "bubblebabble");
  populateMethod(javaMethod, 1, "bubblebabble", true, false, org.jruby.ext.digest.RubyDigest.class, "bubblebabble", org.jruby.RubyString.class, ARG2);
  aliasedMethod = singletonClass.putMethod(runtime, "bubblebabble", javaMethod);
  runtime.addBoundMethods("org.jruby.ext.digest.RubyDigest", "hexencode", "hexencode", "bubblebabble", "bubblebabble");
}
static {

代码示例来源:origin: org.jruby/jruby-complete

public void populate(RubyModule cls, Class clazz) {
  JavaMethod javaMethod;
  DynamicMethod moduleMethod, aliasedMethod;
  RubyClass singletonClass = cls.getSingletonClass();
  Ruby runtime = cls.getRuntime();
  javaMethod = new org.jruby.ext.ffi.jffi.JFFIInvoker$INVOKER$s$1$0$newInstance(singletonClass, Visibility.PUBLIC, "new");
  populateMethod(javaMethod, 1, "newInstance", true, false, org.jruby.ext.ffi.jffi.JFFIInvoker.class, "newInstance", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG1_ARY);
  aliasedMethod = singletonClass.putMethod(runtime, "new", javaMethod);
  runtime.addBoundMethods("org.jruby.ext.ffi.jffi.JFFIInvoker", "newInstance", "new");
}
static {

代码示例来源:origin: org.jruby/jruby-complete

public void populate(RubyModule cls, Class clazz) {
  JavaMethod javaMethod;
  DynamicMethod moduleMethod, aliasedMethod;
  RubyClass singletonClass = cls.getSingletonClass();
  Ruby runtime = cls.getRuntime();
  javaMethod = new org.jruby.ext.rbconfig.RbConfigLibrary$INVOKER$s$0$0$ruby(singletonClass, Visibility.PUBLIC, "ruby");
  populateMethod(javaMethod, 0, "ruby", true, false, org.jruby.ext.rbconfig.RbConfigLibrary.class, "ruby", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG1);
  aliasedMethod = singletonClass.putMethod(runtime, "ruby", javaMethod);
  runtime.addBoundMethods("org.jruby.ext.rbconfig.RbConfigLibrary", "ruby", "ruby");
}
static {

代码示例来源:origin: org.jruby/jruby-core

public void populate(RubyModule cls, Class clazz) {
  JavaMethod javaMethod;
  DynamicMethod moduleMethod, aliasedMethod;
  RubyClass singletonClass = cls.getSingletonClass();
  Ruby runtime = cls.getRuntime();
  javaMethod = new org.jruby.ext.ffi.jffi.JFFIInvoker$INVOKER$s$1$0$newInstance(singletonClass, Visibility.PUBLIC, "new");
  populateMethod(javaMethod, 1, "newInstance", true, false, org.jruby.ext.ffi.jffi.JFFIInvoker.class, "newInstance", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG1_ARY);
  aliasedMethod = singletonClass.putMethod(runtime, "new", javaMethod);
  runtime.addBoundMethods("org.jruby.ext.ffi.jffi.JFFIInvoker", "newInstance", "new");
}
static {

代码示例来源:origin: org.jruby/jruby-core

public void populate(RubyModule cls, Class clazz) {
  JavaMethod javaMethod;
  DynamicMethod moduleMethod, aliasedMethod;
  RubyClass singletonClass = cls.getSingletonClass();
  Ruby runtime = cls.getRuntime();
  javaMethod = new org.jruby.ext.rbconfig.RbConfigLibrary$INVOKER$s$0$0$ruby(singletonClass, Visibility.PUBLIC, "ruby");
  populateMethod(javaMethod, 0, "ruby", true, false, org.jruby.ext.rbconfig.RbConfigLibrary.class, "ruby", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG1);
  aliasedMethod = singletonClass.putMethod(runtime, "ruby", javaMethod);
  runtime.addBoundMethods("org.jruby.ext.rbconfig.RbConfigLibrary", "ruby", "ruby");
}
static {

代码示例来源:origin: org.jruby/jruby-core

public void populate(RubyModule cls, Class clazz) {
  JavaMethod javaMethod;
  DynamicMethod moduleMethod, aliasedMethod;
  RubyClass singletonClass = cls.getSingletonClass();
  Ruby runtime = cls.getRuntime();
  javaMethod = new org.jruby.ext.ffi.IOModule$INVOKER$s$3$0$native_read(cls, Visibility.PUBLIC, "native_read");
  populateMethod(javaMethod, 3, "native_read", true, false, org.jruby.ext.ffi.IOModule.class, "native_read", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG4);
  aliasedMethod = cls.putMethod(runtime, "native_read", javaMethod);
  moduleMethod = populateModuleMethod(cls, javaMethod);
  aliasedMethod = singletonClass.putMethod(runtime, "native_read", moduleMethod);
  runtime.addBoundMethods("org.jruby.ext.ffi.IOModule", "native_read", "native_read");
}
static {

代码示例来源:origin: org.jruby/jruby-complete

public void populate(RubyModule cls, Class clazz) {
  JavaMethod javaMethod;
  DynamicMethod moduleMethod, aliasedMethod;
  RubyClass singletonClass = cls.getSingletonClass();
  Ruby runtime = cls.getRuntime();
  javaMethod = new org.jruby.ext.pathname.RubyPathname$PathnameKernelMethods$INVOKER$s$1$0$newPathname(cls, Visibility.PRIVATE, "Pathname");
  populateMethod(javaMethod, 1, "newPathname", true, false, org.jruby.ext.pathname.RubyPathname.PathnameKernelMethods.class, "newPathname", org.jruby.runtime.builtin.IRubyObject.class, ARG2);
  aliasedMethod = cls.putMethod(runtime, "Pathname", javaMethod);
  moduleMethod = populateModuleMethod(cls, javaMethod);
  aliasedMethod = singletonClass.putMethod(runtime, "Pathname", moduleMethod);
  runtime.addBoundMethods("org.jruby.ext.pathname.RubyPathname.PathnameKernelMethods", "newPathname", "Pathname");
}
static {

代码示例来源:origin: org.jruby/jruby-complete

public void populate(RubyModule cls, Class clazz) {
  JavaMethod javaMethod;
  DynamicMethod moduleMethod, aliasedMethod;
  RubyClass singletonClass = cls.getSingletonClass();
  Ruby runtime = cls.getRuntime();
  javaMethod = new org.jruby.ext.socket.RubyTCPSocket$INVOKER$s$1$0$gethostbyname(singletonClass, Visibility.PUBLIC, "gethostbyname");
  populateMethod(javaMethod, 1, "gethostbyname", true, false, org.jruby.ext.socket.RubyTCPSocket.class, "gethostbyname", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG2);
  aliasedMethod = singletonClass.putMethod(runtime, "gethostbyname", javaMethod);
  javaMethod = new org.jruby.ext.socket.RubyTCPSocket$INVOKER$i$0$2$initialize(cls, Visibility.PRIVATE, "initialize");
  populateMethod(javaMethod, -1, "initialize", false, false, org.jruby.ext.socket.RubyTCPSocket.class, "initialize", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG0_ARY);
  aliasedMethod = cls.putMethod(runtime, "initialize", javaMethod);
  runtime.addBoundMethods("org.jruby.ext.socket.RubyTCPSocket", "gethostbyname", "gethostbyname", "initialize", "initialize");
}
static {

代码示例来源:origin: org.jruby/jruby-complete

public void populate(RubyModule cls, Class clazz) {
  JavaMethod javaMethod;
  DynamicMethod moduleMethod, aliasedMethod;
  RubyClass singletonClass = cls.getSingletonClass();
  Ruby runtime = cls.getRuntime();
  javaMethod = new org.jruby.ext.ffi.IOModule$INVOKER$s$3$0$native_read(cls, Visibility.PUBLIC, "native_read");
  populateMethod(javaMethod, 3, "native_read", true, false, org.jruby.ext.ffi.IOModule.class, "native_read", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG4);
  aliasedMethod = cls.putMethod(runtime, "native_read", javaMethod);
  moduleMethod = populateModuleMethod(cls, javaMethod);
  aliasedMethod = singletonClass.putMethod(runtime, "native_read", moduleMethod);
  runtime.addBoundMethods("org.jruby.ext.ffi.IOModule", "native_read", "native_read");
}
static {

代码示例来源:origin: org.jruby/jruby-core

public void populate(RubyModule cls, Class clazz) {
  JavaMethod javaMethod;
  DynamicMethod moduleMethod, aliasedMethod;
  RubyClass singletonClass = cls.getSingletonClass();
  Ruby runtime = cls.getRuntime();
  javaMethod = new org.jruby.ext.ffi.jffi.VariadicInvoker$INVOKER$s$0$1$newInstance(singletonClass, Visibility.PUBLIC, "new");
  populateMethod(javaMethod, -1, "newInstance", true, false, org.jruby.ext.ffi.jffi.VariadicInvoker.class, "newInstance", org.jruby.ext.ffi.jffi.VariadicInvoker.class, CONTEXT_ARG1_ARY);
  aliasedMethod = singletonClass.putMethod(runtime, "new", javaMethod);
  javaMethod = new org.jruby.ext.ffi.jffi.VariadicInvoker$INVOKER$i$2$0$invoke(cls, Visibility.PUBLIC, "invoke");
  populateMethod(javaMethod, 2, "invoke", false, false, org.jruby.ext.ffi.jffi.VariadicInvoker.class, "invoke", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG2);
  aliasedMethod = cls.putMethod(runtime, "invoke", javaMethod);
  runtime.addBoundMethods("org.jruby.ext.ffi.jffi.VariadicInvoker", "newInstance", "new", "invoke", "invoke");
}
static {

代码示例来源:origin: org.jruby/jruby-core

public void populate(RubyModule cls, Class clazz) {
  JavaMethod javaMethod;
  DynamicMethod moduleMethod, aliasedMethod;
  RubyClass singletonClass = cls.getSingletonClass();
  Ruby runtime = cls.getRuntime();
  javaMethod = new org.jruby.ext.jruby.CoreExt$String$INVOKER$s$0$0$unseeded_hash(cls, Visibility.PUBLIC, "unseeded_hash");
  populateMethod(javaMethod, 0, "unseeded_hash", true, false, org.jruby.ext.jruby.CoreExt.String.class, "unseeded_hash", org.jruby.RubyFixnum.class, CONTEXT_ARG1);
  aliasedMethod = cls.putMethod(runtime, "unseeded_hash", javaMethod);
  javaMethod = new org.jruby.ext.jruby.CoreExt$String$INVOKER$s$1$0$alloc(singletonClass, Visibility.PUBLIC, "alloc");
  populateMethod(javaMethod, 1, "alloc", true, false, org.jruby.ext.jruby.CoreExt.String.class, "alloc", org.jruby.RubyString.class, CONTEXT_ARG2);
  aliasedMethod = singletonClass.putMethod(runtime, "alloc", javaMethod);
  runtime.addBoundMethods("org.jruby.ext.jruby.CoreExt.String", "alloc", "alloc", "unseeded_hash", "unseeded_hash");
}
static {

代码示例来源:origin: org.jruby/jruby-core

public void populate(RubyModule cls, Class clazz) {
  JavaMethod javaMethod;
  DynamicMethod moduleMethod, aliasedMethod;
  RubyClass singletonClass = cls.getSingletonClass();
  Ruby runtime = cls.getRuntime();
  javaMethod = new org.jruby.ext.socket.RubyTCPSocket$INVOKER$s$1$0$gethostbyname(singletonClass, Visibility.PUBLIC, "gethostbyname");
  populateMethod(javaMethod, 1, "gethostbyname", true, false, org.jruby.ext.socket.RubyTCPSocket.class, "gethostbyname", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG2);
  aliasedMethod = singletonClass.putMethod(runtime, "gethostbyname", javaMethod);
  javaMethod = new org.jruby.ext.socket.RubyTCPSocket$INVOKER$i$0$2$initialize(cls, Visibility.PRIVATE, "initialize");
  populateMethod(javaMethod, -1, "initialize", false, false, org.jruby.ext.socket.RubyTCPSocket.class, "initialize", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG0_ARY);
  aliasedMethod = cls.putMethod(runtime, "initialize", javaMethod);
  runtime.addBoundMethods("org.jruby.ext.socket.RubyTCPSocket", "gethostbyname", "gethostbyname", "initialize", "initialize");
}
static {

代码示例来源:origin: org.jruby/jruby-complete

public void populate(RubyModule cls, Class clazz) {
  JavaMethod javaMethod;
  DynamicMethod moduleMethod, aliasedMethod;
  RubyClass singletonClass = cls.getSingletonClass();
  Ruby runtime = cls.getRuntime();
  javaMethod = new org.jruby.ext.bigdecimal.RubyBigDecimal$BigDecimalKernelMethods$INVOKER$s$newBigDecimal(cls, Visibility.PRIVATE, "BigDecimal");
  populateMethod(javaMethod, -1, "newBigDecimal", true, false, org.jruby.ext.bigdecimal.RubyBigDecimal.BigDecimalKernelMethods.class, "newBigDecimal", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG2);
  aliasedMethod = cls.putMethod(runtime, "BigDecimal", javaMethod);
  moduleMethod = populateModuleMethod(cls, javaMethod);
  aliasedMethod = singletonClass.putMethod(runtime, "BigDecimal", moduleMethod);
  runtime.addBoundMethods("org.jruby.ext.bigdecimal.RubyBigDecimal.BigDecimalKernelMethods", "newBigDecimal", "BigDecimal");
}
static {

代码示例来源:origin: org.jruby/jruby-complete

public void populate(RubyModule cls, Class clazz) {
  JavaMethod javaMethod;
  DynamicMethod moduleMethod, aliasedMethod;
  RubyClass singletonClass = cls.getSingletonClass();
  Ruby runtime = cls.getRuntime();
  javaMethod = new org.jruby.ext.timeout.Timeout$INVOKER$s$timeout(cls, Visibility.PUBLIC, "timeout");
  populateMethod(javaMethod, -1, "timeout", true, false, org.jruby.ext.timeout.Timeout.class, "timeout", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG2_BLOCK);
  aliasedMethod = cls.putMethod(runtime, "timeout", javaMethod);
  moduleMethod = populateModuleMethod(cls, javaMethod);
  aliasedMethod = singletonClass.putMethod(runtime, "timeout", moduleMethod);
  runtime.addBoundMethods("org.jruby.ext.timeout.Timeout", "timeout", "timeout");
}
static {

代码示例来源:origin: org.jruby/jruby-core

public void populate(RubyModule cls, Class clazz) {
  JavaMethod javaMethod;
  DynamicMethod moduleMethod, aliasedMethod;
  RubyClass singletonClass = cls.getSingletonClass();
  Ruby runtime = cls.getRuntime();
  javaMethod = new org.jruby.ext.bigdecimal.RubyBigDecimal$BigDecimalKernelMethods$INVOKER$s$newBigDecimal(cls, Visibility.PRIVATE, "BigDecimal");
  populateMethod(javaMethod, -1, "newBigDecimal", true, false, org.jruby.ext.bigdecimal.RubyBigDecimal.BigDecimalKernelMethods.class, "newBigDecimal", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG2);
  aliasedMethod = cls.putMethod(runtime, "BigDecimal", javaMethod);
  moduleMethod = populateModuleMethod(cls, javaMethod);
  aliasedMethod = singletonClass.putMethod(runtime, "BigDecimal", moduleMethod);
  runtime.addBoundMethods("org.jruby.ext.bigdecimal.RubyBigDecimal.BigDecimalKernelMethods", "newBigDecimal", "BigDecimal");
}
static {

代码示例来源:origin: org.jruby/jruby-complete

public void populate(RubyModule cls, Class clazz) {
  JavaMethod javaMethod;
  DynamicMethod moduleMethod, aliasedMethod;
  RubyClass singletonClass = cls.getSingletonClass();
  Ruby runtime = cls.getRuntime();
  javaMethod = new org.jruby.ext.jruby.CoreExt$String$INVOKER$s$0$0$unseeded_hash(cls, Visibility.PUBLIC, "unseeded_hash");
  populateMethod(javaMethod, 0, "unseeded_hash", true, false, org.jruby.ext.jruby.CoreExt.String.class, "unseeded_hash", org.jruby.RubyFixnum.class, CONTEXT_ARG1);
  aliasedMethod = cls.putMethod(runtime, "unseeded_hash", javaMethod);
  javaMethod = new org.jruby.ext.jruby.CoreExt$String$INVOKER$s$1$0$alloc(singletonClass, Visibility.PUBLIC, "alloc");
  populateMethod(javaMethod, 1, "alloc", true, false, org.jruby.ext.jruby.CoreExt.String.class, "alloc", org.jruby.RubyString.class, CONTEXT_ARG2);
  aliasedMethod = singletonClass.putMethod(runtime, "alloc", javaMethod);
  runtime.addBoundMethods("org.jruby.ext.jruby.CoreExt.String", "alloc", "alloc", "unseeded_hash", "unseeded_hash");
}
static {

代码示例来源:origin: org.jruby/jruby-complete

public void populate(RubyModule cls, Class clazz) {
  JavaMethod javaMethod;
  DynamicMethod moduleMethod, aliasedMethod;
  RubyClass singletonClass = cls.getSingletonClass();
  Ruby runtime = cls.getRuntime();
  javaMethod = new org.jruby.ext.set.RubySortedSet$INVOKER$s$0$0$create(singletonClass, Visibility.PUBLIC, "[]");
  populateMethod(javaMethod, -1, "create", true, false, org.jruby.ext.set.RubySortedSet.class, "create", org.jruby.ext.set.RubySortedSet.class, CONTEXT_ARG1_ARY);
  aliasedMethod = singletonClass.putMethod(runtime, "[]", javaMethod);
  javaMethod = new org.jruby.ext.set.RubySortedSet$INVOKER$i$0$0$sort(cls, Visibility.PUBLIC, "sort");
  populateMethod(javaMethod, 0, "sort", false, false, org.jruby.ext.set.RubySortedSet.class, "sort", org.jruby.RubyArray.class, CONTEXT_ARG0);
  aliasedMethod = cls.putMethod(runtime, "sort", javaMethod);
  runtime.addBoundMethods("org.jruby.ext.set.RubySortedSet", "create", "[]", "sort", "sort");
}
static {

代码示例来源:origin: org.jruby/jruby-core

public void populate(RubyModule cls, Class clazz) {
  JavaMethod javaMethod;
  DynamicMethod moduleMethod, aliasedMethod;
  RubyClass singletonClass = cls.getSingletonClass();
  Ruby runtime = cls.getRuntime();
  javaMethod = new org.jruby.ext.pathname.RubyPathname$PathnameKernelMethods$INVOKER$s$1$0$newPathname(cls, Visibility.PRIVATE, "Pathname");
  populateMethod(javaMethod, 1, "newPathname", true, false, org.jruby.ext.pathname.RubyPathname.PathnameKernelMethods.class, "newPathname", org.jruby.runtime.builtin.IRubyObject.class, ARG2);
  aliasedMethod = cls.putMethod(runtime, "Pathname", javaMethod);
  moduleMethod = populateModuleMethod(cls, javaMethod);
  aliasedMethod = singletonClass.putMethod(runtime, "Pathname", moduleMethod);
  runtime.addBoundMethods("org.jruby.ext.pathname.RubyPathname.PathnameKernelMethods", "newPathname", "Pathname");
}
static {

代码示例来源:origin: org.jruby/jruby-core

public void populate(RubyModule cls, Class clazz) {
  JavaMethod javaMethod;
  DynamicMethod moduleMethod, aliasedMethod;
  RubyClass singletonClass = cls.getSingletonClass();
  Ruby runtime = cls.getRuntime();
  javaMethod = new org.jruby.ext.timeout.Timeout$INVOKER$s$timeout(cls, Visibility.PUBLIC, "timeout");
  populateMethod(javaMethod, -1, "timeout", true, false, org.jruby.ext.timeout.Timeout.class, "timeout", org.jruby.runtime.builtin.IRubyObject.class, CONTEXT_ARG2_BLOCK);
  aliasedMethod = cls.putMethod(runtime, "timeout", javaMethod);
  moduleMethod = populateModuleMethod(cls, javaMethod);
  aliasedMethod = singletonClass.putMethod(runtime, "timeout", moduleMethod);
  runtime.addBoundMethods("org.jruby.ext.timeout.Timeout", "timeout", "timeout");
}
static {

相关文章

微信公众号

最新文章

更多

RubyClass类方法