Examples of fastGetModule()


Examples of org.jruby.Ruby.fastGetModule()

        RubyClass singleton = javaProxy.getSingletonClass();
       
        singleton.addReadWriteAttribute(context, "java_class");
       
        javaProxy.defineAnnotatedMethods(JavaProxy.class);
        javaProxy.includeModule(runtime.fastGetModule("JavaProxyMethods"));
       
        return javaProxy;
    }
   
    @JRubyMethod(frame = true, meta = true)
View Full Code Here

Examples of org.jruby.Ruby.fastGetModule()

        return SafeConstructorImpl.constructYamlBool(ctor,node) == Boolean.TRUE ? ((JRubyConstructor)ctor).runtime.getTrue() : ((JRubyConstructor)ctor).runtime.getFalse();
    }

    public static Object constructYamlOmap(final Constructor ctor, final Node node) {
        Ruby runtime = ((JRubyConstructor)ctor).runtime;
        RubyArray arr = (RubyArray)(runtime.fastGetModule("YAML").fastGetConstant("Omap").callMethod(runtime.getCurrentContext(),"new"));
        List l = (List)ctor.constructSequence(node);
        ctor.doRecursionFix(node, arr);
        for(Iterator iter = l.iterator();iter.hasNext();) {
            IRubyObject v = (IRubyObject)iter.next();
            if(v instanceof RubyHash) {
View Full Code Here

Examples of org.jruby.Ruby.fastGetModule()

                for(int i=0,j=nms.length;i<j;i++) {
                    objClass = (RubyModule)objClass.getConstant(nms[i]);
                }
            } catch(Exception e) {
                // No constant available, so we'll fall back on YAML::Object
                objClass = (RubyClass)runtime.fastGetModule("YAML").fastGetConstant("Object");
                final RubyHash vars = (RubyHash)(((JRubyConstructor)ctor).constructRubyMapping(node));
                return RuntimeHelpers.invoke(runtime.getCurrentContext(), objClass, "new", runtime.newString(tag), vars);
            }
        }
        final RubyClass theCls = (RubyClass)objClass;
View Full Code Here

Examples of org.jruby.Ruby.fastGetModule()

        return oo;
    }

    public static Object constructRubyStruct(final Constructor ctor, final String tag, final Node node) {
        final Ruby runtime = ((JRubyConstructor)ctor).runtime;
        RubyModule sClass = runtime.fastGetModule("Struct");
        RubyClass struct_type;
        String[] nms = tag.split("::");
        for(int i=0,j=nms.length;i<j && sClass != null;i++) {
            sClass = (RubyModule)sClass.getConstant(nms[i]);
        }
View Full Code Here

Examples of org.jruby.Ruby.fastGetModule()

            int i = 1;
            for(Iterator iter = val.entrySet().iterator();iter.hasNext();i++) {
                Map.Entry em = (Map.Entry)iter.next();
                params[i] = ((RubyString)em.getKey()).intern();
            }
            struct_type = RubyStruct.newInstance(runtime.fastGetModule("Struct"),params,Block.NULL_BLOCK);
        } else {
            struct_type = (RubyClass)sClass;
        }
        IRubyObject st = struct_type.callMethod(runtime.getCurrentContext(),"new");
        RubyArray members = RubyStruct.members(struct_type,Block.NULL_BLOCK);
View Full Code Here

Examples of org.jruby.Ruby.fastGetModule()

                for(int i=0,j=nms.length;i<j;i++) {
                    objClass = (RubyModule)objClass.getConstant(nms[i]);
                }
            } catch(Exception e) {
                // No constant available, so we'll fall back on YAML::Object
                objClass = (RubyClass)runtime.fastGetModule("YAML").fastGetConstant("Object");
                final RubyHash vars = (RubyHash)(((JRubyConstructor)ctor).constructRubyMapping(node));
                return RuntimeHelpers.invoke(runtime.getCurrentContext(), objClass, "new", runtime.newString(tag), vars);
            }
        }
        final RubyClass theCls = (RubyClass)objClass;
View Full Code Here

Examples of org.jruby.Ruby.fastGetModule()

            } else {
                ix = s1.indexOf("..");
                first = s1.substring(0,ix);
                second = s1.substring(ix+2);
            }
            IRubyObject fist = runtime.fastGetModule("YAML").callMethod(context,"load",runtime.newString(first));
            IRubyObject sic = runtime.fastGetModule("YAML").callMethod(context,"load",runtime.newString(second));
            return RubyRange.newRange(runtime, context, fist, sic, exc);
        } else {
            final Map vars = (Map)(ctor.constructMapping(node));
            IRubyObject beg = (IRubyObject)vars.get(runtime.newString("begin"));
View Full Code Here

Examples of org.jruby.Ruby.fastGetModule()

                ix = s1.indexOf("..");
                first = s1.substring(0,ix);
                second = s1.substring(ix+2);
            }
            IRubyObject fist = runtime.fastGetModule("YAML").callMethod(context,"load",runtime.newString(first));
            IRubyObject sic = runtime.fastGetModule("YAML").callMethod(context,"load",runtime.newString(second));
            return RubyRange.newRange(runtime, context, fist, sic, exc);
        } else {
            final Map vars = (Map)(ctor.constructMapping(node));
            IRubyObject beg = (IRubyObject)vars.get(runtime.newString("begin"));
            IRubyObject end = (IRubyObject)vars.get(runtime.newString("end"));
View Full Code Here

Examples of org.jruby.Ruby.fastGetModule()

    }

    public static Object findAndCreateFromCustomTagging(final Constructor ctor, final Node node) {
        String tag = node.getTag();
        Ruby runtime = ((JRubyConstructor)ctor).runtime;
        IRubyObject _cl = runtime.fastGetModule("YAML").callMethod(runtime.getCurrentContext(), "tagged_classes").callMethod(runtime.getCurrentContext(),"[]", runtime.newString(tag));
        if(!(_cl instanceof RubyClass)) {
            return null;
        }
        RubyClass clazz = (RubyClass)_cl;
        if(clazz != null && !clazz.isNil()) {
View Full Code Here

Examples of org.jruby.Ruby.fastGetModule()

        RubyClass singleton = javaProxy.getSingletonClass();
       
        singleton.addReadWriteAttribute(context, "java_class");
       
        javaProxy.defineAnnotatedMethods(JavaProxy.class);
        javaProxy.includeModule(runtime.fastGetModule("JavaProxyMethods"));
       
        return javaProxy;
    }

    // framed for invokeSuper
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.