org.joni.Regex.getUserObject()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(181)

本文整理了Java中org.joni.Regex.getUserObject方法的一些代码示例,展示了Regex.getUserObject的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Regex.getUserObject方法的具体详情如下:
包路径:org.joni.Regex
类名称:Regex
方法名:getUserObject

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);
  }

相关文章