本文整理了Java中org.jruby.RubyModule.cannotRemoveError
方法的一些代码示例,展示了RubyModule.cannotRemoveError
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RubyModule.cannotRemoveError
方法的具体详情如下:
包路径:org.jruby.RubyModule
类名称:RubyModule
方法名:cannotRemoveError
暂无
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public IRubyObject removeClassVariable(String name) {
String javaName = validateClassVariable(name);
IRubyObject value;
if ((value = deleteClassVariable(javaName)) != null) {
return value;
}
if (isClassVarDefined(javaName)) {
throw cannotRemoveError(javaName);
}
throw getRuntime().newNameError("class variable " + javaName + " not defined for " + getName(), javaName);
}
代码示例来源:origin: org.jruby/jruby-complete
public IRubyObject removeClassVariable(String name) {
String javaName = validateClassVariable(name);
IRubyObject value;
if ((value = deleteClassVariable(javaName)) != null) {
return value;
}
if (isClassVarDefined(javaName)) {
throw cannotRemoveError(javaName);
}
throw getRuntime().newNameError("class variable " + javaName + " not defined for " + getName(), javaName);
}
代码示例来源:origin: org.jruby/jruby-core
public IRubyObject removeClassVariable(String name) {
String javaName = validateClassVariable(name);
IRubyObject value;
if ((value = deleteClassVariable(javaName)) != null) {
return value;
}
if (isClassVarDefined(javaName)) {
throw cannotRemoveError(javaName);
}
throw getRuntime().newNameError("class variable " + javaName + " not defined for " + getName(), javaName);
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
public IRubyObject removeClassVariable(String name) {
String javaName = validateClassVariable(name);
IRubyObject value;
if ((value = deleteClassVariable(javaName)) != null) {
return value;
}
if (isClassVarDefined(javaName)) {
throw cannotRemoveError(javaName);
}
throw getRuntime().newNameError("class variable " + javaName + " not defined for " + getName(), javaName);
}
代码示例来源:origin: org.jruby/jruby-complete
@JRubyMethod(name = "remove_const", required = 1, visibility = PRIVATE)
public IRubyObject remove_const(ThreadContext context, IRubyObject rubyName) {
String id = validateConstant(rubyName);
IRubyObject value = deleteConstant(id);
if (value != null) { // found it!
invalidateConstantCache(id);
if (value != UNDEF) return value;
// autoload entry
removeAutoload(id);
// FIXME: I'm not sure this is right, but the old code returned
// the undef, which definitely isn't right...
return context.nil;
}
if (hasConstantInHierarchy(id)) throw cannotRemoveError(id);
throw context.runtime.newNameError("constant " + id + " not defined for " + getName(), id);
}
代码示例来源:origin: org.jruby/jruby-core
@JRubyMethod(name = "remove_const", required = 1, visibility = PRIVATE)
public IRubyObject remove_const(ThreadContext context, IRubyObject rubyName) {
String id = validateConstant(rubyName);
IRubyObject value = deleteConstant(id);
if (value != null) { // found it!
invalidateConstantCache(id);
if (value != UNDEF) return value;
// autoload entry
removeAutoload(id);
// FIXME: I'm not sure this is right, but the old code returned
// the undef, which definitely isn't right...
return context.nil;
}
if (hasConstantInHierarchy(id)) throw cannotRemoveError(id);
throw context.runtime.newNameError("constant " + id + " not defined for " + getName(), id);
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
@JRubyMethod(name = "remove_const", required = 1, visibility = PRIVATE)
public IRubyObject remove_const(ThreadContext context, IRubyObject rubyName) {
String name = validateConstant(rubyName.asJavaString());
IRubyObject value;
if ((value = deleteConstant(name)) != null) {
invalidateConstantCache(name);
if (value != UNDEF) {
return value;
}
removeAutoload(name);
// FIXME: I'm not sure this is right, but the old code returned
// the undef, which definitely isn't right...
return context.runtime.getNil();
}
if (hasConstantInHierarchy(name)) {
throw cannotRemoveError(name);
}
throw context.runtime.newNameError("constant " + name + " not defined for " + getName(), name);
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
@JRubyMethod(name = "remove_const", required = 1, visibility = PRIVATE)
public IRubyObject remove_const(ThreadContext context, IRubyObject rubyName) {
String name = validateConstant(rubyName.asJavaString());
IRubyObject value;
if ((value = deleteConstant(name)) != null) {
invalidateConstantCache(name);
if (value != UNDEF) {
return value;
}
removeAutoload(name);
// FIXME: I'm not sure this is right, but the old code returned
// the undef, which definitely isn't right...
return context.runtime.getNil();
}
if (hasConstantInHierarchy(name)) {
throw cannotRemoveError(name);
}
throw context.runtime.newNameError("constant " + name + " not defined for " + getName(), name);
}
内容来源于网络,如有侵权,请联系作者删除!