本文整理了Java中org.jruby.RubyModule.addAccessor
方法的一些代码示例,展示了RubyModule.addAccessor
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RubyModule.addAccessor
方法的具体详情如下:
包路径:org.jruby.RubyModule
类名称:RubyModule
方法名:addAccessor
暂无
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public void addWriteAttribute(ThreadContext context, String name) {
addAccessor(context, name.intern(), PUBLIC, false, true);
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public void addReadWriteAttribute(ThreadContext context, String name) {
addAccessor(context, name.intern(), PUBLIC, true, true);
}
代码示例来源:origin: org.jruby/jruby-core
public void addReadWriteAttribute(ThreadContext context, String name) {
addAccessor(context, TypeConverter.checkID(context.runtime, name), PUBLIC, true, true);
}
代码示例来源:origin: org.jruby/jruby-core
public void addWriteAttribute(ThreadContext context, String name) {
addAccessor(context, TypeConverter.checkID(context.runtime, name), PUBLIC, false, true);
}
代码示例来源:origin: org.jruby/jruby-complete
public void addReadWriteAttribute(ThreadContext context, String name) {
addAccessor(context, TypeConverter.checkID(context.runtime, name), PUBLIC, true, true);
}
代码示例来源:origin: org.jruby/jruby-complete
public void addWriteAttribute(ThreadContext context, String name) {
addAccessor(context, TypeConverter.checkID(context.runtime, name), PUBLIC, false, true);
}
代码示例来源:origin: org.jruby/jruby-complete
/** rb_mod_attr_writer
*
*/
@JRubyMethod(name = "attr_writer", rest = true, reads = VISIBILITY)
public IRubyObject attr_writer(ThreadContext context, IRubyObject[] args) {
// Check the visibility of the previous frame, which will be the frame in which the class is being eval'ed
Visibility visibility = context.getCurrentVisibility();
for (int i = 0; i < args.length; i++) {
addAccessor(context, TypeConverter.checkID(args[i]), visibility, false, true);
}
return context.nil;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
/** rb_mod_attr_writer
*
*/
@JRubyMethod(name = "attr_writer", rest = true, visibility = PRIVATE, reads = VISIBILITY)
public IRubyObject attr_writer(ThreadContext context, IRubyObject[] args) {
// Check the visibility of the previous frame, which will be the frame in which the class is being eval'ed
Visibility visibility = context.getCurrentVisibility();
for (int i = 0; i < args.length; i++) {
addAccessor(context, args[i].asJavaString().intern(), visibility, false, true);
}
return context.runtime.getNil();
}
代码示例来源:origin: org.jruby/jruby-complete
/** rb_mod_attr_reader
*
*/
@JRubyMethod(name = "attr_reader", rest = true, reads = VISIBILITY)
public IRubyObject attr_reader(ThreadContext context, IRubyObject[] args) {
// Check the visibility of the previous frame, which will be the frame in which the class is being eval'ed
Visibility visibility = context.getCurrentVisibility();
for (int i = 0; i < args.length; i++) {
addAccessor(context, TypeConverter.checkID(args[i]), visibility, true, false);
}
return context.nil;
}
代码示例来源:origin: org.jruby/jruby-core
/** rb_mod_attr_reader
*
*/
@JRubyMethod(name = "attr_reader", rest = true, reads = VISIBILITY)
public IRubyObject attr_reader(ThreadContext context, IRubyObject[] args) {
// Check the visibility of the previous frame, which will be the frame in which the class is being eval'ed
Visibility visibility = context.getCurrentVisibility();
for (int i = 0; i < args.length; i++) {
addAccessor(context, TypeConverter.checkID(args[i]), visibility, true, false);
}
return context.nil;
}
代码示例来源:origin: org.jruby/jruby-core
/** rb_mod_attr_writer
*
*/
@JRubyMethod(name = "attr_writer", rest = true, reads = VISIBILITY)
public IRubyObject attr_writer(ThreadContext context, IRubyObject[] args) {
// Check the visibility of the previous frame, which will be the frame in which the class is being eval'ed
Visibility visibility = context.getCurrentVisibility();
for (int i = 0; i < args.length; i++) {
addAccessor(context, TypeConverter.checkID(args[i]), visibility, false, true);
}
return context.nil;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
/** rb_mod_attr_reader
*
*/
@JRubyMethod(name = "attr_reader", rest = true, visibility = PRIVATE, reads = VISIBILITY)
public IRubyObject attr_reader(ThreadContext context, IRubyObject[] args) {
// Check the visibility of the previous frame, which will be the frame in which the class is being eval'ed
Visibility visibility = context.getCurrentVisibility();
for (int i = 0; i < args.length; i++) {
addAccessor(context, args[i].asJavaString().intern(), visibility, true, false);
}
return context.runtime.getNil();
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
/** rb_mod_attr_reader
*
*/
@JRubyMethod(name = "attr_reader", rest = true, visibility = PRIVATE, reads = VISIBILITY)
public IRubyObject attr_reader(ThreadContext context, IRubyObject[] args) {
// Check the visibility of the previous frame, which will be the frame in which the class is being eval'ed
Visibility visibility = context.getCurrentVisibility();
for (int i = 0; i < args.length; i++) {
addAccessor(context, args[i].asJavaString().intern(), visibility, true, false);
}
return context.runtime.getNil();
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
/** rb_mod_attr_writer
*
*/
@JRubyMethod(name = "attr_writer", rest = true, visibility = PRIVATE, reads = VISIBILITY)
public IRubyObject attr_writer(ThreadContext context, IRubyObject[] args) {
// Check the visibility of the previous frame, which will be the frame in which the class is being eval'ed
Visibility visibility = context.getCurrentVisibility();
for (int i = 0; i < args.length; i++) {
addAccessor(context, args[i].asJavaString().intern(), visibility, false, true);
}
return context.runtime.getNil();
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
/** rb_mod_attr
*
*/
@JRubyMethod(name = "attr", required = 1, optional = 1, visibility = PRIVATE, reads = VISIBILITY, compat = RUBY1_8)
public IRubyObject attr(ThreadContext context, IRubyObject[] args) {
boolean writeable = args.length > 1 ? args[1].isTrue() : false;
// Check the visibility of the previous frame, which will be the frame in which the class is being eval'ed
Visibility visibility = context.getCurrentVisibility();
addAccessor(context, args[0].asJavaString().intern(), visibility, true, writeable);
return getRuntime().getNil();
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
/** rb_mod_attr
*
*/
@JRubyMethod(name = "attr", required = 1, optional = 1, visibility = PRIVATE, reads = VISIBILITY, compat = RUBY1_8)
public IRubyObject attr(ThreadContext context, IRubyObject[] args) {
boolean writeable = args.length > 1 ? args[1].isTrue() : false;
// Check the visibility of the previous frame, which will be the frame in which the class is being eval'ed
Visibility visibility = context.getCurrentVisibility();
addAccessor(context, args[0].asJavaString().intern(), visibility, true, writeable);
return getRuntime().getNil();
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
@JRubyMethod(name = "attr", rest = true, visibility = PRIVATE, reads = VISIBILITY, compat = RUBY1_9)
public IRubyObject attr19(ThreadContext context, IRubyObject[] args) {
Ruby runtime = context.runtime;
if (args.length == 2 && (args[1] == runtime.getTrue() || args[1] == runtime.getFalse())) {
runtime.getWarnings().warn(ID.OBSOLETE_ARGUMENT, "optional boolean argument is obsoleted");
addAccessor(context, args[0].asJavaString().intern(), context.getCurrentVisibility(), args[0].isTrue(), true);
return runtime.getNil();
}
return attr_reader(context, args);
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
@JRubyMethod(name = "attr", rest = true, visibility = PRIVATE, reads = VISIBILITY, compat = RUBY1_9)
public IRubyObject attr19(ThreadContext context, IRubyObject[] args) {
Ruby runtime = context.runtime;
if (args.length == 2 && (args[1] == runtime.getTrue() || args[1] == runtime.getFalse())) {
runtime.getWarnings().warn(ID.OBSOLETE_ARGUMENT, "optional boolean argument is obsoleted");
addAccessor(context, args[0].asJavaString().intern(), context.getCurrentVisibility(), args[0].isTrue(), true);
return runtime.getNil();
}
return attr_reader(context, args);
}
代码示例来源:origin: org.jruby/jruby-complete
/** rb_mod_attr
*
*/
@JRubyMethod(name = "attr", rest = true, reads = VISIBILITY)
public IRubyObject attr(ThreadContext context, IRubyObject[] args) {
Ruby runtime = context.runtime;
if (args.length == 2 && (args[1] == runtime.getTrue() || args[1] == runtime.getFalse())) {
runtime.getWarnings().warn(ID.OBSOLETE_ARGUMENT, "optional boolean argument is obsoleted");
addAccessor(context, TypeConverter.checkID(args[0]), context.getCurrentVisibility(), args[0].isTrue(), args[1].isTrue());
return runtime.getNil();
}
return attr_reader(context, args);
}
代码示例来源:origin: org.jruby/jruby-core
/** rb_mod_attr
*
*/
@JRubyMethod(name = "attr", rest = true, reads = VISIBILITY)
public IRubyObject attr(ThreadContext context, IRubyObject[] args) {
Ruby runtime = context.runtime;
if (args.length == 2 && (args[1] == runtime.getTrue() || args[1] == runtime.getFalse())) {
runtime.getWarnings().warn(ID.OBSOLETE_ARGUMENT, "optional boolean argument is obsoleted");
addAccessor(context, TypeConverter.checkID(args[0]), context.getCurrentVisibility(), args[0].isTrue(), args[1].isTrue());
return runtime.getNil();
}
return attr_reader(context, args);
}
内容来源于网络,如有侵权,请联系作者删除!