Examples of defineAnnotatedMethods()


Examples of org.jruby.RubyClass.defineAnnotatedMethods()

    private RubyClass createXmlModule(Ruby ruby, RubyModule xmlModule) {
        RubyClass node = xmlModule.defineClassUnder("Node", ruby.getObject(), XML_NODE_ALLOCATOR);
        node.defineAnnotatedMethods(XmlNode.class);
       
        RubyClass attr = xmlModule.defineClassUnder("Attr", node, XML_ATTR_ALLOCATOR);
        attr.defineAnnotatedMethods(XmlAttr.class);
       
        RubyClass attrDecl = xmlModule.defineClassUnder("AttributeDecl", node, XML_ATTRIBUTE_DECL_ALLOCATOR);
        attrDecl.defineAnnotatedMethods(XmlAttributeDecl.class);
       
        RubyClass characterData = xmlModule.defineClassUnder("CharacterData", node, null);
View Full Code Here

Examples of org.jruby.RubyClass.defineAnnotatedMethods()

       
        RubyClass attr = xmlModule.defineClassUnder("Attr", node, XML_ATTR_ALLOCATOR);
        attr.defineAnnotatedMethods(XmlAttr.class);
       
        RubyClass attrDecl = xmlModule.defineClassUnder("AttributeDecl", node, XML_ATTRIBUTE_DECL_ALLOCATOR);
        attrDecl.defineAnnotatedMethods(XmlAttributeDecl.class);
       
        RubyClass characterData = xmlModule.defineClassUnder("CharacterData", node, null);
       
        RubyClass comment = xmlModule.defineClassUnder("Comment", characterData, XML_COMMENT_ALLOCATOR);
        comment.defineAnnotatedMethods(XmlComment.class);
View Full Code Here

Examples of org.jruby.RubyClass.defineAnnotatedMethods()

        attrDecl.defineAnnotatedMethods(XmlAttributeDecl.class);
       
        RubyClass characterData = xmlModule.defineClassUnder("CharacterData", node, null);
       
        RubyClass comment = xmlModule.defineClassUnder("Comment", characterData, XML_COMMENT_ALLOCATOR);
        comment.defineAnnotatedMethods(XmlComment.class);
       
        RubyClass text = xmlModule.defineClassUnder("Text", characterData, XML_TEXT_ALLOCATOR);
        text.defineAnnotatedMethods(XmlText.class);
       
        RubyModule cdata = xmlModule.defineClassUnder("CDATA", text, XML_CDATA_ALLOCATOR);
View Full Code Here

Examples of org.jruby.RubyClass.defineAnnotatedMethods()

       
        RubyClass comment = xmlModule.defineClassUnder("Comment", characterData, XML_COMMENT_ALLOCATOR);
        comment.defineAnnotatedMethods(XmlComment.class);
       
        RubyClass text = xmlModule.defineClassUnder("Text", characterData, XML_TEXT_ALLOCATOR);
        text.defineAnnotatedMethods(XmlText.class);
       
        RubyModule cdata = xmlModule.defineClassUnder("CDATA", text, XML_CDATA_ALLOCATOR);
        cdata.defineAnnotatedMethods(XmlCdata.class);
       
        RubyClass dtd = xmlModule.defineClassUnder("DTD", node, XML_DTD_ALLOCATOR);
View Full Code Here

Examples of org.jruby.RubyModule.defineAnnotatedMethods()

        RubyClass cBufferedIO = (RubyClass)mNet.getConstant("BufferedIO");
        cBufferedIO.defineAnnotatedMethods(NetProtocolBufferedIO.class);

        RubyModule mNativeImpl = cBufferedIO.defineModuleUnder("NativeImplementation");

        mNativeImpl.defineAnnotatedMethods(NativeImpl.class);
    }   

    @JRubyMethod(required = 1)
    public static IRubyObject initialize(IRubyObject recv, IRubyObject io) {
        if(io instanceof RubyIO &&
View Full Code Here

Examples of org.jruby.RubyModule.defineAnnotatedMethods()

    public static RubyModule createJavaModule(Ruby runtime) {
        ThreadContext context = runtime.getCurrentContext();
        RubyModule javaModule = runtime.defineModule("Java");
       
        javaModule.defineAnnotatedMethods(Java.class);

        JavaObject.createJavaObjectClass(runtime, javaModule);
        JavaArray.createJavaArrayClass(runtime, javaModule);
        JavaClass.createJavaClassClass(runtime, javaModule);
        JavaMethod.createJavaMethodClass(runtime, javaModule);
View Full Code Here

Examples of org.jruby.RubyModule.defineAnnotatedMethods()

        // The template for interface modules
        JavaInterfaceTemplate.createJavaInterfaceTemplateModule(context);

        RubyModule javaUtils = runtime.defineModule("JavaUtilities");
       
        javaUtils.defineAnnotatedMethods(JavaUtilities.class);

        runtime.getJavaSupport().setConcreteProxyCallback(new Callback() {
            public IRubyObject execute(IRubyObject recv, IRubyObject[] args, Block block) {
                Arity.checkArgumentCount(recv.getRuntime(), args, 1, 1);
               
View Full Code Here

Examples of org.jruby.RubyModule.defineAnnotatedMethods()

        RubyModule mReadline = runtime.defineModule("Readline");

        mReadline.dataWrapStruct(holder);

        mReadline.defineAnnotatedMethods(Readline.class);
        IRubyObject hist = runtime.getObject().callMethod(runtime.getCurrentContext(), "new");
        mReadline.fastSetConstant("HISTORY", hist);
        hist.getSingletonClass().includeModule(runtime.getEnumerable());
        hist.getSingletonClass().defineAnnotatedMethods(HistoryMethods.class);
View Full Code Here

Examples of org.jruby.RubyModule.defineAnnotatedMethods()

        Ruby runtime = context.getRuntime();
        RubyModule javaProxyMethods = runtime.defineModule("JavaProxyMethods");
       
        javaProxyMethods.addReadWriteAttribute(context, "java_object");
       
        javaProxyMethods.defineAnnotatedMethods(JavaProxyMethods.class);
       
        return javaProxyMethods;
    }
   
    @JRubyMethod
View Full Code Here

Examples of org.jruby.RubyModule.defineAnnotatedMethods()

@JRubyModule(name="JavaArrayUtilities")
public class JavaArrayUtilities {

    public static RubyModule createJavaArrayUtilitiesModule(Ruby runtime) {
        RubyModule javaArrayUtils = runtime.defineModule("JavaArrayUtilities");
        javaArrayUtils.defineAnnotatedMethods(JavaArrayUtilities.class);
        return javaArrayUtils;
    }
   
    @JRubyMethod(module = true, visibility = Visibility.PRIVATE)
    public static IRubyObject bytes_to_ruby_string(IRubyObject recv, IRubyObject wrappedObject) {
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.