org.jruby.RubyModule.getClass()方法的使用及代码示例

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

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

RubyModule.getClass介绍

[英]Finds a class that is within the current module (or class).
[中]查找当前模块(或类)中的类。

代码示例

代码示例来源:origin: asciidoctor/asciidoctorj

public Parser(Ruby runtime, StructuralNode parent, Reader reader) {
  super(runtime.getModule("Asciidoctor").getClass("Parser"));
  this.reader = reader;
  this.parent = parent;
}

代码示例来源:origin: org.asciidoctor/asciidoctorj

public Parser(Ruby runtime, StructuralNode parent, Reader reader) {
  super(runtime.getModule("Asciidoctor").getClass("Parser"));
  this.reader = reader;
  this.parent = parent;
}

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

StructByValue(Ruby runtime, RubyClass structClass, StructLayout structLayout) {
  super(runtime, runtime.getModule("FFI").getClass("Type").getClass("Struct"),
      NativeType.STRUCT, structLayout.size, structLayout.alignment);
  this.structClass = structClass;
  this.structLayout = structLayout;
}

代码示例来源:origin: asciidoctor/asciidoctorj

private RubyClass getConverterFactory() {
  return rubyRuntime.getModule("Asciidoctor")
    .defineOrGetModuleUnder("Converter")
    .getClass("Factory");
}

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

public Symbol(Ruby runtime, DynamicLibrary library, String name, MemoryIO io) {
  super(runtime, runtime.getModule("FFI").getClass("DynamicLibrary").getClass("Symbol"),
      io, Long.MAX_VALUE);
  this.library = library;
  this.name = name;
}

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

JFFIInvoker(Ruby runtime, long address, Type returnType, Type[] parameterTypes, CallingConvention convention) {
  this(runtime, runtime.getModule("FFI").getClass("Invoker"),
      new CodeMemoryIO(runtime, address),
      returnType, parameterTypes, convention, null);
}

代码示例来源:origin: org.asciidoctor/asciidoctorj

private RubyClass getConverterFactory() {
  return rubyRuntime.getModule("Asciidoctor")
    .defineOrGetModuleUnder("Converter")
    .getClass("Factory");
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

StructByValue(Ruby runtime, RubyClass structClass, StructLayout structLayout) {
  super(runtime, runtime.getModule("FFI").getClass("Type").getClass("Struct"),
      NativeType.STRUCT, structLayout.size, structLayout.alignment);
  this.structClass = structClass;
  this.structLayout = structLayout;
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

public Symbol(Ruby runtime, DynamicLibrary library, String name, MemoryIO io) {
  super(runtime, runtime.getModule("FFI").getClass("DynamicLibrary").getClass("Symbol"),
      io, Long.MAX_VALUE);
  this.library = library;
  this.name = name;
}

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

StructByValue(Ruby runtime, RubyClass structClass, StructLayout structLayout) {
  super(runtime, runtime.getModule("FFI").getClass("Type").getClass("Struct"),
      NativeType.STRUCT, structLayout.size, structLayout.alignment);
  this.structClass = structClass;
  this.structLayout = structLayout;
}

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

JFFIInvoker(Ruby runtime, long address, Type returnType, Type[] parameterTypes, CallingConvention convention) {
  this(runtime, runtime.getModule("FFI").getClass("Invoker"),
      new CodeMemoryIO(runtime, address),
      returnType, parameterTypes, convention, null);
}

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

public NativeCallbackFactory(Ruby runtime, CallbackInfo cbInfo) {
  this.runtime = runtime;
  this.closureInfo = newFunctionInfo(runtime, cbInfo);
  this.closurePool = com.kenai.jffi.ClosureManager.getInstance().getClosurePool(closureInfo.callContext);
  this.callbackInfo = cbInfo;
  this.callbackClass = runtime.getModule("FFI").getClass("Callback");
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

final Type checkType(IRubyObject type) {
  if (!(type instanceof Type)) {
    throw getRuntime().newTypeError(type, getRuntime().getModule("FFI").getClass("Type"));
  }
  return (Type) type;
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

private Enum(Ruby runtime, RubyClass klass) {
  super(runtime, klass);
  nativeType = runtime.getModule("FFI").getClass("Type").getConstant("INT");
  kv_map = RubyHash.newHash(runtime);
  tag = runtime.getNil();
}

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

final Type checkType(IRubyObject type) {
  if (!(type instanceof Type)) {
    throw getRuntime().newTypeError(type, getRuntime().getModule("FFI").getClass("Type"));
  }
  return (Type) type;
}

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

final Type checkType(IRubyObject type) {
  if (!(type instanceof Type)) {
    throw getRuntime().newTypeError(type, getRuntime().getModule("FFI").getClass("Type"));
  }
  return (Type) type;
}

代码示例来源:origin: asciidoctor/asciidoctorj

static ReaderImpl createReader(Ruby runtime, List<String> lines) {
  RubyArray rubyLines = runtime.newArray(lines.size());
  for (String line : lines) {
    rubyLines.add(runtime.newString(line));
  }
  RubyClass readerClass = runtime.getModule("Asciidoctor").getClass("Reader");
  return new ReaderImpl(readerClass.callMethod("new", rubyLines));
}

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

@Override
  @JRubyMethod(name="initialize", visibility = PRIVATE, required = 3, optional = 1)
  public final IRubyObject initialize(ThreadContext context, IRubyObject[] args) {
    
    IRubyObject type = args[2];
    if (!(type instanceof CallbackInfo)) {
      throw context.runtime.newTypeError(type, context.runtime.getModule("FFI").getClass("Type").getClass("Function"));
    }
    init(args, FunctionFieldIO.INSTANCE);
    return this;
  }
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

@Override
  @JRubyMethod(name="initialize", visibility = PRIVATE, required = 3, optional = 1)
  public final IRubyObject initialize(ThreadContext context, IRubyObject[] args) {
    
    IRubyObject type = args[2];
    if (!(type instanceof CallbackInfo)) {
      throw context.runtime.newTypeError(type, context.runtime.getModule("FFI").getClass("Type").getClass("Function"));
    }
    init(args, FunctionFieldIO.INSTANCE);
    return this;
  }
}

代码示例来源:origin: org.asciidoctor/asciidoctorj

static ReaderImpl createReader(Ruby runtime, List<String> lines) {
  RubyArray rubyLines = runtime.newArray(lines.size());
  for (String line : lines) {
    rubyLines.add(runtime.newString(line));
  }
  RubyClass readerClass = runtime.getModule("Asciidoctor").getClass("Reader");
  return new ReaderImpl(readerClass.callMethod("new", rubyLines));
}

相关文章

微信公众号

最新文章

更多

RubyModule类方法