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

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

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

RubyClass.<init>介绍

[英]used by CLASS_ALLOCATOR (any Class' class will be a Class!) also used to bootstrap Object class
[中]由类分配器使用(任何类的类都将是类!)也用于引导对象类

代码示例

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

public IRubyObject allocate(Ruby runtime, RubyClass klass) {
    RubyClass clazz = new RubyClass(runtime);
    clazz.allocator = ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR; // Class.allocate object is not allocatable before it is initialized
    return clazz;
  }
};

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

public IRubyObject allocate(Ruby runtime, RubyClass klass) {
    RubyClass clazz = new RubyClass(runtime);
    clazz.allocator = ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR; // Class.allocate object is not allocatable before it is initialized
    return clazz;
  }
};

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

public IRubyObject allocate(Ruby runtime, RubyClass klass) {
    RubyClass clazz = new RubyClass(runtime);
    clazz.allocator = ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR; // Class.allocate object is not allocatable before it is initialized
    return clazz;
  }
};

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

public IRubyObject allocate(Ruby runtime, RubyClass klass) {
    RubyClass clazz = new RubyClass(runtime);
    clazz.allocator = ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR; // Class.allocate object is not allocatable before it is initialized
    return clazz;
  }
};

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

/** boot_defclass
 * Create an initial Object meta class before Module and Kernel dependencies have
 * squirreled themselves together.
 *
 * @param runtime we need it
 * @return a half-baked meta class for object
 */
public static RubyClass createBootstrapClass(Ruby runtime, String name, RubyClass superClass, ObjectAllocator allocator) {
  RubyClass obj;
  if (superClass == null ) {  // boot the Object class
    obj = new RubyClass(runtime);
    obj.marshal = DEFAULT_OBJECT_MARSHAL;
  } else {                    // boot the Module and Class classes
    obj = new RubyClass(runtime, superClass);
  }
  obj.setAllocator(allocator);
  obj.setBaseName(name);
  return obj;
}

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

/** boot_defclass
 * Create an initial Object meta class before Module and Kernel dependencies have
 * squirreled themselves together.
 * 
 * @param runtime we need it
 * @return a half-baked meta class for object
 */
public static RubyClass createBootstrapClass(Ruby runtime, String name, RubyClass superClass, ObjectAllocator allocator) {
  RubyClass obj;
  if (superClass == null ) {  // boot the Object class 
    obj = new RubyClass(runtime);
    obj.marshal = DEFAULT_OBJECT_MARSHAL;
  } else {                    // boot the Module and Class classes
    obj = new RubyClass(runtime, superClass);
  }
  obj.setAllocator(allocator);
  obj.setBaseName(name);
  return obj;
}

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

/** boot_defclass
 * Create an initial Object meta class before Module and Kernel dependencies have
 * squirreled themselves together.
 *
 * @param runtime we need it
 * @return a half-baked meta class for object
 */
public static RubyClass createBootstrapClass(Ruby runtime, String name, RubyClass superClass, ObjectAllocator allocator) {
  RubyClass obj;
  if (superClass == null ) {  // boot the Object class
    obj = new RubyClass(runtime);
    obj.marshal = DEFAULT_OBJECT_MARSHAL;
  } else {                    // boot the Module and Class classes
    obj = new RubyClass(runtime, superClass);
  }
  obj.setAllocator(allocator);
  obj.setBaseName(name);
  return obj;
}

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

/** boot_defclass
 * Create an initial Object meta class before Module and Kernel dependencies have
 * squirreled themselves together.
 * 
 * @param runtime we need it
 * @return a half-baked meta class for object
 */
public static RubyClass createBootstrapClass(Ruby runtime, String name, RubyClass superClass, ObjectAllocator allocator) {
  RubyClass obj;
  if (superClass == null ) {  // boot the Object class 
    obj = new RubyClass(runtime);
    obj.marshal = DEFAULT_OBJECT_MARSHAL;
  } else {                    // boot the Module and Class classes
    obj = new RubyClass(runtime, superClass);
  }
  obj.setAllocator(allocator);
  obj.setBaseName(name);
  return obj;
}

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

/** 
 * Construct a new class with the given name scoped under Object (global)
 * and with Object as its immediate superclass.
 * Corresponds to rb_class_new in MRI.
 */
