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

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

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

Regex.setUserObject介绍

暂无

代码示例

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

static Regex getRegexpFromCache(Ruby runtime, ByteList bytes, Encoding enc, RegexpOptions options) {
  Map<ByteList, Regex> cache = patternCache.get();
  Regex regex = cache.get(bytes);
  if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex;
  regex = makeRegexp(runtime, bytes, options, enc);
  regex.setUserObject(bytes);
  cache.put(bytes, regex);
  return regex;
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

static Regex getRegexpFromCache(Ruby runtime, ByteList bytes, Encoding enc, RegexpOptions options) {
  Map<ByteList, Regex> cache = patternCache.get();
  Regex regex = cache.get(bytes);
  if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex;
  regex = makeRegexp(runtime, bytes, options, enc);
  regex.setUserObject(bytes);
  cache.put(bytes, regex);
  return regex;
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

static Regex getQuotedRegexpFromCache(Ruby runtime, ByteList bytes, Encoding enc, RegexpOptions options) {
  Map<ByteList, Regex> cache = quotedPatternCache.get();
  Regex regex = cache.get(bytes);
  if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex;
  ByteList quoted = quote(bytes, enc);
  regex = makeRegexp(runtime, quoted, options, enc);
  regex.setUserObject(quoted);
  cache.put(bytes, regex);
  return regex;
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

private static Regex getPreprocessedRegexpFromCache(Ruby runtime, ByteList bytes, Encoding enc, RegexpOptions options, ErrorMode mode) {
  Map<ByteList, Regex> cache = preprocessedPatternCache.get();
  Regex regex = cache.get(bytes);
  if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex;
  ByteList preprocessed = preprocess(runtime, bytes, enc, new Encoding[]{null}, ErrorMode.RAISE);
  regex = makeRegexp(runtime, preprocessed, options, enc);
  regex.setUserObject(preprocessed);
  cache.put(bytes, regex);
  return regex;
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

private static Regex getPreprocessedRegexpFromCache(Ruby runtime, ByteList bytes, Encoding enc, RegexpOptions options, ErrorMode mode) {
  Map<ByteList, Regex> cache = preprocessedPatternCache.get();
  Regex regex = cache.get(bytes);
  if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex;
  ByteList preprocessed = preprocess(runtime, bytes, enc, new Encoding[]{null}, ErrorMode.RAISE);
  regex = makeRegexp(runtime, preprocessed, options, enc);
  regex.setUserObject(preprocessed);
  cache.put(bytes, regex);
  return regex;
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

static Regex getQuotedRegexpFromCache(Ruby runtime, ByteList bytes, Encoding enc, RegexpOptions options) {
  Map<ByteList, Regex> cache = quotedPatternCache.get();
  Regex regex = cache.get(bytes);
  if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex;
  ByteList quoted = quote(bytes, enc);
  regex = makeRegexp(runtime, quoted, options, enc);
  regex.setUserObject(quoted);
  cache.put(bytes, regex);
  return regex;
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

static Regex getQuotedRegexpFromCache19(Ruby runtime, ByteList bytes, RegexpOptions options, boolean asciiOnly) {
  Map<ByteList, Regex> cache = quotedPatternCache.get();
  Regex regex = cache.get(bytes);
  Encoding enc = asciiOnly ? USASCIIEncoding.INSTANCE : bytes.getEncoding();
  if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex;
  ByteList quoted = quote19(bytes, asciiOnly);
  regex = makeRegexp(runtime, quoted, options, quoted.getEncoding());
  regex.setUserObject(quoted);
  cache.put(bytes, regex);
  return regex;
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

static Regex getQuotedRegexpFromCache19(Ruby runtime, ByteList bytes, RegexpOptions options, boolean asciiOnly) {
  Map<ByteList, Regex> cache = quotedPatternCache.get();
  Regex regex = cache.get(bytes);
  Encoding enc = asciiOnly ? USASCIIEncoding.INSTANCE : bytes.getEncoding();
  if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex;
  ByteList quoted = quote19(bytes, asciiOnly);
  regex = makeRegexp(runtime, quoted, options, quoted.getEncoding());
  regex.setUserObject(quoted);
  cache.put(bytes, regex);
  return regex;
}

代码示例来源:origin: org.jruby/jruby-complete

public static Regex getRegexpFromCache(Ruby runtime, ByteList bytes, Encoding enc, RegexpOptions options) {
  Regex regex = patternCache.get(bytes);
  if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex;
  regex = makeRegexp(runtime, bytes, options, enc);
  regex.setUserObject(bytes);
  patternCache.put(bytes, regex);
  return regex;
}

代码示例来源:origin: org.jruby/jruby-core

public static Regex getRegexpFromCache(Ruby runtime, ByteList bytes, Encoding enc, RegexpOptions options) {
  Regex regex = patternCache.get(bytes);
  if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex;
  regex = makeRegexp(runtime, bytes, options, enc);
  regex.setUserObject(bytes);
  patternCache.put(bytes, regex);
  return regex;
}

代码示例来源:origin: org.jruby/jruby-complete

private static Regex getPreprocessedRegexpFromCache(Ruby runtime, ByteList bytes, Encoding enc, RegexpOptions options, RegexpSupport.ErrorMode mode) {
  Regex regex = preprocessedPatternCache.get(bytes);
  if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex;
  ByteList preprocessed = RegexpSupport.preprocess(runtime, bytes, enc, new Encoding[]{null}, RegexpSupport.ErrorMode.RAISE);
  regex = makeRegexp(runtime, preprocessed, options, enc);
  regex.setUserObject(preprocessed);
  preprocessedPatternCache.put(bytes, regex);
  return regex;
}

代码示例来源:origin: org.jruby/jruby-core

private static Regex getPreprocessedRegexpFromCache(Ruby runtime, ByteList bytes, Encoding enc, RegexpOptions options, RegexpSupport.ErrorMode mode) {
  Regex regex = preprocessedPatternCache.get(bytes);
  if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex;
  ByteList preprocessed = RegexpSupport.preprocess(runtime, bytes, enc, new Encoding[]{null}, RegexpSupport.ErrorMode.RAISE);
  regex = makeRegexp(runtime, preprocessed, options, enc);
  regex.setUserObject(preprocessed);
  preprocessedPatternCache.put(bytes, regex);
  return regex;
}

代码示例来源:origin: org.jruby/jruby-complete

static Regex getQuotedRegexpFromCache(Ruby runtime, RubyString str, RegexpOptions options) {
  final ByteList bytes = str.getByteList();
  Regex regex = quotedPatternCache.get(bytes);
  Encoding enc = str.isAsciiOnly() ? USASCIIEncoding.INSTANCE : bytes.getEncoding();
  if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex;
  final ByteList quoted = quote(str);
  regex = makeRegexp(runtime, quoted, options, quoted.getEncoding());
  regex.setUserObject(quoted);
  quotedPatternCache.put(bytes, regex);
  return regex;
}

代码示例来源:origin: org.jruby/jruby-core

static Regex getQuotedRegexpFromCache(Ruby runtime, RubyString str, RegexpOptions options) {
  final ByteList bytes = str.getByteList();
  Regex regex = quotedPatternCache.get(bytes);
  Encoding enc = str.isAsciiOnly() ? USASCIIEncoding.INSTANCE : bytes.getEncoding();
  if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex;
  final ByteList quoted = quote(str);
  regex = makeRegexp(runtime, quoted, options, quoted.getEncoding());
  regex.setUserObject(quoted);
  quotedPatternCache.put(bytes, regex);
  return regex;
}

相关文章