Examples of searchMethod()


Examples of org.cx4a.rsense.ruby.RubyClass.searchMethod()

            List<CompletionCandidate> candidates = new ArrayList<CompletionCandidate>();
            for (IRubyObject receiver : context.typeSet) {
                RubyClass rubyClass = receiver.getMetaClass();
                for (String name : rubyClass.getMethods(true)) {
                    DynamicMethod method = rubyClass.searchMethod(name);
                    candidates.add(new CompletionCandidate(name,
                                                           method.toString(),
                                                           method.getModule().getMethodPath(null),
                                                           CompletionCandidate.Kind.METHOD));
                }
View Full Code Here

Examples of org.cx4a.rsense.ruby.RubyClass.searchMethod()

                    if (receiverType != null) {
                        SourceLocation location = null;

                        // Try to find method
                        // TODO callSuper
                        Method method = (Method) receiverType.searchMethod(realName);
                        if (method != null) {
                            if (method.getLocation() != null)
                                locations.add(method.getLocation());
                        } else {
                            // Try to find constant
View Full Code Here

Examples of org.jruby.RubyClass.searchMethod()

    public String definition(Ruby runtime, ThreadContext context, IRubyObject self, Block aBlock) {
        if (receiverNode.definition(runtime, context, self, aBlock) != null) {
            try {
                IRubyObject receiver = receiverNode.interpret(runtime, context, self, aBlock);
                RubyClass metaClass = receiver.getMetaClass();
                DynamicMethod method = metaClass.searchMethod(getName());
                Visibility visibility = method.getVisibility();
               
                if (visibility != Visibility.PRIVATE &&
                        (visibility != Visibility.PROTECTED || metaClass.getRealClass().isInstance(self))) {
                    if (!method.isUndefined()) {
View Full Code Here

Examples of org.jruby.RubyClass.searchMethod()

    public String definition(Ruby runtime, ThreadContext context, IRubyObject self, Block aBlock) {
       if (getReceiverNode().definition(runtime, context, self, aBlock) != null) {
            try {
                IRubyObject receiver = getReceiverNode().interpret(runtime, context, self, aBlock);
                RubyClass metaClass = receiver.getMetaClass();
                DynamicMethod method = metaClass.searchMethod(getName());
                Visibility visibility = method.getVisibility();
               
                if (visibility != Visibility.PRIVATE &&
                        (visibility != Visibility.PROTECTED || metaClass.getRealClass().isInstance(self))) {
                    return !method.isUndefined() ? "method" : null;
View Full Code Here

Examples of org.jruby.RubyClass.searchMethod()

    public String definition(Ruby runtime, ThreadContext context, IRubyObject self, Block aBlock) {
        if (receiverNode.definition(runtime, context, self, aBlock) != null) {
            try {
                IRubyObject receiver = receiverNode.interpret(runtime, context, self, aBlock);
                RubyClass metaClass = receiver.getMetaClass();
                DynamicMethod method = metaClass.searchMethod(name);
                Visibility visibility = method.getVisibility();

                if (visibility != Visibility.PRIVATE &&
                        (visibility != Visibility.PROTECTED || metaClass.getRealClass().isInstance(self))) {
                    if (metaClass.isMethodBound(name, false)) {
View Full Code Here

Examples of org.jruby.RubyClass.searchMethod()

                // list of interfaces we implement
                singleton.addReadAttribute(context, "java_interfaces");
               
                // We capture the original "new" and make it private
                DynamicMethod newMethod = singleton.searchMethod("new").dup();
                singleton.addMethod("__jredef_new", newMethod);
                newMethod.setVisibility(Visibility.PRIVATE);

                // The replacement "new" allocates and inits the Ruby object as before, but
                // also instantiates our proxified Java object by calling __jcreate!
View Full Code Here

Examples of org.jruby.RubyClass.searchMethod()

            }
        });
       
        RubyClass singleton = concreteJavaProxy.getSingletonClass();
       
        final DynamicMethod oldNew = singleton.searchMethod("new");
       
        singleton.addMethod("new", new ConcreteNewMethod(singleton, Visibility.PUBLIC, oldNew));
       
        concreteJavaProxy.addMethod("initialize", new org.jruby.internal.runtime.methods.JavaMethod(concreteJavaProxy, Visibility.PUBLIC) {
            @Override
View Full Code Here

Examples of org.jruby.RubyClass.searchMethod()

            }
        });
       
        RubyClass singleton = arrayJavaProxy.getSingletonClass();
       
        final DynamicMethod oldNew = singleton.searchMethod("new");
       
        singleton.addMethod("new", new ArrayNewMethod(singleton, Visibility.PUBLIC, oldNew));
       
        arrayJavaProxy.defineAnnotatedMethods(ArrayJavaProxy.class);
        arrayJavaProxy.includeModule(runtime.getEnumerable());
View Full Code Here

Examples of org.jruby.RubyClass.searchMethod()

                if (field == null) {
                    // do nothing, it's a non-impl method
                } else {
                    try {
                        field.set(null, selfClass.searchMethod(methodName));
                    } catch (IllegalAccessException iae) {
                        throw error(ruby, iae, "Could not set new method into field: " + selfClass + "." + methodName);
                    } catch (IllegalArgumentException iae) {
                        throw error(ruby, iae, "Could not set new method into field: " + selfClass + "." + methodName);
                    }
View Full Code Here

Examples of org.jruby.RubyClass.searchMethod()

                if (field == null) {
                    // do nothing, it's a non-impl method
                } else {
                    try {
                        synchronized (self) {
                            DynamicMethod method = selfClass.searchMethod(methodName);
                            if (method != UndefinedMethod.INSTANCE) {
                                field.set(null, method);
                            }
                        }
                    } catch (IllegalAccessException iae) {
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.