public static RubyClass newClass(Ruby runtime, RubyClass superClass) {
  if (superClass == runtime.getClassClass()) throw runtime.newTypeError("can't make subclass of Class");
  if (superClass.isSingleton()) throw runtime.newTypeError("can't make subclass of virtual class");
  return new RubyClass(runtime, superClass);        
}

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

/**
 * A variation on newClass that allow passing in an array of supplementary
 * call sites to improve dynamic invocation.
 */
public static RubyClass newClass(Ruby runtime, RubyClass superClass, CallSite[] extraCallSites) {
  if (superClass == runtime.getClassClass()) throw runtime.newTypeError("can't make subclass of Class");
  if (superClass.isSingleton()) throw runtime.newTypeError("can't make subclass of virtual class");
  return new RubyClass(runtime, superClass, extraCallSites);
}

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

/**
 * Construct a new class with the given name scoped under Object (global)
 * and with Object as its immediate superclass.
 * Corresponds to rb_class_new in MRI.
 */
public static RubyClass newClass(Ruby runtime, RubyClass superClass) {
  if (superClass == runtime.getClassClass()) throw runtime.newTypeError("can't make subclass of Class");
  if (superClass.isSingleton()) throw runtime.newTypeError("can't make subclass of virtual class");
  return new RubyClass(runtime, superClass);
}

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

/** 
 * A variation on newClass that allow passing in an array of supplementary
 * call sites to improve dynamic invocation.
 */
public static RubyClass newClass(Ruby runtime, RubyClass superClass, CallSite[] extraCallSites) {
  if (superClass == runtime.getClassClass()) throw runtime.newTypeError("can't make subclass of Class");
  if (superClass.isSingleton()) throw runtime.newTypeError("can't make subclass of virtual class");
  return new RubyClass(runtime, superClass, extraCallSites);        
}

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

/**
 * Construct a new class with the given name scoped under Object (global)
 * and with Object as its immediate superclass.
 * Corresponds to rb_class_new in MRI.
 */
public static RubyClass newClass(Ruby runtime, RubyClass superClass) {
  if (superClass == runtime.getClassClass()) throw runtime.newTypeError("can't make subclass of Class");
  if (superClass.isSingleton()) throw runtime.newTypeError("can't make subclass of virtual class");
  return new RubyClass(runtime, superClass);
}

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

/**
 * A variation on newClass that allow passing in an array of supplementary
 * call sites to improve dynamic invocation.
 */
public static RubyClass newClass(Ruby runtime, RubyClass superClass, CallSite[] extraCallSites) {
  if (superClass == runtime.getClassClass()) throw runtime.newTypeError("can't make subclass of Class");
  if (superClass.isSingleton()) throw runtime.newTypeError("can't make subclass of virtual class");
  return new RubyClass(runtime, superClass, extraCallSites);
}

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

/** 
 * Construct a new class with the given name scoped under Object (global)
 * and with Object as its immediate superclass.
 * Corresponds to rb_class_new in MRI.
 */
public static RubyClass newClass(Ruby runtime, RubyClass superClass) {
  if (superClass == runtime.getClassClass()) throw runtime.newTypeError("can't make subclass of Class");
  if (superClass.isSingleton()) throw runtime.newTypeError("can't make subclass of virtual class");
  return new RubyClass(runtime, superClass);        
}

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

/** 
 * A variation on newClass that allow passing in an array of supplementary
 * call sites to improve dynamic invocation.
 */
public static RubyClass newClass(Ruby runtime, RubyClass superClass, CallSite[] extraCallSites) {
  if (superClass == runtime.getClassClass()) throw runtime.newTypeError("can't make subclass of Class");
  if (superClass.isSingleton()) throw runtime.newTypeError("can't make subclass of virtual class");
  return new RubyClass(runtime, superClass, extraCallSites);        
}

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

dummyClass = new RubyClass(this, classClass);
dummyClass.freeze(tc);

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

dummyClass = new RubyClass(this, classClass);
dummyClass.freeze(context);

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

dummyClass = new RubyClass(this, classClass);
dummyClass.freeze(context);

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

dummyClass = new RubyClass(this, classClass);
dummyClass.freeze(tc);

相关文章

微信公众号

最新文章

更多

RubyClass类方法