本文整理了Java中org.jruby.RubyClass.getAncestorList
方法的一些代码示例,展示了RubyClass.getAncestorList
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RubyClass.getAncestorList
方法的具体详情如下:
包路径:org.jruby.RubyClass
类名称:RubyClass
方法名:getAncestorList
暂无
代码示例来源:origin: org.jruby/jruby-complete
private int pendingInterruptCheckMask(ThreadContext context, IRubyObject err) {
List<IRubyObject> ancestors = err.getMetaClass().getAncestorList();
int ancestorsLen = ancestors.size();
List<RubyHash> maskStack = interruptMaskStack;
int maskStackLen = maskStack.size();
for (int i = 0; i < maskStackLen; i++) {
RubyHash mask = maskStack.get(maskStackLen - (i + 1));
for (int j = 0; j < ancestorsLen; j++) {
IRubyObject klass = ancestors.get(j);
IRubyObject sym;
if (!(sym = mask.op_aref(context, klass)).isNil()) {
String symStr = sym.toString();
switch (symStr) {
case "immediate": return INTERRUPT_IMMEDIATE;
case "on_blocking": return INTERRUPT_ON_BLOCKING;
case "never": return INTERRUPT_NEVER;
default:
throw context.runtime.newThreadError("unknown mask signature");
}
}
}
}
return INTERRUPT_NONE;
}
代码示例来源:origin: org.jruby/jruby-core
private int pendingInterruptCheckMask(ThreadContext context, IRubyObject err) {
List<IRubyObject> ancestors = err.getMetaClass().getAncestorList();
int ancestorsLen = ancestors.size();
List<RubyHash> maskStack = interruptMaskStack;
int maskStackLen = maskStack.size();
for (int i = 0; i < maskStackLen; i++) {
RubyHash mask = maskStack.get(maskStackLen - (i + 1));
for (int j = 0; j < ancestorsLen; j++) {
IRubyObject klass = ancestors.get(j);
IRubyObject sym;
if (!(sym = mask.op_aref(context, klass)).isNil()) {
String symStr = sym.toString();
switch (symStr) {
case "immediate": return INTERRUPT_IMMEDIATE;
case "on_blocking": return INTERRUPT_ON_BLOCKING;
case "never": return INTERRUPT_NEVER;
default:
throw context.runtime.newThreadError("unknown mask signature");
}
}
}
}
return INTERRUPT_NONE;
}
代码示例来源:origin: org.jenkins-ci/jruby-xstream
/**
* Invokes all the defined read_completed methods.
*/
/*package*/ static void callReadCompleted(IRubyObject o) {
Ruby runtime = o.getRuntime();
RubySymbol read_completed = runtime.newSymbol("read_completed");
List<IRubyObject> ancestors = o.getType().getAncestorList();
for (int i = ancestors.size() - 1; i >= 0; i--) {
RubyModule t= (RubyModule) ancestors.get(i);
if (t.callMethod("method_defined?", read_completed).isTrue() || t.callMethod("private_method_defined?", read_completed).isTrue()) {
ThreadContext c = runtime.getCurrentContext();
IRubyObject m = t.callMethod("instance_method", read_completed);
m.callMethod(c,"bind",o).callMethod(c, "call");
}
}
}
代码示例来源:origin: org.jruby/jruby-complete
for ( IRubyObject ancestorObject: clazz.getAncestorList() ) {
RubyModule ancestor = (RubyModule) ancestorObject;
if (ancestor instanceof RubyClass) {
代码示例来源:origin: org.jruby/jruby-core
for ( IRubyObject ancestorObject: clazz.getAncestorList() ) {
RubyModule ancestor = (RubyModule) ancestorObject;
if (ancestor instanceof RubyClass) {
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
List<Class<?>> interfaceList = new ArrayList<Class<?>>();
List<IRubyObject> ancestors = clazz.getAncestorList();
boolean skipRemainingClasses = false;
for (IRubyObject ancestorObject: ancestors) {
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
List<Class<?>> interfaceList = new ArrayList<Class<?>>();
List<IRubyObject> ancestors = clazz.getAncestorList();
boolean skipRemainingClasses = false;
for (IRubyObject ancestorObject: ancestors) {
内容来源于网络,如有侵权,请联系作者删除!