本文整理了Java中org.joni.Regex.getUserObject
方法的一些代码示例,展示了Regex.getUserObject
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Regex.getUserObject
方法的具体详情如下:
包路径:org.joni.Regex
类名称:Regex
方法名:getUserObject
暂无
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
private void checkLazyRegexp() {
if (regexp == null) regexp = RubyRegexp.newRegexp(getRuntime(), (ByteList)pattern.getUserObject(), pattern);
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
private void checkLazyRegexp() {
if (regexp == null) regexp = RubyRegexp.newRegexp(getRuntime(), (ByteList)pattern.getUserObject(), pattern);
}
代码示例来源:origin: org.jruby/jruby-core
private RubyRegexp getRegexp() {
RubyRegexp regexp = this.regexp;
if (regexp != null) return regexp;
final Regex pattern = getPattern();
return this.regexp = RubyRegexp.newRegexp(getRuntime(), (ByteList) pattern.getUserObject(), pattern);
}
代码示例来源:origin: org.jruby/jruby-complete
private RubyRegexp getRegexp() {
RubyRegexp regexp = this.regexp;
if (regexp != null) return regexp;
final Regex pattern = getPattern();
return this.regexp = RubyRegexp.newRegexp(getRuntime(), (ByteList) pattern.getUserObject(), pattern);
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
static Regex preparePattern(Ruby runtime, Regex pattern, RubyString str) {
if (str.scanForCodeRange() == StringSupport.CR_BROKEN) {
throw runtime.newArgumentError("invalid byte sequence in " + str.getEncoding());
}
Encoding enc = str.getEncoding();
if (!enc.isAsciiCompatible()) {
if (enc != pattern.getEncoding()) encodingMatchError(runtime, pattern, enc);
}
// TODO: check for isKCodeDefault() somehow
// if (warn && isEncodingNone() && enc != ASCIIEncoding.INSTANCE && str.scanForCodeRange() != StringSupport.CR_7BIT) {
// getRuntime().getWarnings().warn(ID.REGEXP_MATCH_AGAINST_STRING, "regexp match /.../n against to " + enc + " string");
// }
if (enc == pattern.getEncoding()) return pattern;
return getPreprocessedRegexpFromCache(runtime, (ByteList)pattern.getUserObject(), enc, RegexpOptions.fromJoniOptions(pattern.getOptions()), ErrorMode.PREPROCESS);
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
static Regex preparePattern(Ruby runtime, Regex pattern, RubyString str) {
if (str.scanForCodeRange() == StringSupport.CR_BROKEN) {
throw runtime.newArgumentError("invalid byte sequence in " + str.getEncoding());
}
Encoding enc = str.getEncoding();
if (!enc.isAsciiCompatible()) {
if (enc != pattern.getEncoding()) encodingMatchError(runtime, pattern, enc);
}
// TODO: check for isKCodeDefault() somehow
// if (warn && isEncodingNone() && enc != ASCIIEncoding.INSTANCE && str.scanForCodeRange() != StringSupport.CR_7BIT) {
// getRuntime().getWarnings().warn(ID.REGEXP_MATCH_AGAINST_STRING, "regexp match /.../n against to " + enc + " string");
// }
if (enc == pattern.getEncoding()) return pattern;
return getPreprocessedRegexpFromCache(runtime, (ByteList)pattern.getUserObject(), enc, RegexpOptions.fromJoniOptions(pattern.getOptions()), ErrorMode.PREPROCESS);
}
内容来源于网络,如有侵权,请联系作者删除!