本文整理了Java中org.jruby.RubyClass.reifyWithAncestors
方法的一些代码示例,展示了RubyClass.reifyWithAncestors
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RubyClass.reifyWithAncestors
方法的具体详情如下:
包路径:org.jruby.RubyClass
类名称:RubyClass
方法名:reifyWithAncestors
[英]Reify this class, first reifying all its ancestors. This causes the reified class and all ancestors' reified classes to come into existence, so any future changes will not be reflected. This form also accepts a string argument indicating a path in which to dump the intermediate reified class bytes.
[中]具体化这个类,首先具体化它的所有祖先。这导致物化类和所有祖先的物化类得以存在,因此任何未来的变化都不会被反映出来。此表单还接受一个字符串参数,该参数指示转储中间具体化类字节的路径。
代码示例来源:origin: org.jruby/jruby-complete
public void reifyWithAncestors() {
reifyWithAncestors(null, true);
}
public void reifyWithAncestors(String classDumpDir) {
代码示例来源:origin: org.jruby/jruby-complete
public void reifyWithAncestors(boolean useChildLoader) {
reifyWithAncestors(null, useChildLoader);
}
代码示例来源:origin: org.jruby/jruby-core
public void reifyWithAncestors() {
reifyWithAncestors(null, true);
}
public void reifyWithAncestors(String classDumpDir) {
代码示例来源:origin: org.jruby/jruby-core
public void reifyWithAncestors(String classDumpDir) {
reifyWithAncestors(classDumpDir, true);
}
public void reifyWithAncestors(boolean useChildLoader) {
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
public void reifyWithAncestors() {
reifyWithAncestors(null, true);
}
public void reifyWithAncestors(String classDumpDir) {
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
public void reifyWithAncestors(boolean useChildLoader) {
reifyWithAncestors(null, useChildLoader);
}
代码示例来源:origin: org.jruby/jruby-complete
public void reifyWithAncestors(String classDumpDir) {
reifyWithAncestors(classDumpDir, true);
}
public void reifyWithAncestors(boolean useChildLoader) {
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public void reifyWithAncestors() {
reifyWithAncestors(null, true);
}
public void reifyWithAncestors(String classDumpDir) {
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public void reifyWithAncestors(String classDumpDir) {
reifyWithAncestors(classDumpDir, true);
}
public void reifyWithAncestors(boolean useChildLoader) {
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
public void reifyWithAncestors(String classDumpDir) {
reifyWithAncestors(classDumpDir, true);
}
public void reifyWithAncestors(boolean useChildLoader) {
代码示例来源:origin: org.jruby/jruby-core
public void reifyWithAncestors(boolean useChildLoader) {
reifyWithAncestors(null, useChildLoader);
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public void reifyWithAncestors(boolean useChildLoader) {
reifyWithAncestors(null, useChildLoader);
}
代码示例来源:origin: org.jruby/jruby-complete
@Override
public IRubyObject allocate(Ruby runtime, RubyClass klass) {
klass.reifyWithAncestors();
return klass.allocate();
}
};
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public IRubyObject allocate(Ruby runtime, RubyClass klass) {
klass.reifyWithAncestors();
return klass.allocate();
}
};
代码示例来源:origin: org.jruby/jruby-core
@Override
public IRubyObject allocate(Ruby runtime, RubyClass klass) {
klass.reifyWithAncestors();
return klass.allocate();
}
};
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
public IRubyObject allocate(Ruby runtime, RubyClass klass) {
klass.reifyWithAncestors();
return klass.allocate();
}
};
代码示例来源:origin: org.jruby/jruby-complete
private static IRubyObject becomeJava(final ThreadContext context, final RubyClass klass,
final String dumpDir, final boolean useChildLoader) {
klass.reifyWithAncestors(dumpDir, useChildLoader);
final Class<?> reifiedClass = klass.getReifiedClass();
generateFieldAccessors(context, klass, reifiedClass);
return asJavaClass(context.runtime, reifiedClass);
}
代码示例来源:origin: org.jruby/jruby-core
private static IRubyObject becomeJava(final ThreadContext context, final RubyClass klass,
final String dumpDir, final boolean useChildLoader) {
klass.reifyWithAncestors(dumpDir, useChildLoader);
final Class<?> reifiedClass = klass.getReifiedClass();
generateFieldAccessors(context, klass, reifiedClass);
return asJavaClass(context.runtime, reifiedClass);
}
代码示例来源:origin: org.jruby/jruby-complete
@Override
public <T> T toJava(Class<T> target) {
if (target == Class.class) {
if (reifiedClass == null) reifyWithAncestors(); // possibly auto-reify
// Class requested; try java_class or else return nearest reified class
final ThreadContext context = getRuntime().getCurrentContext();
IRubyObject javaClass = JavaClass.java_class(context, this);
if ( ! javaClass.isNil() ) return javaClass.toJava(target);
Class reifiedClass = nearestReifiedClass(this);
if ( reifiedClass != null ) return target.cast(reifiedClass);
// should never fall through, since RubyObject has a reified class
}
if (target.isAssignableFrom(RubyClass.class)) {
// they're asking for something RubyClass extends, give them that
return target.cast(this);
}
return defaultToJava(target);
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
/**
* Reify this class, first reifying all its ancestors. This causes the
* reified class and all ancestors' reified classes to come into existence,
* so any future changes will not be reflected.
*
* This form also accepts a string argument indicating a path in which to dump
* the intermediate reified class bytes.
*
* @param classDumpDir the path in which to dump reified class bytes
* @param useChildLoader whether to load the class into its own child classloader
*/
public void reifyWithAncestors(String classDumpDir, boolean useChildLoader) {
if (isReifiable()) {
RubyClass realSuper = getSuperClass().getRealClass();
if (realSuper.reifiedClass == null) realSuper.reifyWithAncestors(classDumpDir, useChildLoader);
reify(classDumpDir, useChildLoader);
}
}
内容来源于网络,如有侵权,请联系作者删除!