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

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

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

RubyModule.getNonIncludedClass介绍

暂无

代码示例

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

public RubyModule getRubyClass() {
  assert parentIndex != -1 : "Trying to get RubyClass from empty stack";
  RubyModule parentModule = parentStack[parentIndex];
  return parentModule.getNonIncludedClass();
}

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

public RubyModule getPreviousRubyClass() {
  assert parentIndex != 0 : "Trying to get RubyClass from too-shallow stack";
  RubyModule parentModule = parentStack[parentIndex - 1];
  return parentModule.getNonIncludedClass();
}

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

public RubyModule getRubyClass() {
  assert parentIndex != -1 : "Trying to get RubyClass from empty stack";
  RubyModule parentModule = parentStack[parentIndex];
  return parentModule.getNonIncludedClass();
}

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

public RubyModule getPreviousRubyClass() {
  assert parentIndex != 0 : "Trying to get RubyClass from too-shallow stack";
  RubyModule parentModule = parentStack[parentIndex - 1];
  return parentModule.getNonIncludedClass();
}

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

private void checkForCyclicInclude(RubyModule m) throws RaiseException {
  if (getNonIncludedClass() == m.getNonIncludedClass()) {
    throw getRuntime().newArgumentError("cyclic include detected");
  }
}

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

public boolean hasModuleInPrepends(RubyModule type) {
  for (RubyModule module = this; module != methodLocation; module = module.getSuperClass()) {
    if (type == module.getNonIncludedClass()) return true;
  }
  return false;
}

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

public boolean hasModuleInHierarchy(RubyModule type) {
  // XXX: This check previously used callMethod("==") to check for equality between classes
  // when scanning the hierarchy. However the == check may be safe; we should only ever have
  // one instance bound to a given type/constant. If it's found to be unsafe, examine ways
  // to avoid the == call.
  for (RubyModule module = this; module != null; module = module.getSuperClass()) {
    if (module.getNonIncludedClass() == type) return true;
  }
  return false;
}

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

public boolean hasModuleInPrepends(RubyModule type) {
  for (RubyModule module = this; module != methodLocation; module = module.getSuperClass()) {
    if (type == module.getNonIncludedClass()) return true;
  }
  return false;
}

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

public boolean hasModuleInHierarchy(RubyModule type) {
  // XXX: This check previously used callMethod("==") to check for equality between classes
  // when scanning the hierarchy. However the == check may be safe; we should only ever have
  // one instance bound to a given type/constant. If it's found to be unsafe, examine ways
  // to avoid the == call.
  for (RubyModule module = this; module != null; module = module.getSuperClass()) {
    if (module.getNonIncludedClass() == type) return true;
  }
  return false;
}

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

public boolean hasModuleInHierarchy(RubyModule type) {
  // XXX: This check previously used callMethod("==") to check for equality between classes
  // when scanning the hierarchy. However the == check may be safe; we should only ever have
  // one instance bound to a given type/constant. If it's found to be unsafe, examine ways
  // to avoid the == call.
  for (RubyModule module = this; module != null; module = module.getSuperClass()) {
    if (module.getNonIncludedClass() == type) return true;
  }
  return false;
}

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

private void checkForCyclicInclude(RubyModule m) throws RaiseException {
  if (getNonIncludedClass() == m.getNonIncludedClass()) {
    throw getRuntime().newArgumentError("cyclic include detected");
  }
}

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

public List<IRubyObject> getAncestorList() {
  ArrayList<IRubyObject> list = new ArrayList<IRubyObject>();
  for (RubyModule module = this; module != null; module = module.getSuperClass()) {
    // FIXME this is silly. figure out how to delegate the getNonIncludedClass()
    // call to drop the getDelegate().
    if (module.methodLocation == module) list.add(module.getDelegate().getNonIncludedClass());
  }
  return list;
}

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

public List<IRubyObject> getAncestorList() {
  ArrayList<IRubyObject> list = new ArrayList<IRubyObject>();
  for (RubyModule module = this; module != null; module = module.getSuperClass()) {
    // FIXME this is silly. figure out how to delegate the getNonIncludedClass()
    // call to drop the getDelegate().
    if (module.methodLocation == module) list.add(module.getDelegate().getNonIncludedClass());
  }
  return list;
}

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

private RubyClass getAlreadyActivatedRefinementWrapper(RubyClass classWeAreRefining, RubyModule refinement) {
  // We have already encountered at least one refine on this class.  Return that wrapper.
  RubyClass moduleWrapperForRefinement = activatedRefinements.get(classWeAreRefining);
  if (moduleWrapperForRefinement == null) return classWeAreRefining;
  for (RubyModule c = moduleWrapperForRefinement; c != null && c.isIncluded(); c = c.getSuperClass()) {
    if (c.getNonIncludedClass() == refinement) return null;
  }
  return moduleWrapperForRefinement;
}

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

private RubyClass getAlreadyActivatedRefinementWrapper(RubyClass classWeAreRefining, RubyModule refinement) {
  // We have already encountered at least one refine on this class.  Return that wrapper.
  RubyClass moduleWrapperForRefinement = activatedRefinements.get(classWeAreRefining);
  if (moduleWrapperForRefinement == null) return classWeAreRefining;
  for (RubyModule c = moduleWrapperForRefinement; c != null && c.isIncluded(); c = c.getSuperClass()) {
    if (c.getNonIncludedClass() == refinement) return null;
  }
  return moduleWrapperForRefinement;
}

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

protected void checkForCyclicPrepend(RubyModule m) throws RaiseException {
  if (getNonIncludedClass() == m.getNonIncludedClass()) {
    throw getRuntime().newArgumentError(getName() + " cyclic prepend detected " + m.getName());
  }
}

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

/**
 * Actually proceed with prepending the specified module below the given target
 * in a hierarchy. Return the new module wrapper.
 *
 * @param insertBelow The hierarchy target below which to include the wrapped module
 * @param moduleToPrepend The module to wrap and prepend
 * @return The new module wrapper resulting from this prepend
 */
private RubyModule proceedWithPrepend(RubyModule insertBelow, RubyModule moduleToPrepend) {
  if (!moduleToPrepend.isPrepended()) moduleToPrepend = moduleToPrepend.getNonIncludedClass();
  return proceedWithInclude(insertBelow, moduleToPrepend);
}

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

/**
 * Is the given class a wrapper for the specified module?
 * 
 * @param theClass The class to inspect
 * @param theModule The module we're looking for
 * @return true if the class is a wrapper for the module, false otherwise
 */
private boolean doesTheClassWrapTheModule(RubyClass theClass, RubyModule theModule) {
  return theClass.isIncluded() &&
      theClass.getNonIncludedClass() == theModule.getNonIncludedClass();
}

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

protected void checkForCyclicPrepend(RubyModule m) throws RaiseException {
  if (getNonIncludedClass() == m.getNonIncludedClass()) {
    throw getRuntime().newArgumentError(getName() + " cyclic prepend detected " + m.getName());
  }
}

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

/**
 * Actually proceed with prepending the specified module below the given target
 * in a hierarchy. Return the new module wrapper.
 *
 * @param insertBelow The hierarchy target below which to include the wrapped module
 * @param moduleToPrepend The module to wrap and prepend
 * @return The new module wrapper resulting from this prepend
 */
private RubyModule proceedWithPrepend(RubyModule insertBelow, RubyModule moduleToPrepend) {
  if (!moduleToPrepend.isPrepended()) moduleToPrepend = moduleToPrepend.getNonIncludedClass();
  return proceedWithInclude(insertBelow, moduleToPrepend);
}

相关文章

微信公众号

最新文章

更多

RubyModule类方法