本文整理了Java中org.jruby.Ruby.setRegexp
方法的一些代码示例,展示了Ruby.setRegexp
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ruby.setRegexp
方法的具体详情如下:
包路径:org.jruby.Ruby
类名称:Ruby
方法名:setRegexp
暂无
代码示例来源:origin: org.jruby/jruby-core
public static RubyClass createRegexpClass(Ruby runtime) {
RubyClass regexpClass = runtime.defineClass("Regexp", runtime.getObject(), REGEXP_ALLOCATOR);
runtime.setRegexp(regexpClass);
regexpClass.setClassIndex(ClassIndex.REGEXP);
regexpClass.setReifiedClass(RubyRegexp.class);
regexpClass.kindOf = new RubyModule.JavaClassKindOf(RubyRegexp.class);
regexpClass.defineConstant("IGNORECASE", runtime.newFixnum(RE_OPTION_IGNORECASE));
regexpClass.defineConstant("EXTENDED", runtime.newFixnum(RE_OPTION_EXTENDED));
regexpClass.defineConstant("MULTILINE", runtime.newFixnum(RE_OPTION_MULTILINE));
regexpClass.defineConstant("FIXEDENCODING", runtime.newFixnum(RE_FIXED));
regexpClass.defineConstant("NOENCODING", runtime.newFixnum(RE_NONE));
regexpClass.defineAnnotatedMethods(RubyRegexp.class);
regexpClass.getSingletonClass().defineAlias("compile", "new");
return regexpClass;
}
代码示例来源:origin: org.jruby/jruby-complete
public static RubyClass createRegexpClass(Ruby runtime) {
RubyClass regexpClass = runtime.defineClass("Regexp", runtime.getObject(), REGEXP_ALLOCATOR);
runtime.setRegexp(regexpClass);
regexpClass.setClassIndex(ClassIndex.REGEXP);
regexpClass.setReifiedClass(RubyRegexp.class);
regexpClass.kindOf = new RubyModule.JavaClassKindOf(RubyRegexp.class);
regexpClass.defineConstant("IGNORECASE", runtime.newFixnum(RE_OPTION_IGNORECASE));
regexpClass.defineConstant("EXTENDED", runtime.newFixnum(RE_OPTION_EXTENDED));
regexpClass.defineConstant("MULTILINE", runtime.newFixnum(RE_OPTION_MULTILINE));
regexpClass.defineConstant("FIXEDENCODING", runtime.newFixnum(RE_FIXED));
regexpClass.defineConstant("NOENCODING", runtime.newFixnum(RE_NONE));
regexpClass.defineAnnotatedMethods(RubyRegexp.class);
regexpClass.getSingletonClass().defineAlias("compile", "new");
return regexpClass;
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
public static RubyClass createRegexpClass(Ruby runtime) {
RubyClass regexpClass = runtime.defineClass("Regexp", runtime.getObject(), REGEXP_ALLOCATOR);
runtime.setRegexp(regexpClass);
regexpClass.index = ClassIndex.REGEXP;
regexpClass.setReifiedClass(RubyRegexp.class);
regexpClass.kindOf = new RubyModule.JavaClassKindOf(RubyRegexp.class);
regexpClass.defineConstant("IGNORECASE", runtime.newFixnum(RE_OPTION_IGNORECASE));
regexpClass.defineConstant("EXTENDED", runtime.newFixnum(RE_OPTION_EXTENDED));
regexpClass.defineConstant("MULTILINE", runtime.newFixnum(RE_OPTION_MULTILINE));
if (runtime.is1_9()) {
regexpClass.defineConstant("FIXEDENCODING", runtime.newFixnum(ARG_ENCODING_FIXED));
regexpClass.defineConstant("NOENCODING", runtime.newFixnum(ARG_ENCODING_NONE));
}
regexpClass.defineAnnotatedMethods(RubyRegexp.class);
regexpClass.getSingletonClass().defineAlias("compile", "new");
return regexpClass;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public static RubyClass createRegexpClass(Ruby runtime) {
RubyClass regexpClass = runtime.defineClass("Regexp", runtime.getObject(), REGEXP_ALLOCATOR);
runtime.setRegexp(regexpClass);
regexpClass.index = ClassIndex.REGEXP;
regexpClass.setReifiedClass(RubyRegexp.class);
regexpClass.kindOf = new RubyModule.JavaClassKindOf(RubyRegexp.class);
regexpClass.defineConstant("IGNORECASE", runtime.newFixnum(RE_OPTION_IGNORECASE));
regexpClass.defineConstant("EXTENDED", runtime.newFixnum(RE_OPTION_EXTENDED));
regexpClass.defineConstant("MULTILINE", runtime.newFixnum(RE_OPTION_MULTILINE));
if (runtime.is1_9()) {
regexpClass.defineConstant("FIXEDENCODING", runtime.newFixnum(ARG_ENCODING_FIXED));
regexpClass.defineConstant("NOENCODING", runtime.newFixnum(ARG_ENCODING_NONE));
}
regexpClass.defineAnnotatedMethods(RubyRegexp.class);
regexpClass.getSingletonClass().defineAlias("compile", "new");
return regexpClass;
}
内容来源于网络,如有侵权,请联系作者删除!