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

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

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

RubyModule.getConstantAtSpecial介绍

[英]This version searches superclasses if we're starting with Object. This corresponds to logic in rb_const_defined_0 that recurses for Object only.
[中]如果我们从Object开始,这个版本会搜索超类。这对应于rb_const_defined_0中仅针对对象递归的逻辑。

代码示例

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

/** this method should be used only by interpreter or compiler 
 * 
 */
public RubyModule defineOrGetModuleUnder(String name) {
  // This method is intended only for defining new modules in Ruby code
  Ruby runtime = getRuntime();
  IRubyObject moduleObj = getConstantAtSpecial(name);
  RubyModule module;
  if (moduleObj != null) {
    if (!moduleObj.isModule()) throw runtime.newTypeError(name + " is not a module");
    module = (RubyModule)moduleObj;
  } else if (classProviders != null && (module = searchProvidersForModule(name)) != null) {
    // reopen a java module
  } else {
    module = RubyModule.newModule(runtime, name, this, true); 
  }
  return module;
}

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

/** this method should be used only by interpreter or compiler 
 * 
 */
public RubyModule defineOrGetModuleUnder(String name) {
  // This method is intended only for defining new modules in Ruby code
  Ruby runtime = getRuntime();
  IRubyObject moduleObj = getConstantAtSpecial(name);
  RubyModule module;
  if (moduleObj != null) {
    if (!moduleObj.isModule()) throw runtime.newTypeError(name + " is not a module");
    module = (RubyModule)moduleObj;
  } else if (classProviders != null && (module = searchProvidersForModule(name)) != null) {
    // reopen a java module
  } else {
    module = RubyModule.newModule(runtime, name, this, true); 
  }
  return module;
}

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

/** this method should be used only by interpreter or compiler
 *
 */
public RubyModule defineOrGetModuleUnder(String name) {
  // This method is intended only for defining new modules in Ruby code
  Ruby runtime = getRuntime();
  IRubyObject moduleObj = getConstantAtSpecial(name);
  RubyModule module;
  if (moduleObj != null) {
    if (!moduleObj.isModule()) throw runtime.newTypeError(str(runtime, ids(runtime, name), " is not a module"));
    module = (RubyModule)moduleObj;
  } else if ((module = searchProvidersForModule(name)) != null) {
    // reopen a java module
  } else {
    module = RubyModule.newModule(runtime, name, this, true);
  }
  return module;
}

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

/** this method should be used only by interpreter or compiler
 *
 */
public RubyModule defineOrGetModuleUnder(String name) {
  // This method is intended only for defining new modules in Ruby code
  Ruby runtime = getRuntime();
  IRubyObject moduleObj = getConstantAtSpecial(name);
  RubyModule module;
  if (moduleObj != null) {
    if (!moduleObj.isModule()) throw runtime.newTypeError(str(runtime, ids(runtime, name), " is not a module"));
    module = (RubyModule)moduleObj;
  } else if ((module = searchProvidersForModule(name)) != null) {
    // reopen a java module
  } else {
    module = RubyModule.newModule(runtime, name, this, true);
  }
  return module;
}

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

IRubyObject classObj = getConstantAtSpecial(name);
RubyClass clazz;

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

IRubyObject classObj = getConstantAtSpecial(name);
RubyClass clazz;

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

IRubyObject classObj = getConstantAtSpecial(name);
RubyClass clazz;

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

IRubyObject classObj = getConstantAtSpecial(name);
RubyClass clazz;

相关文章

微信公众号

最新文章

更多

RubyModule类方法