本文整理了Java中org.jruby.Ruby.newSecurityError
方法的一些代码示例,展示了Ruby.newSecurityError
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ruby.newSecurityError
方法的具体详情如下:
包路径:org.jruby.Ruby
类名称:Ruby
方法名:newSecurityError
暂无
代码示例来源:origin: org.jruby/jruby-core
public IRubyObject allocate(Ruby runtime, RubyClass klazz) {
try {
return (IRubyObject) method.invoke(null, runtime, klazz);
} catch (InvocationTargetException ite) {
throw runtime.newTypeError("could not allocate " + clazz + " with (Ruby, RubyClass) constructor:\n" + ite);
} catch (IllegalAccessException iae) {
throw runtime.newSecurityError("could not allocate " + clazz + " due to inaccessible (Ruby, RubyClass) constructor:\n" + iae);
}
}
};
代码示例来源:origin: org.jruby/jruby-complete
public IRubyObject allocate(Ruby runtime, RubyClass klazz) {
try {
return (IRubyObject) method.invoke(null, runtime, klazz);
} catch (InvocationTargetException ite) {
throw runtime.newTypeError("could not allocate " + clazz + " with (Ruby, RubyClass) constructor:\n" + ite);
} catch (IllegalAccessException iae) {
throw runtime.newSecurityError("could not allocate " + clazz + " due to inaccessible (Ruby, RubyClass) constructor:\n" + iae);
}
}
};
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public IRubyObject allocate(Ruby runtime, RubyClass klazz) {
try {
return (IRubyObject)method.invoke(null, runtime, klazz);
} catch (InvocationTargetException ite) {
throw runtime.newTypeError("could not allocate " + cls + " with (Ruby, RubyClass) constructor:\n" + ite);
} catch (IllegalAccessException iae) {
throw runtime.newSecurityError("could not allocate " + cls + " due to inaccessible (Ruby, RubyClass) constructor:\n" + iae);
}
}
};
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
public IRubyObject allocate(Ruby runtime, RubyClass klazz) {
try {
return (IRubyObject)method.invoke(null, runtime, klazz);
} catch (InvocationTargetException ite) {
throw runtime.newTypeError("could not allocate " + cls + " with (Ruby, RubyClass) constructor:\n" + ite);
} catch (IllegalAccessException iae) {
throw runtime.newSecurityError("could not allocate " + cls + " due to inaccessible (Ruby, RubyClass) constructor:\n" + iae);
}
}
};
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
@Override
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg) {
try {
field.set(null, arg.toJava(field.getType()));
} catch (IllegalAccessException iae) {
throw context.runtime.newSecurityError(iae.getMessage());
} catch (IllegalArgumentException iae) {
throw context.runtime.newTypeError(iae.getMessage());
}
return arg;
}
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
@Override
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg) {
try {
field.set(null, arg.toJava(field.getType()));
} catch (IllegalAccessException iae) {
throw context.runtime.newSecurityError(iae.getMessage());
} catch (IllegalArgumentException iae) {
throw context.runtime.newTypeError(iae.getMessage());
}
return arg;
}
}
代码示例来源:origin: org.jruby/jruby-complete
public IRubyObject allocate(Ruby runtime, RubyClass klazz) {
try {
RubyBasicObject object = (RubyBasicObject)cls.newInstance();
object.setMetaClass(klazz);
return object;
} catch (InstantiationException ie) {
throw runtime.newTypeError("could not allocate " + cls + " with default constructor:\n" + ie);
} catch (IllegalAccessException iae) {
throw runtime.newSecurityError("could not allocate " + cls + " due to inaccessible default constructor:\n" + iae);
}
}
};
代码示例来源:origin: org.jruby/jruby-complete
public IRubyObject allocate(Ruby runtime, RubyClass klazz) {
try {
return constructor.newInstance(runtime, klazz);
} catch (InvocationTargetException ite) {
throw runtime.newTypeError("could not allocate " + clazz + " with (Ruby, RubyClass) constructor:\n" + ite);
} catch (InstantiationException ie) {
throw runtime.newTypeError("could not allocate " + clazz + " with (Ruby, RubyClass) constructor:\n" + ie);
} catch (IllegalAccessException iae) {
throw runtime.newSecurityError("could not allocate " + clazz + " due to inaccessible (Ruby, RubyClass) constructor:\n" + iae);
}
}
};
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public IRubyObject allocate(Ruby runtime, RubyClass klazz) {
try {
RubyBasicObject object = (RubyBasicObject)cls.newInstance();
object.setMetaClass(klazz);
return object;
} catch (InstantiationException ie) {
throw runtime.newTypeError("could not allocate " + cls + " with default constructor:\n" + ie);
} catch (IllegalAccessException iae) {
throw runtime.newSecurityError("could not allocate " + cls + " due to inaccessible default constructor:\n" + iae);
}
}
};
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
public IRubyObject allocate(Ruby runtime, RubyClass klazz) {
try {
RubyBasicObject object = (RubyBasicObject)cls.newInstance();
object.setMetaClass(klazz);
return object;
} catch (InstantiationException ie) {
throw runtime.newTypeError("could not allocate " + cls + " with default constructor:\n" + ie);
} catch (IllegalAccessException iae) {
throw runtime.newSecurityError("could not allocate " + cls + " due to inaccessible default constructor:\n" + iae);
}
}
};
代码示例来源:origin: org.jruby/jruby-core
public IRubyObject allocate(Ruby runtime, RubyClass klazz) {
try {
return constructor.newInstance(runtime, klazz);
} catch (InvocationTargetException ite) {
throw runtime.newTypeError("could not allocate " + clazz + " with (Ruby, RubyClass) constructor:\n" + ite);
} catch (InstantiationException ie) {
throw runtime.newTypeError("could not allocate " + clazz + " with (Ruby, RubyClass) constructor:\n" + ie);
} catch (IllegalAccessException iae) {
throw runtime.newSecurityError("could not allocate " + clazz + " due to inaccessible (Ruby, RubyClass) constructor:\n" + iae);
}
}
};
代码示例来源:origin: org.jruby/jruby-core
public IRubyObject allocate(Ruby runtime, RubyClass klazz) {
try {
RubyBasicObject object = (RubyBasicObject)cls.newInstance();
object.setMetaClass(klazz);
return object;
} catch (InstantiationException ie) {
throw runtime.newTypeError("could not allocate " + cls + " with default constructor:\n" + ie);
} catch (IllegalAccessException iae) {
throw runtime.newSecurityError("could not allocate " + cls + " due to inaccessible default constructor:\n" + iae);
}
}
};
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public IRubyObject allocate(Ruby runtime, RubyClass klazz) {
try {
return (IRubyObject)constructor.newInstance(runtime, klazz);
} catch (InvocationTargetException ite) {
throw runtime.newTypeError("could not allocate " + cls + " with (Ruby, RubyClass) constructor:\n" + ite);
} catch (InstantiationException ie) {
throw runtime.newTypeError("could not allocate " + cls + " with (Ruby, RubyClass) constructor:\n" + ie);
} catch (IllegalAccessException iae) {
throw runtime.newSecurityError("could not allocate " + cls + " due to inaccessible (Ruby, RubyClass) constructor:\n" + iae);
}
}
};
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
public IRubyObject allocate(Ruby runtime, RubyClass klazz) {
try {
return (IRubyObject)constructor.newInstance(runtime, klazz);
} catch (InvocationTargetException ite) {
throw runtime.newTypeError("could not allocate " + cls + " with (Ruby, RubyClass) constructor:\n" + ite);
} catch (InstantiationException ie) {
throw runtime.newTypeError("could not allocate " + cls + " with (Ruby, RubyClass) constructor:\n" + ie);
} catch (IllegalAccessException iae) {
throw runtime.newSecurityError("could not allocate " + cls + " due to inaccessible (Ruby, RubyClass) constructor:\n" + iae);
}
}
};
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
private RubyRegexp initializeCommon(ByteList bytes, RegexpOptions newOptions) {
Ruby runtime = getRuntime();
// Options needs a little more set up.
checkFrozen();
if (isLiteral()) throw runtime.newSecurityError("can't modify literal regexp");
options = newOptions;
pattern = getRegexpFromCache(runtime, bytes, options.getKCode().getEncoding(), options);
bytes.getClass();
str = bytes;
return this;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
private RubyRegexp initializeCommon(ByteList bytes, RegexpOptions newOptions) {
Ruby runtime = getRuntime();
// Options needs a little more set up.
checkFrozen();
if (isLiteral()) throw runtime.newSecurityError("can't modify literal regexp");
options = newOptions;
pattern = getRegexpFromCache(runtime, bytes, options.getKCode().getEncoding(), options);
bytes.getClass();
str = bytes;
return this;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public Class loadJavaClassQuiet(String className) {
try {
return loadJavaClass(className);
} catch (ClassNotFoundException cnfExcptn) {
throw runtime.newNameError("cannot load Java class " + className, className, cnfExcptn, false);
} catch (ExceptionInInitializerError eiie) {
throw runtime.newNameError("cannot initialize Java class " + className, className, eiie, false);
} catch (LinkageError le) {
throw runtime.newNameError("cannot link Java class " + className, className, le, false);
} catch (SecurityException se) {
throw runtime.newSecurityError(se.getLocalizedMessage());
}
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
public Class loadJavaClassQuiet(String className) {
try {
return loadJavaClass(className);
} catch (ClassNotFoundException cnfExcptn) {
throw runtime.newNameError("cannot load Java class " + className, className, cnfExcptn, false);
} catch (ExceptionInInitializerError eiie) {
throw runtime.newNameError("cannot initialize Java class " + className, className, eiie, false);
} catch (LinkageError le) {
throw runtime.newNameError("cannot link Java class " + className, className, le, false);
} catch (SecurityException se) {
throw runtime.newSecurityError(se.getLocalizedMessage());
}
}
代码示例来源:origin: org.jruby/jruby-complete
public Class loadJavaClassQuiet(String className) {
try {
return loadJavaClass(className);
} catch (ClassNotFoundException ex) {
throw initCause(runtime.newNameError("cannot load Java class " + className, className, ex, false), ex);
} catch (ExceptionInInitializerError ex) {
throw initCause(runtime.newNameError("cannot initialize Java class " + className, className, ex, false), ex);
} catch (LinkageError ex) {
throw initCause(runtime.newNameError("cannot link Java class " + className, className, ex, false), ex);
} catch (SecurityException ex) {
throw initCause(runtime.newSecurityError(ex.getLocalizedMessage()), ex);
}
}
代码示例来源:origin: org.jruby/jruby-core
public Class loadJavaClassQuiet(String className) {
try {
return loadJavaClass(className);
} catch (ClassNotFoundException ex) {
throw initCause(runtime.newNameError("cannot load Java class " + className, className, ex, false), ex);
} catch (ExceptionInInitializerError ex) {
throw initCause(runtime.newNameError("cannot initialize Java class " + className, className, ex, false), ex);
} catch (LinkageError ex) {
throw initCause(runtime.newNameError("cannot link Java class " + className, className, ex, false), ex);
} catch (SecurityException ex) {
throw initCause(runtime.newSecurityError(ex.getLocalizedMessage()), ex);
}
}
内容来源于网络,如有侵权,请联系作者删除!