本文整理了Java中org.jruby.Ruby.getRegexp
方法的一些代码示例,展示了Ruby.getRegexp
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ruby.getRegexp
方法的具体详情如下:
包路径:org.jruby.Ruby
类名称:Ruby
方法名:getRegexp
暂无
代码示例来源:origin: org.jruby/jruby-complete
public RubyRegexp(Ruby runtime, Regex pattern, ByteList str, RegexpOptions options) {
super(runtime, runtime.getRegexp());
this.pattern = pattern;
this.str = str;
this.options = options;
}
代码示例来源:origin: org.jruby/jruby-core
public RubyRegexp(Ruby runtime, Regex pattern, ByteList str, RegexpOptions options) {
super(runtime, runtime.getRegexp());
this.pattern = pattern;
this.str = str;
this.options = options;
}
代码示例来源:origin: org.jruby/jruby-complete
/** default constructor
*/
RubyRegexp(Ruby runtime) {
super(runtime, runtime.getRegexp());
this.options = new RegexpOptions();
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
/** default constructor
*/
private RubyRegexp(Ruby runtime) {
super(runtime, runtime.getRegexp());
this.options = new RegexpOptions();
}
代码示例来源:origin: org.jruby/jruby-core
/** default constructor
*/
RubyRegexp(Ruby runtime) {
super(runtime, runtime.getRegexp());
this.options = new RegexpOptions();
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
/** default constructor
*/
private RubyRegexp(Ruby runtime) {
super(runtime, runtime.getRegexp());
this.options = new RegexpOptions();
}
代码示例来源:origin: org.jruby/jruby-complete
@JRubyMethod(meta = true)
public static IRubyObject try_convert(ThreadContext context, IRubyObject recv, IRubyObject args) {
return TypeConverter.convertToTypeWithCheck(args, context.runtime.getRegexp(), "to_regexp");
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
@JRubyMethod(name = "try_convert", meta = true, compat = CompatVersion.RUBY1_9)
public static IRubyObject try_convert(ThreadContext context, IRubyObject recv, IRubyObject args) {
return TypeConverter.convertToTypeWithCheck(args, context.runtime.getRegexp(), "to_regexp");
}
代码示例来源:origin: org.jruby/jruby-core
@JRubyMethod(meta = true)
public static IRubyObject try_convert(ThreadContext context, IRubyObject recv, IRubyObject args) {
return TypeConverter.convertToTypeWithCheck(args, context.runtime.getRegexp(), "to_regexp");
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
@JRubyMethod(name = "try_convert", meta = true, compat = CompatVersion.RUBY1_9)
public static IRubyObject try_convert(ThreadContext context, IRubyObject recv, IRubyObject args) {
return TypeConverter.convertToTypeWithCheck(args, context.runtime.getRegexp(), "to_regexp");
}
代码示例来源:origin: org.jruby/jruby-complete
public static RubyRegexp newRegexpFromStr(Ruby runtime, RubyString s, int options) {
RubyRegexp re = (RubyRegexp)runtime.getRegexp().allocate();
re.regexpInitializeString(s, RegexpOptions.fromJoniOptions(options));
return re;
}
代码示例来源:origin: org.jruby/jruby-core
public static RubyRegexp newRegexpFromStr(Ruby runtime, RubyString s, int options) {
RubyRegexp re = (RubyRegexp)runtime.getRegexp().allocate();
re.regexpInitializeString(s, RegexpOptions.fromJoniOptions(options));
return re;
}
代码示例来源:origin: org.jruby/jruby-complete
private static IRubyObject getPatternQuoted(ThreadContext context, IRubyObject pat, boolean check) {
IRubyObject val;
if (pat instanceof RubyRegexp) return pat;
if (!(pat instanceof RubyString)) {
val = pat.checkStringType();
if (val == context.nil) {
TypeConverter.checkType(context, pat, context.runtime.getRegexp());
}
pat = val;
}
if (check && ((RubyString) pat).isBrokenString()) {
// MRI code does a raise of TypeError with a special regexp string constructor that raises RegexpError
throw context.runtime.newRegexpError("invalid byte sequence in " + ((RubyString) pat).getEncoding());
}
return pat;
}
代码示例来源:origin: org.jruby/jruby-core
private static IRubyObject getPatternQuoted(ThreadContext context, IRubyObject pat, boolean check) {
IRubyObject val;
if (pat instanceof RubyRegexp) return pat;
if (!(pat instanceof RubyString)) {
val = pat.checkStringType();
if (val == context.nil) {
TypeConverter.checkType(context, pat, context.runtime.getRegexp());
}
pat = val;
}
if (check && ((RubyString) pat).isBrokenString()) {
// MRI code does a raise of TypeError with a special regexp string constructor that raises RegexpError
throw context.runtime.newRegexpError("invalid byte sequence in " + ((RubyString) pat).getEncoding());
}
return pat;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
return runtime.getRegexp().newInstance(context, runtime.newString("(?!)"), Block.NULL_BLOCK);
} else if (args.length == 1) {
IRubyObject re = TypeConverter.convertToTypeWithCheck(args[0], runtime.getRegexp(), "to_regexp");
return !re.isNil() ? re : newRegexp(runtime, ((RubyString)quote19(context, recv, args[0])).getByteList());
} else {
IRubyObject e = args[i];
if (i > 0) source.cat((byte)'|');
IRubyObject v = TypeConverter.convertToTypeWithCheck(args[i], runtime.getRegexp(), "to_regexp");
Encoding enc;
if (!v.isNil()) {
source.setEncoding(ASCIIEncoding.INSTANCE);
return runtime.getRegexp().newInstance(context, source, Block.NULL_BLOCK);
代码示例来源:origin: org.jruby/jruby-complete
return runtime.getRegexp().newInstance(context, runtime.newString("(?!)"), Block.NULL_BLOCK);
} else if (args.length == 1) {
IRubyObject re = TypeConverter.convertToTypeWithCheck(args[0], runtime.getRegexp(), "to_regexp");
return !re.isNil() ? re : newRegexpFromStr(runtime, quote(context, recv, args[0]), 0);
} else {
IRubyObject e = args[i];
if (i > 0) source.cat((byte)'|');
IRubyObject v = TypeConverter.convertToTypeWithCheck(e, runtime.getRegexp(), "to_regexp");
final Encoding enc; final ByteList re;
if (v != context.nil) {
source.setEncoding(ASCIIEncoding.INSTANCE);
return runtime.getRegexp().newInstance(context, source, Block.NULL_BLOCK);
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
if (args.length == 1) {
IRubyObject v = TypeConverter.convertToTypeWithCheck(args[0], runtime.getRegexp(), "to_regexp");
if (!v.isNil()) return v;
IRubyObject v = TypeConverter.convertToTypeWithCheck(realArgs[i], runtime.getRegexp(), "to_regexp");
if (!v.isNil()) {
if (!((RubyRegexp)v).isKCodeDefault()) {
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
if (args.length == 1) {
IRubyObject v = TypeConverter.convertToTypeWithCheck(args[0], runtime.getRegexp(), "to_regexp");
if (!v.isNil()) return v;
IRubyObject v = TypeConverter.convertToTypeWithCheck(realArgs[i], runtime.getRegexp(), "to_regexp");
if (!v.isNil()) {
if (!((RubyRegexp)v).isKCodeDefault()) {
代码示例来源:origin: org.jruby/jruby-core
RegexpOptions reOpts = RegexpOptions.fromJoniOptions(opts);
RubyRegexp regexp = (RubyRegexp) runtime.getRegexp().allocate();
registerLinkTarget(regexp);
代码示例来源:origin: org.jruby/jruby-complete
RegexpOptions reOpts = RegexpOptions.fromJoniOptions(opts);
RubyRegexp regexp = (RubyRegexp) runtime.getRegexp().allocate();
registerLinkTarget(regexp);
内容来源于网络,如有侵权,请联系作者删除!