org.jruby.Ruby.newConverterNotFoundError()方法的使用及代码示例

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

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

Ruby.newConverterNotFoundError介绍

暂无

代码示例

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

public static RaiseException econvOpenExc(ThreadContext context, byte[] sourceEncoding, byte[] destinationEncoding, int ecflags) {
  String message = econvDescription(context, sourceEncoding, destinationEncoding, ecflags, "code converter not found (") + ")";
  return context.runtime.newConverterNotFoundError(message);
}

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

public static RaiseException econvOpenExc(ThreadContext context, byte[] sourceEncoding, byte[] destinationEncoding, int ecflags) {
  String message = econvDescription(context, sourceEncoding, destinationEncoding, ecflags, "code converter not found (") + ")";
  return context.runtime.newConverterNotFoundError(message);
}

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

public static RaiseException econvOpenExc(ThreadContext context, byte[] sourceEncoding, byte[] destinationEncoding, int ecflags) {
  String message = econvDescription(context, sourceEncoding, destinationEncoding, ecflags, "code converter not found (") + ")";
  return context.runtime.newConverterNotFoundError(message);
}

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

public static RaiseException econvOpenExc(ThreadContext context, byte[] sourceEncoding, byte[] destinationEncoding, int ecflags) {
  String message = econvDescription(context, sourceEncoding, destinationEncoding, ecflags, "code converter not found (") + ")";
  return context.runtime.newConverterNotFoundError(message);
}

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

private static Encoding getEncoding(Ruby runtime, IRubyObject toEnc) {
  try {
    return runtime.getEncodingService().getEncodingFromObject(toEnc);
  } catch (Exception e) {
    throw runtime.newConverterNotFoundError("code converter not found (" + toEnc.toString() + ")");
  }
}

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

private static Encoding getEncoding(Ruby runtime, IRubyObject toEnc) {
  try {
    return runtime.getEncodingService().getEncodingFromObject(toEnc);
  } catch (Exception e) {
    throw runtime.newConverterNotFoundError("code converter not found (" + toEnc.toString() + ")");
  }
}

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

@JRubyMethod(meta = true)
public static IRubyObject asciicompat_encoding(ThreadContext context, IRubyObject self, IRubyObject strOrEnc) {
  Ruby runtime = context.runtime;
  EncodingService encodingService = runtime.getEncodingService();
  
  Encoding encoding = encodingService.getEncodingFromObjectNoError(strOrEnc);
  
  if (encoding == null) {
    return context.nil;
  }
  
  if (encoding.isAsciiCompatible()) {
    return context.nil;
  }
  
  Encoding asciiCompat = NONASCII_TO_ASCII.get(encoding);
  
  if (asciiCompat == null) {
    throw runtime.newConverterNotFoundError("no ASCII compatible encoding found for " + strOrEnc);
  }
  
  return encodingService.convertEncodingToRubyEncoding(asciiCompat);
}

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

@JRubyMethod(compat = RUBY1_9, meta = true)
public static IRubyObject asciicompat_encoding(ThreadContext context, IRubyObject self, IRubyObject strOrEnc) {
  Ruby runtime = context.runtime;
  EncodingService encodingService = runtime.getEncodingService();
  
  Encoding encoding = encodingService.getEncodingFromObjectNoError(strOrEnc);
  
  if (encoding == null) {
    return context.nil;
  }
  
  if (encoding.isAsciiCompatible()) {
    return context.nil;
  }
  
  Encoding asciiCompat = NONASCII_TO_ASCII.get(encoding);
  
  if (asciiCompat == null) {
    throw runtime.newConverterNotFoundError("no ASCII compatible encoding found for " + strOrEnc);
  }
  
  return encodingService.convertEncodingToRubyEncoding(asciiCompat);
}

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

@JRubyMethod(meta = true)
public static IRubyObject asciicompat_encoding(ThreadContext context, IRubyObject self, IRubyObject strOrEnc) {
  Ruby runtime = context.runtime;
  EncodingService encodingService = runtime.getEncodingService();
  
  Encoding encoding = encodingService.getEncodingFromObjectNoError(strOrEnc);
  
  if (encoding == null) {
    return context.nil;
  }
  
  if (encoding.isAsciiCompatible()) {
    return context.nil;
  }
  
  Encoding asciiCompat = NONASCII_TO_ASCII.get(encoding);
  
  if (asciiCompat == null) {
    throw runtime.newConverterNotFoundError("no ASCII compatible encoding found for " + strOrEnc);
  }
  
  return encodingService.convertEncodingToRubyEncoding(asciiCompat);
}

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

@JRubyMethod(compat = RUBY1_9, meta = true)
public static IRubyObject asciicompat_encoding(ThreadContext context, IRubyObject self, IRubyObject strOrEnc) {
  Ruby runtime = context.runtime;
  EncodingService encodingService = runtime.getEncodingService();
  
  Encoding encoding = encodingService.getEncodingFromObjectNoError(strOrEnc);
  
  if (encoding == null) {
    return context.nil;
  }
  
  if (encoding.isAsciiCompatible()) {
    return context.nil;
  }
  
  Encoding asciiCompat = NONASCII_TO_ASCII.get(encoding);
  
  if (asciiCompat == null) {
    throw runtime.newConverterNotFoundError("no ASCII compatible encoding found for " + strOrEnc);
  }
  
  return encodingService.convertEncodingToRubyEncoding(asciiCompat);
}

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

throw runtime.newConverterNotFoundError("code converter not found for " + encoding.toString());

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

throw runtime.newConverterNotFoundError("code converter not found for " + encoding.toString());

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

throw runtime.newConverterNotFoundError("code converter not found (" + srcEncoding + " to " + destEncoding + ")");
  throw runtime.newConverterNotFoundError("code converter not found (" + srcEncoding + " to " + destEncoding + ")");
} else {
  throw e;

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

throw runtime.newConverterNotFoundError("code converter not found (" + srcEncoding + " to " + destEncoding + ")");
  throw runtime.newConverterNotFoundError("code converter not found (" + srcEncoding + " to " + destEncoding + ")");
} else {
  throw e;

相关文章

微信公众号

最新文章

更多

Ruby类方法