Package org.jvnet.sorcerer.Tag

Examples of org.jvnet.sorcerer.Tag.MethodRef


                        // can't link to the constructor as it's synthetic
                        scan(nt.getIdentifier());
                    } else {
                        // TODO: the identifier tree might contain type parameters, packaga names, etc.
                        // we should visit those
                        gen.add(new MethodRef(sp, ep, PositionUtils.getLineNumber(lineMap, sp), PositionUtils.getColNumber(lineMap, sp), ee));
                    }
                }

                scan(nt.getEnclosingExpression());
                scan(nt.getArguments());
                scan(nt.getTypeArguments());
                scan(nt.getClassBody());

                return _;
            }


            // TODO: how is the 'super' or 'this' constructor invocation handled?

            /**
             * Method invocation of the form "exp.method()"
             */
            public Void visitMethodInvocation(MethodInvocationTree mi, Void _) {
                ExpressionTree ms = mi.getMethodSelect(); // PRIMARY.methodName portion
                Element e = TreeUtil.getElement(mi);
                if (e instanceof ExecutableElement) {// this check is needed in case the source code contains errors
                    ExecutableElement ee = (ExecutableElement) e;
                    Name methodName = ee.getSimpleName();
                    long ep = srcPos.getEndPosition(cu, ms);
                    if(ep>=0) {
                        // marker for the method name (and jump to definition)
                        long sp = ep - methodName.length();
                        gen.add(new MethodRef(sp, ep, PositionUtils.getLineNumber(lineMap, sp), PositionUtils.getColNumber(lineMap, sp), ee));
                    }
                }

                return super.visitMethodInvocation(mi,_);
            }
View Full Code Here

TOP

Related Classes of org.jvnet.sorcerer.Tag.MethodRef

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.