本文整理了Java中org.jruby.RubyClass.smartLoadNewUser
方法的一些代码示例,展示了RubyClass.smartLoadNewUser
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RubyClass.smartLoadNewUser
方法的具体详情如下:
包路径:org.jruby.RubyClass
类名称:RubyClass
方法名:smartLoadNewUser
[英]Load marshaled data into a blank target object using marshal_load, being "smart" and caching the mechanism for invoking marshal_load. If the class implements a custom respond_to?, cache nothing and go slow path invocation of respond_to? and marshal_load every time. Raise error if respond_to? :marshal_load returns true and no :marshal_load is defined. If the class implements marshal_load, cache and use that. Otherwise, error, since marshal_load is not present.
[中]使用marshal_Load将封送的数据加载到一个空白的目标对象中,这是“智能”的,并缓存调用marshal_Load的机制。如果类实现了一个自定义的respond_to?,不缓存任何内容,并缓慢调用respond_to?每一次都是马绍尔。如果响应?\u,则引发错误:marshal_load返回true,no:定义了marshal_load。如果类实现了marshal_load,则缓存并使用它。否则会出现错误,因为封送加载不存在。
代码示例来源:origin: org.jruby/jruby-complete
private IRubyObject userNewUnmarshal() throws IOException {
String className = unmarshalObject(false).asJavaString();
RubyClass classInstance = findClass(className);
IRubyObject result = classInstance.allocate();
registerLinkTarget(result);
IRubyObject marshaled = unmarshalObject();
return classInstance.smartLoadNewUser(result, marshaled);
}
代码示例来源:origin: org.jruby/jruby-core
private IRubyObject userNewUnmarshal() throws IOException {
String className = unmarshalObject(false).asJavaString();
RubyClass classInstance = findClass(className);
IRubyObject result = classInstance.allocate();
registerLinkTarget(result);
IRubyObject marshaled = unmarshalObject();
return classInstance.smartLoadNewUser(result, marshaled);
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
private IRubyObject userNewUnmarshal() throws IOException {
String className = unmarshalObject(false).asJavaString();
RubyClass classInstance = findClass(className);
IRubyObject result = classInstance.allocate();
registerLinkTarget(result);
IRubyObject marshaled = unmarshalObject();
return classInstance.smartLoadNewUser(result, marshaled);
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
private IRubyObject userNewUnmarshal() throws IOException {
String className = unmarshalObject(false).asJavaString();
RubyClass classInstance = findClass(className);
IRubyObject result = classInstance.allocate();
registerLinkTarget(result);
IRubyObject marshaled = unmarshalObject();
return classInstance.smartLoadNewUser(result, marshaled);
}
内容来源于网络,如有侵权,请联系作者删除!