1 9 10 package org.jruby.runtime; 11 12 import org.jruby.Ruby; 13 import org.jruby.RubyClass; 14 import org.jruby.runtime.builtin.IRubyObject; 15 16 20 public interface ObjectAllocator { 21 public IRubyObject allocate(Ruby runtime, RubyClass klazz); 22 23 public static final ObjectAllocator NOT_ALLOCATABLE_ALLOCATOR = new ObjectAllocator() { 24 public IRubyObject allocate(Ruby runtime, RubyClass klass) { 25 throw runtime.newTypeError("Ruby \"" + klass.getName() + "\" object can not be allocated"); 26 } 27 }; 28 } 29 | Popular Tags |