本文整理了Java中org.jruby.RubyModule.deepMethodSearch
方法的一些代码示例,展示了RubyModule.deepMethodSearch
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RubyModule.deepMethodSearch
方法的具体详情如下:
包路径:org.jruby.RubyModule
类名称:RubyModule
方法名:deepMethodSearch
暂无
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
private DynamicMethod searchForAliasMethod(Ruby runtime, String name) {
// JRUBY-2435: Aliasing eval and other "special" methods should display a warning
// We warn because we treat certain method names as "special" for purposes of
// optimization. Hopefully this will be enough to convince people not to alias
// them.
if (SCOPE_CAPTURING_METHODS.contains(name)) {
runtime.getWarnings().warn("`" + name + "' should not be aliased");
}
return deepMethodSearch(name, runtime);
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
private DynamicMethod searchForAliasMethod(Ruby runtime, String name) {
// JRUBY-2435: Aliasing eval and other "special" methods should display a warning
// We warn because we treat certain method names as "special" for purposes of
// optimization. Hopefully this will be enough to convince people not to alias
// them.
if (SCOPE_CAPTURING_METHODS.contains(name)) {
runtime.getWarnings().warn("`" + name + "' should not be aliased");
}
return deepMethodSearch(name, runtime);
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
/** rb_mod_modfunc
*
*/
@JRubyMethod(name = "module_function", rest = true, visibility = PRIVATE, writes = VISIBILITY)
public RubyModule module_function(ThreadContext context, IRubyObject[] args) {
Ruby runtime = context.runtime;
if (args.length == 0) {
context.setCurrentVisibility(MODULE_FUNCTION);
} else {
setMethodVisibility(args, PRIVATE);
for (int i = 0; i < args.length; i++) {
String name = args[i].asJavaString().intern();
DynamicMethod method = deepMethodSearch(name, runtime);
getSingletonClass().addMethod(name, new WrapperMethod(getSingletonClass(), method, PUBLIC));
callMethod(context, "singleton_method_added", context.runtime.fastNewSymbol(name));
}
}
return this;
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
/** rb_mod_modfunc
*
*/
@JRubyMethod(name = "module_function", rest = true, visibility = PRIVATE, writes = VISIBILITY)
public RubyModule module_function(ThreadContext context, IRubyObject[] args) {
Ruby runtime = context.runtime;
if (args.length == 0) {
context.setCurrentVisibility(MODULE_FUNCTION);
} else {
setMethodVisibility(args, PRIVATE);
for (int i = 0; i < args.length; i++) {
String name = args[i].asJavaString().intern();
DynamicMethod method = deepMethodSearch(name, runtime);
getSingletonClass().addMethod(name, new WrapperMethod(getSingletonClass(), method, PUBLIC));
callMethod(context, "singleton_method_added", context.runtime.fastNewSymbol(name));
}
}
return this;
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
/** rb_export_method
*
*/
public void exportMethod(String name, Visibility visibility) {
Ruby runtime = getRuntime();
DynamicMethod method = deepMethodSearch(name, runtime);
if (method.getVisibility() != visibility) {
if (this == method.getImplementationClass()) {
method.setVisibility(visibility);
} else {
// FIXME: Why was this using a FullFunctionCallbackMethod before that did callSuper?
addMethod(name, new WrapperMethod(this, method, visibility));
}
invalidateCoreClasses();
invalidateCacheDescendants();
}
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
/** rb_export_method
*
*/
public void exportMethod(String name, Visibility visibility) {
Ruby runtime = getRuntime();
DynamicMethod method = deepMethodSearch(name, runtime);
if (method.getVisibility() != visibility) {
if (this == method.getImplementationClass()) {
method.setVisibility(visibility);
} else {
// FIXME: Why was this using a FullFunctionCallbackMethod before that did callSuper?
addMethod(name, new WrapperMethod(this, method, visibility));
}
invalidateCoreClasses();
invalidateCacheDescendants();
}
}
代码示例来源:origin: org.jruby/jruby-core
/** rb_export_method
*
*/
public void exportMethod(String name, Visibility visibility) {
Ruby runtime = getRuntime();
DynamicMethod method = deepMethodSearch(name, runtime);
if (method.getVisibility() != visibility) {
if (this == method.getImplementationClass()) {
method.setVisibility(visibility);
} else {
DynamicMethod newMethod = new PartialDelegatingMethod(this, method, visibility);
methodLocation.addMethod(name, newMethod);
}
invalidateCoreClasses();
invalidateCacheDescendants();
}
}
代码示例来源:origin: org.jruby/jruby-complete
/** rb_export_method
*
*/
public void exportMethod(String name, Visibility visibility) {
Ruby runtime = getRuntime();
DynamicMethod method = deepMethodSearch(name, runtime);
if (method.getVisibility() != visibility) {
if (this == method.getImplementationClass()) {
method.setVisibility(visibility);
} else {
DynamicMethod newMethod = new PartialDelegatingMethod(this, method, visibility);
methodLocation.addMethod(name, newMethod);
}
invalidateCoreClasses();
invalidateCacheDescendants();
}
}
代码示例来源:origin: org.jruby/jruby-complete
private DynamicMethod searchForAliasMethod(Ruby runtime, String id) {
DynamicMethod method = deepMethodSearch(id, runtime);
代码示例来源:origin: org.jruby/jruby-core
private DynamicMethod searchForAliasMethod(Ruby runtime, String id) {
DynamicMethod method = deepMethodSearch(id, runtime);
代码示例来源:origin: org.jruby/jruby-core
/** rb_mod_modfunc
*
*/
@JRubyMethod(name = "module_function", rest = true, visibility = PRIVATE, writes = VISIBILITY)
public RubyModule module_function(ThreadContext context, IRubyObject[] args) {
Ruby runtime = context.runtime;
if (!isModule()) {
throw context.runtime.newTypeError("module_function must be called for modules");
}
if (args.length == 0) {
context.setCurrentVisibility(MODULE_FUNCTION);
} else {
setMethodVisibility(args, PRIVATE);
for (int i = 0; i < args.length; i++) {
RubySymbol name = TypeConverter.checkID(args[i]);
DynamicMethod method = deepMethodSearch(name.idString(), runtime);
DynamicMethod newMethod = method.dup();
newMethod.setImplementationClass(getSingletonClass());
newMethod.setVisibility(PUBLIC);
getSingletonClass().addMethod(name.idString(), newMethod);
callMethod(context, "singleton_method_added", name);
}
}
return this;
}
代码示例来源:origin: org.jruby/jruby-complete
/** rb_mod_modfunc
*
*/
@JRubyMethod(name = "module_function", rest = true, visibility = PRIVATE, writes = VISIBILITY)
public RubyModule module_function(ThreadContext context, IRubyObject[] args) {
Ruby runtime = context.runtime;
if (!isModule()) {
throw context.runtime.newTypeError("module_function must be called for modules");
}
if (args.length == 0) {
context.setCurrentVisibility(MODULE_FUNCTION);
} else {
setMethodVisibility(args, PRIVATE);
for (int i = 0; i < args.length; i++) {
RubySymbol name = TypeConverter.checkID(args[i]);
DynamicMethod method = deepMethodSearch(name.idString(), runtime);
DynamicMethod newMethod = method.dup();
newMethod.setImplementationClass(getSingletonClass());
newMethod.setVisibility(PUBLIC);
getSingletonClass().addMethod(name.idString(), newMethod);
callMethod(context, "singleton_method_added", name);
}
}
return this;
}
内容来源于网络,如有侵权,请联系作者删除!