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

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

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

Ruby.getEncoding介绍

暂无

代码示例

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

private RubyEncoding(Ruby runtime, ByteList name, Encoding encoding, boolean isDummy) {
  super(runtime, runtime.getEncoding());
  this.name = name;
  this.isDummy = isDummy;
  this.encoding = encoding;
  this.constant = OptoFactory.newConstantWrapper(RubyEncoding.class, this);
}

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

private RubyEncoding(Ruby runtime, ByteList name, Encoding encoding, boolean isDummy) {
  super(runtime, runtime.getEncoding());
  this.name = name;
  this.isDummy = isDummy;
  this.encoding = encoding;
  this.constant = OptoFactory.newConstantWrapper(RubyEncoding.class, this);
}

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

private RubyEncoding(Ruby runtime, byte[] name, Encoding encoding, boolean isDummy) {
  super(runtime, runtime.getEncoding());
  this.name = new ByteList(name);
  this.isDummy = isDummy;
  this.encoding = encoding;
}

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

private RubyEncoding(Ruby runtime, byte[] name, int p, int end, boolean isDummy) {
  super(runtime, runtime.getEncoding());
  this.name = new ByteList(name, p, end);
  this.isDummy = isDummy;
}

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

private RubyEncoding(Ruby runtime, byte[] name, int p, int end, boolean isDummy) {
  super(runtime, runtime.getEncoding());
  this.name = new ByteList(name, p, end);
  this.isDummy = isDummy;
}

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

private RubyEncoding(Ruby runtime, byte[] name, Encoding encoding, boolean isDummy) {
  super(runtime, runtime.getEncoding());
  this.name = new ByteList(name);
  this.isDummy = isDummy;
  this.encoding = encoding;
}

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

private void defineEncodingConstant(Ruby runtime, RubyEncoding encoding, byte[]constName,
    int constP, int constEnd) {
  runtime.getEncoding().defineConstant(new String(constName, constP , constEnd), encoding);
}

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

private void defineEncodingConstant(Ruby runtime, RubyEncoding encoding, String constName) {
  runtime.getEncoding().defineConstant(constName, encoding);
}

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

private void defineEncodingConstant(Ruby runtime, RubyEncoding encoding, byte[]constName,
    int constP, int constEnd) {
  runtime.getEncoding().defineConstant(new String(constName, constP , constEnd), encoding);
}

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

private void defineEncodingConstant(Ruby runtime, RubyEncoding encoding, String constName) {
  runtime.getEncoding().defineConstant(constName, encoding);
}

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

private RubyEncoding(Ruby runtime, Encoding encoding) {
  super(runtime, runtime.getEncoding());
  this.name = new ByteList(encoding.getName());
  this.isDummy = false;
  this.encoding = encoding;
}

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

private RubyEncoding(Ruby runtime, Encoding encoding) {
  super(runtime, runtime.getEncoding());
  this.name = new ByteList(encoding.getName());
  this.isDummy = false;
  this.encoding = encoding;
}

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

@JRubyMethod(name = "foreach", meta = true)
public static IRubyObject foreach(ThreadContext context, IRubyObject recv, IRubyObject path, IRubyObject enc, Block block) {
  RubyEncoding encoding;
  if (enc instanceof RubyEncoding) {
    encoding = (RubyEncoding) enc;
  } else {
    throw context.runtime.newTypeError(enc, context.runtime.getEncoding());
  }
  return foreachCommon(context, recv, RubyFile.get_path(context, path), encoding, block);
}

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

@JRubyMethod(name = "foreach", meta = true)
public static IRubyObject foreach(ThreadContext context, IRubyObject recv, IRubyObject path, IRubyObject enc, Block block) {
  RubyEncoding encoding;
  if (enc instanceof RubyEncoding) {
    encoding = (RubyEncoding) enc;
  } else {
    throw context.runtime.newTypeError(enc, context.runtime.getEncoding());
  }
  return foreachCommon(context, recv, RubyFile.get_path(context, path), encoding, block);
}

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

@JRubyMethod(name = "each")
public IRubyObject each(ThreadContext context, IRubyObject encoding, Block block) {
  if (!(encoding instanceof RubyEncoding)) throw context.runtime.newTypeError(encoding, context.runtime.getEncoding());
  return block.isGiven() ? each(context, ((RubyEncoding) encoding).getEncoding(), block) : enumeratorize(context.runtime, this, "each", encoding);
}

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

@JRubyMethod(name = "each")
public IRubyObject each(ThreadContext context, IRubyObject encoding, Block block) {
  if (!(encoding instanceof RubyEncoding)) throw context.runtime.newTypeError(encoding, context.runtime.getEncoding());
  return block.isGiven() ? each(context, ((RubyEncoding) encoding).getEncoding(), block) : enumeratorize(context.runtime, this, "each", encoding);
}

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

public static RubyClass createConverterClass(Ruby runtime) {
  RubyClass converterc = runtime.defineClassUnder("Converter", runtime.getClass("Data"), CONVERTER_ALLOCATOR, runtime.getEncoding());
  runtime.setConverter(converterc);
  converterc.index = ClassIndex.CONVERTER;
  converterc.setReifiedClass(RubyConverter.class);
  converterc.kindOf = new RubyModule.JavaClassKindOf(RubyConverter.class);
  converterc.defineAnnotatedMethods(RubyConverter.class);
  converterc.defineAnnotatedConstants(RubyConverter.class);
  return converterc;
}

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

public static RubyClass createConverterClass(Ruby runtime) {
  RubyClass converterc = runtime.defineClassUnder("Converter", runtime.getClass("Data"), CONVERTER_ALLOCATOR, runtime.getEncoding());
  runtime.setConverter(converterc);
  converterc.index = ClassIndex.CONVERTER;
  converterc.setReifiedClass(RubyConverter.class);
  converterc.kindOf = new RubyModule.JavaClassKindOf(RubyConverter.class);
  converterc.defineAnnotatedMethods(RubyConverter.class);
  converterc.defineAnnotatedConstants(RubyConverter.class);
  return converterc;
}

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

public static RubyClass createConverterClass(Ruby runtime) {
  RubyClass converterc = runtime.defineClassUnder("Converter", runtime.getData(), CONVERTER_ALLOCATOR, runtime.getEncoding());
  runtime.setConverter(converterc);
  converterc.setClassIndex(ClassIndex.CONVERTER);
  converterc.setReifiedClass(RubyConverter.class);
  converterc.kindOf = new RubyModule.JavaClassKindOf(RubyConverter.class);
  converterc.defineAnnotatedMethods(RubyConverter.class);
  converterc.defineAnnotatedConstants(RubyConverter.class);
  return converterc;
}

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

public static RubyClass createConverterClass(Ruby runtime) {
  RubyClass converterc = runtime.defineClassUnder("Converter", runtime.getData(), CONVERTER_ALLOCATOR, runtime.getEncoding());
  runtime.setConverter(converterc);
  converterc.setClassIndex(ClassIndex.CONVERTER);
  converterc.setReifiedClass(RubyConverter.class);
  converterc.kindOf = new RubyModule.JavaClassKindOf(RubyConverter.class);
  converterc.defineAnnotatedMethods(RubyConverter.class);
  converterc.defineAnnotatedConstants(RubyConverter.class);
  return converterc;
}

相关文章

Ruby类方法