本文整理了Java中org.jruby.RubyModule.isInstance
方法的一些代码示例,展示了RubyModule.isInstance
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RubyModule.isInstance
方法的具体详情如下:
包路径:org.jruby.RubyModule
类名称:RubyModule
方法名:isInstance
暂无
代码示例来源:origin: org.jruby/jruby-core
public boolean isKindOf(IRubyObject value, RubyModule rubyModule) {
return rubyModule.isInstance(value);
}
代码示例来源:origin: org.jruby/jruby-complete
public boolean isKindOf(IRubyObject value, RubyModule rubyModule) {
return rubyModule.isInstance(value);
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public boolean isKindOf(IRubyObject value, RubyModule rubyModule) {
return rubyModule.isInstance(value);
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
public boolean isKindOf(IRubyObject value, RubyModule rubyModule) {
return rubyModule.isInstance(value);
}
代码示例来源:origin: org.jruby/jruby-core
/**
* Determine whether the given object can safely invoke protected methods on
* the class this method is bound to.
*
* @param caller The calling object
* @return true if the calling object can call protected methods; false
* otherwise
*/
private boolean protectedAccessOk(IRubyObject caller) {
return getProtectedClass().isInstance(caller);
}
代码示例来源:origin: org.jruby/jruby-complete
/**
* Determine whether the given object can safely invoke protected methods on
* the class this method is bound to.
*
* @param caller The calling object
* @return true if the calling object can call protected methods; false
* otherwise
*/
private boolean protectedAccessOk(IRubyObject caller) {
return getProtectedClass().isInstance(caller);
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
/**
* Determine whether the given object can safely invoke protected methods on
* the class this method is bound to.
*
* @param caller The calling object
* @return true if the calling object can call protected methods; false
* otherwise
*/
private boolean protectedAccessOk(IRubyObject caller) {
return getProtectedClass().isInstance(caller);
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
/**
* Determine whether the given object can safely invoke protected methods on
* the class this method is bound to.
*
* @param caller The calling object
* @return true if the calling object can call protected methods; false
* otherwise
*/
private boolean protectedAccessOk(IRubyObject caller) {
return getProtectedClass().isInstance(caller);
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public Object apply(IRubyObject arg1) {
if (rubyClass.isInstance(arg1)) {
if (arg1 instanceof IncludedModuleWrapper ||
(arg1 instanceof RubyClass && ((RubyClass)arg1).isSingleton())) {
// do nothing for included wrappers or singleton classes
} else {
count[0]++;
modules.add(arg1); // store the module to avoid concurrent modification exceptions
}
}
return null;
}
});
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
public Object apply(IRubyObject arg1) {
if (rubyClass.isInstance(arg1)) {
if (arg1 instanceof IncludedModuleWrapper ||
(arg1 instanceof RubyClass && ((RubyClass)arg1).isSingleton())) {
// do nothing for included wrappers or singleton classes
} else {
count[0]++;
modules.add(arg1); // store the module to avoid concurrent modification exceptions
}
}
return null;
}
});
代码示例来源:origin: org.jruby/jruby-core
/** rb_mod_eqq
*
*/
@JRubyMethod(name = "===", required = 1)
@Override
public RubyBoolean op_eqq(ThreadContext context, IRubyObject obj) {
return context.runtime.newBoolean(isInstance(obj));
}
代码示例来源:origin: org.jruby/jruby-complete
/** rb_mod_eqq
*
*/
@JRubyMethod(name = "===", required = 1)
@Override
public RubyBoolean op_eqq(ThreadContext context, IRubyObject obj) {
return context.runtime.newBoolean(isInstance(obj));
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
/** rb_mod_eqq
*
*/
@JRubyMethod(name = "===", required = 1)
@Override
public RubyBoolean op_eqq(ThreadContext context, IRubyObject obj) {
return context.runtime.newBoolean(isInstance(obj));
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
/** rb_mod_eqq
*
*/
@JRubyMethod(name = "===", required = 1)
@Override
public RubyBoolean op_eqq(ThreadContext context, IRubyObject obj) {
return context.runtime.newBoolean(isInstance(obj));
}
代码示例来源:origin: org.jruby/jruby-complete
private static RubyModule getConstantFromPath(Ruby runtime, String path) {
final RubyModule value;
try {
value = runtime.getClassFromPath(path);
}
catch (RaiseException e) {
if ( runtime.getModule("NameError").isInstance(e.getException()) ) {
throw runtime.newArgumentError("undefined class/module " + path);
}
throw e;
}
return value;
}
代码示例来源:origin: org.jruby/jruby-core
private static RubyModule getConstantFromPath(Ruby runtime, String path) {
final RubyModule value;
try {
value = runtime.getClassFromPath(path);
}
catch (RaiseException e) {
if ( runtime.getModule("NameError").isInstance(e.getException()) ) {
throw runtime.newArgumentError("undefined class/module " + path);
}
throw e;
}
return value;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
private RubyClass findClass(String className) {
RubyModule classInstance;
try {
classInstance = runtime.getClassFromPath(className);
} catch (RaiseException e) {
if (runtime.getModule("NameError").isInstance(e.getException())) {
throw runtime.newArgumentError("undefined class/module " + className);
}
throw e;
}
if (! (classInstance instanceof RubyClass)) {
throw runtime.newArgumentError(className + " does not refer class"); // sic
}
return (RubyClass) classInstance;
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
private RubyClass findClass(String className) {
RubyModule classInstance;
try {
classInstance = runtime.getClassFromPath(className);
} catch (RaiseException e) {
if (runtime.getModule("NameError").isInstance(e.getException())) {
throw runtime.newArgumentError("undefined class/module " + className);
}
throw e;
}
if (! (classInstance instanceof RubyClass)) {
throw runtime.newArgumentError(className + " does not refer class"); // sic
}
return (RubyClass) classInstance;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
private IRubyObject defaultObjectUnmarshal() throws IOException {
RubySymbol className = (RubySymbol) unmarshalObject(false);
RubyClass type = null;
try {
type = getClassFromPath(runtime, className.toString());
} catch (RaiseException e) {
if (runtime.getModule("NameError").isInstance(e.getException())) {
throw runtime.newArgumentError("undefined class/module " + className.asJavaString());
}
throw e;
}
assert type != null : "type shouldn't be null.";
IRubyObject result = (IRubyObject)type.unmarshal(this);
return result;
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
private IRubyObject defaultObjectUnmarshal() throws IOException {
RubySymbol className = (RubySymbol) unmarshalObject(false);
RubyClass type = null;
try {
type = getClassFromPath(runtime, className.toString());
} catch (RaiseException e) {
if (runtime.getModule("NameError").isInstance(e.getException())) {
throw runtime.newArgumentError("undefined class/module " + className.asJavaString());
}
throw e;
}
assert type != null : "type shouldn't be null.";
IRubyObject result = (IRubyObject)type.unmarshal(this);
return result;
}
内容来源于网络,如有侵权,请联系作者删除!