Package org.jruby

Examples of org.jruby.RubyClass.defineAnnotatedMethods()


    }
    public static RubyClass createStructLayoutBuilderClass(Ruby runtime) {
        RubyModule parent = FFIProvider.getModule(runtime);
        RubyClass result = runtime.defineClassUnder(CLASS_NAME, runtime.getObject(),
                Allocator.INSTANCE, parent);
        result.defineAnnotatedMethods(StructLayoutBuilder.class);
        result.defineAnnotatedConstants(StructLayoutBuilder.class);

        return result;
    }
    StructLayoutBuilder(Ruby runtime) {
View Full Code Here


        Ruby runtime = context.getRuntime();
        RubyModule javaInterfaceTemplate = runtime.defineModule("JavaInterfaceTemplate");

        RubyClass singleton = javaInterfaceTemplate.getSingletonClass();
        singleton.addReadAttribute(context, "java_class");
        singleton.defineAnnotatedMethods(JavaInterfaceTemplate.class);

        return javaInterfaceTemplate;
    }

    // not intended to be called directly by users (private)
View Full Code Here

    public static RubyClass createInvokerClass(Ruby runtime) {
        RubyModule module = FFIProvider.getModule(runtime);
        RubyClass result = module.defineClassUnder(CLASS_NAME,
                runtime.getObject(),
                ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
        result.defineAnnotatedMethods(Invoker.class);
        result.defineAnnotatedConstants(Invoker.class);

        return result;
    }
View Full Code Here

    }
    public static RubyClass createFileDescriptorIOClass(Ruby runtime) {
        RubyModule parent = FFIProvider.getModule(runtime);
        RubyClass result = runtime.defineClassUnder(CLASS_NAME, runtime.fastGetClass("IO"),
                Allocator.INSTANCE, parent);
        result.defineAnnotatedMethods(FileDescriptorIO.class);
        result.defineAnnotatedConstants(FileDescriptorIO.class);

        return result;
    }
    @JRubyMethod(name = "new", meta = true)
View Full Code Here

        RubyModule module = FFIProvider.getModule(runtime);
        RubyClass result = module.defineClassUnder(className,
                module.getClass(AbstractMemory.ABSTRACT_MEMORY_RUBY_CLASS),
                ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
       
        result.defineAnnotatedMethods(AbstractMemoryPointer.class);
        result.defineAnnotatedConstants(AbstractMemoryPointer.class);

        return result;
    }
   
View Full Code Here

    public static RubyClass createCallbackClass(Ruby runtime) {
        RubyModule module = FFIProvider.getModule(runtime);
        RubyClass result = module.defineClassUnder(CLASS_NAME,
                runtime.getObject(),
                ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
        result.defineAnnotatedMethods(Callback.class);
        result.defineAnnotatedConstants(Callback.class);

        return result;
    }
    /**
 
View Full Code Here

        RubyModule module = FFIProvider.getModule(runtime);
        RubyClass result = module.defineClassUnder(ABSTRACT_BUFFER_RUBY_CLASS,
                module.getClass(AbstractMemory.ABSTRACT_MEMORY_RUBY_CLASS),
                ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
       
        result.defineAnnotatedMethods(AbstractBuffer.class);
        result.defineAnnotatedConstants(AbstractBuffer.class);

        return result;
    }
    protected AbstractBuffer(Ruby runtime, RubyClass klass, MemoryIO io, long offset, long size) {
View Full Code Here

    public static RubyClass createMemoryPointerClass(Ruby runtime) {
        RubyModule module = FFIProvider.getModule(runtime);
        RubyClass result = module.defineClassUnder(MEMORY_POINTER_NAME,
                module.getClass(AbstractMemoryPointer.className),
                ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
        result.defineAnnotatedMethods(JNAMemoryPointer.class);
        result.defineAnnotatedConstants(JNAMemoryPointer.class);

        return result;
    }
   
View Full Code Here

            RubyClass result = javaProxyModule.defineClassUnder("JavaProxyMethod",
                    runtime.getObject(), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);

            JavaProxyReflectionObject.registerRubyMethods(runtime, result);

            result.defineAnnotatedMethods(ProxyMethodImpl.class);

            return result;
        }

        public RubyObject name() {
View Full Code Here

    public static RubyClass createProviderClass(Ruby runtime) {
        RubyModule module = FFIProvider.getModule(runtime);
        RubyClass result = module.defineClassUnder(CLASS_NAME,
                runtime.getObject(),
                ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
        result.defineAnnotatedMethods(FFIProvider.class);
        result.defineAnnotatedConstants(FFIProvider.class);

        return result;
    }
    protected FFIProvider(Ruby runtime, RubyClass klass) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.