org.jruby.RubyClass.defineAnnotatedConstants()方法的使用及代码示例

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

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

RubyClass.defineAnnotatedConstants介绍

暂无

代码示例

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

public static RubyClass createConverterTypeClass(Ruby runtime, RubyModule ffiModule) {
  final RubyClass Type = ffiModule.getClass("Type");
  RubyClass convClass = Type.defineClassUnder("Mapped", Type, ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
  convClass.defineAnnotatedMethods(MappedType.class);
  convClass.defineAnnotatedConstants(MappedType.class);
  return convClass;
}

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

public static RubyClass createAbstractInvokerClass(Ruby runtime, RubyModule module) {
  RubyClass result = module.defineClassUnder(CLASS_NAME,
      module.getClass("Pointer"),
      ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
  result.defineAnnotatedMethods(AbstractInvoker.class);
  result.defineAnnotatedConstants(AbstractInvoker.class);
  return result;
}

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

public static RubyClass createBufferClass(Ruby runtime, RubyModule module) {
  RubyClass result = module.defineClassUnder("Buffer",
      module.getClass(AbstractMemory.ABSTRACT_MEMORY_RUBY_CLASS),
      BufferAllocator.INSTANCE);
  result.defineAnnotatedMethods(Buffer.class);
  result.defineAnnotatedConstants(Buffer.class);
  return result;
}

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

public static RubyClass createAbstractMemoryClass(Ruby runtime, RubyModule module) {
  RubyClass result = module.defineClassUnder(ABSTRACT_MEMORY_RUBY_CLASS,
      runtime.getObject(),
      ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
  
  result.defineAnnotatedMethods(AbstractMemory.class);
  result.defineAnnotatedConstants(AbstractMemory.class);
  return result;
}

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

public static RubyClass createAbstractInvokerClass(Ruby runtime, RubyModule module) {
  RubyClass result = module.defineClassUnder(CLASS_NAME,
      module.getClass("Pointer"),
      ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
  result.defineAnnotatedMethods(AbstractInvoker.class);
  result.defineAnnotatedConstants(AbstractInvoker.class);
  return result;
}

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

public static RubyClass createAbstractMemoryClass(Ruby runtime, RubyModule module) {
  RubyClass result = module.defineClassUnder(ABSTRACT_MEMORY_RUBY_CLASS,
      runtime.getObject(),
      ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
  
  result.defineAnnotatedMethods(AbstractMemory.class);
  result.defineAnnotatedConstants(AbstractMemory.class);
  return result;
}

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

public static RubyClass createBufferClass(Ruby runtime, RubyModule module) {
  RubyClass result = module.defineClassUnder("Buffer",
      module.getClass(AbstractMemory.ABSTRACT_MEMORY_RUBY_CLASS),
      BufferAllocator.INSTANCE);
  result.defineAnnotatedMethods(Buffer.class);
  result.defineAnnotatedConstants(Buffer.class);
  return result;
}

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

public static RubyClass createVariadicInvokerClass(Ruby runtime, RubyModule module) {
  RubyClass result = module.defineClassUnder("VariadicInvoker",
      runtime.getObject(),
      ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
  result.defineAnnotatedMethods(VariadicInvoker.class);
  result.defineAnnotatedConstants(VariadicInvoker.class);
  return result;
}

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

public static RubyClass createFileDescriptorIOClass(Ruby runtime, RubyModule module) {
  RubyClass result = runtime.defineClassUnder(CLASS_NAME, runtime.getClass("IO"),
      Allocator.INSTANCE, module);
  result.defineAnnotatedMethods(FileDescriptorIO.class);
  result.defineAnnotatedConstants(FileDescriptorIO.class);
  return result;
}

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

public static RubyClass createInvokerClass(Ruby runtime, RubyModule module) {
  RubyClass result = module.defineClassUnder("Invoker",
      module.getClass("AbstractInvoker"),
      ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
  result.defineAnnotatedMethods(AbstractInvoker.class);
  result.defineAnnotatedMethods(JFFIInvoker.class);
  result.defineAnnotatedConstants(JFFIInvoker.class);
  return result;
}

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

public static RubyClass createFunctionClass(Ruby runtime, RubyModule module) {
  RubyClass result = module.defineClassUnder("Function",
      module.getClass("Pointer"),
      ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
  result.defineAnnotatedMethods(AbstractInvoker.class);
  result.defineAnnotatedMethods(Function.class);
  result.defineAnnotatedConstants(Function.class);
  return result;
}

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

public static RubyClass createFunctionClass(Ruby runtime, RubyModule module) {
  RubyClass result = module.defineClassUnder("Function",
      module.getClass("Pointer"),
      ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
  result.defineAnnotatedMethods(AbstractInvoker.class);
  result.defineAnnotatedMethods(Function.class);
  result.defineAnnotatedConstants(Function.class);
  return result;
}

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

public static RubyClass createStructByValueClass(Ruby runtime, RubyModule ffiModule) {
  final RubyClass Type = ffiModule.getClass("Type");
  RubyClass sbvClass = ffiModule.defineClassUnder("StructByValue", Type, ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
  sbvClass.defineAnnotatedMethods(StructByValue.class);
  sbvClass.defineAnnotatedConstants(StructByValue.class);
  Type.setConstant("Struct", sbvClass);
  return sbvClass;
}

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

public static RubyClass createEnumClass(Ruby runtime, RubyModule ffiModule) {
  RubyClass enumClass = ffiModule.defineClassUnder("Enum", runtime.getObject(),
      Allocator.INSTANCE);
  enumClass.defineAnnotatedMethods(Enum.class);
  enumClass.defineAnnotatedConstants(Enum.class);
  enumClass.includeModule(ffiModule.getConstant("DataConverter"));
  
  return enumClass;
}

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

public static RubyClass createStructByReferenceClass(Ruby runtime, RubyModule ffiModule) {
  RubyClass sbrClass = ffiModule.defineClassUnder("StructByReference", runtime.getObject(),
      ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
  sbrClass.defineAnnotatedMethods(StructByReference.class);
  sbrClass.defineAnnotatedConstants(StructByReference.class);
  sbrClass.includeModule(ffiModule.getConstant("DataConverter"));
  return sbrClass;
}

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

public static RubyClass createStructByReferenceClass(Ruby runtime, RubyModule ffiModule) {
  RubyClass sbrClass = ffiModule.defineClassUnder("StructByReference", runtime.getObject(),
      ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
  sbrClass.defineAnnotatedMethods(StructByReference.class);
  sbrClass.defineAnnotatedConstants(StructByReference.class);
  sbrClass.includeModule(ffiModule.getConstant("DataConverter"));
  return sbrClass;
}

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

public static RubyClass createDynamicLibraryClass(Ruby runtime, RubyModule module) {
  RubyClass result = module.defineClassUnder("DynamicLibrary",
      runtime.getObject(),
      ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
  RubyClass symClass = result.defineClassUnder("Symbol",
      module.getClass("Pointer"), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
  symClass.defineAnnotatedMethods(Symbol.class);
  result.defineAnnotatedMethods(DynamicLibrary.class);
  result.defineAnnotatedConstants(DynamicLibrary.class);
  return result;
}
private static final int getNativeLibraryFlags(IRubyObject rbFlags) {

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

public static RubyClass createDynamicLibraryClass(Ruby runtime, RubyModule module) {
  RubyClass result = module.defineClassUnder("DynamicLibrary",
      runtime.getObject(),
      ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
  RubyClass symClass = result.defineClassUnder("Symbol",
      module.getClass("Pointer"), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
  symClass.defineAnnotatedMethods(Symbol.class);
  result.defineAnnotatedMethods(DynamicLibrary.class);
  result.defineAnnotatedConstants(DynamicLibrary.class);
  return result;
}
private static final int getNativeLibraryFlags(IRubyObject rbFlags) {

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

public static RubyClass createDynamicLibraryClass(Ruby runtime, RubyModule module) {
  RubyClass result = module.defineClassUnder("DynamicLibrary",
      runtime.getObject(),
      ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
  RubyClass symClass = result.defineClassUnder("Symbol",
      module.getClass("Pointer"), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
  symClass.defineAnnotatedMethods(Symbol.class);
  result.defineAnnotatedMethods(DynamicLibrary.class);
  result.defineAnnotatedConstants(DynamicLibrary.class);
  return result;
}
private static final int getNativeLibraryFlags(IRubyObject rbFlags) {

代码示例来源: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;
}

相关文章

微信公众号

最新文章

更多

RubyClass类方法