Package org.jruby

Examples of org.jruby.RubyModule$Generation


import org.jruby.runtime.builtin.IRubyObject;

public class JavaProxyMethods {
    public static RubyModule createJavaProxyMethods(ThreadContext context) {
        Ruby runtime = context.getRuntime();
        RubyModule javaProxyMethods = runtime.defineModule("JavaProxyMethods");
       
        javaProxyMethods.addReadWriteAttribute(context, "java_object");
       
        javaProxyMethods.defineAnnotatedMethods(JavaProxyMethods.class);
       
        return javaProxyMethods;
    }
View Full Code Here


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

    public static RubyModule createJavaArrayUtilitiesModule(Ruby runtime) {
        RubyModule javaArrayUtils = runtime.defineModule("JavaArrayUtilities");
        javaArrayUtils.defineAnnotatedMethods(JavaArrayUtilities.class);
        return javaArrayUtils;
    }
View Full Code Here

    public Map<String, JavaClass> getNameClassMap() {
        return nameClassMap;
    }
   
    public RubyModule getJavaModule() {
        RubyModule module;
        if ((module = javaModule) != null) return module;
        return javaModule = runtime.fastGetModule("Java");
    }
View Full Code Here

        if ((module = javaModule) != null) return module;
        return javaModule = runtime.fastGetModule("Java");
    }
   
    public RubyModule getJavaUtilitiesModule() {
        RubyModule module;
        if ((module = javaUtilitiesModule) != null) return module;
        return javaUtilitiesModule = runtime.fastGetModule("JavaUtilities");
    }
View Full Code Here

        if ((module = javaUtilitiesModule) != null) return module;
        return javaUtilitiesModule = runtime.fastGetModule("JavaUtilities");
    }
   
    public RubyModule getJavaArrayUtilitiesModule() {
        RubyModule module;
        if ((module = javaArrayUtilitiesModule) != null) return module;
        return javaArrayUtilitiesModule = runtime.fastGetModule("JavaArrayUtilities");
    }
View Full Code Here

        if ((clazz = javaClassClass) != null) return clazz;
        return javaClassClass = getJavaModule().fastGetClass("JavaClass");
    }
   
    public RubyModule getJavaInterfaceTemplate() {
        RubyModule module;
        if ((module = javaInterfaceTemplate) != null) return module;
        return javaInterfaceTemplate = runtime.fastGetModule("JavaInterfaceTemplate");
    }
View Full Code Here

        if ((module = javaInterfaceTemplate) != null) return module;
        return javaInterfaceTemplate = runtime.fastGetModule("JavaInterfaceTemplate");
    }
   
    public RubyModule getPackageModuleTemplate() {
        RubyModule module;
        if ((module = packageModuleTemplate) != null) return module;
        return packageModuleTemplate = runtime.fastGetModule("JavaPackageModuleTemplate");
    }
View Full Code Here

        if (path.charAt(0) == '#') {
            String classOrModule = clazz.isClass() ? "class" : "module";
            throw clazz.getRuntime().newTypeError("can't dump anonymous " + classOrModule + " " + path);
        }
       
        RubyModule real = clazz.isModule() ? clazz : ((RubyClass)clazz).getRealClass();

        if (clazz.getRuntime().getClassFromPath(path) != real) {
            throw clazz.getRuntime().newTypeError(path + " can't be referred");
        }
        return path;
View Full Code Here

            cache.register(newObject);
        }
    }

    public static RubyModule getModuleFromPath(Ruby runtime, String path) {
        RubyModule value = runtime.getClassFromPath(path);
        if (!value.isModule()) throw runtime.newArgumentError(path + " does not refer module");
        return value;
    }
View Full Code Here

        if (!value.isModule()) throw runtime.newArgumentError(path + " does not refer module");
        return value;
    }

    public static RubyClass getClassFromPath(Ruby runtime, String path) {
        RubyModule value = runtime.getClassFromPath(path);
        if (!value.isClass()) throw runtime.newArgumentError(path + " does not refer class");
        return (RubyClass)value;
    }
View Full Code Here

TOP

Related Classes of org.jruby.RubyModule$Generation

Copyright © 2018 www.massapicom. 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.