本文整理了Java中org.jruby.RubyModule.getNonIncludedClass
方法的一些代码示例,展示了RubyModule.getNonIncludedClass
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RubyModule.getNonIncludedClass
方法的具体详情如下:
包路径:org.jruby.RubyModule
类名称: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);
}
内容来源于网络,如有侵权,请联系作者删除!