Package com.sun.tools.javac.code.Symbol

Examples of com.sun.tools.javac.code.Symbol.MethodSymbol


        return classSymbol;
    }

    private MethodSymbol getOverriddenMethod(MethodSymbol method, Types types) {
        try{
            MethodSymbol impl = null;
            // interfaces have a different way to work
            if(method.owner.isInterface())
                return (MethodSymbol) implemented(method, method.owner.type.tsym, types);
            for (Type superType = types.supertype(method.owner.type);
                    impl == null && superType.tsym != null;
View Full Code Here


        log.error("ceylon", message);
    }

    @Override
    protected boolean isOverridingMethod(MethodMirror methodSymbol) {
        final MethodSymbol method = ((JavacMethod)methodSymbol).methodSymbol;
        if (method.owner.getQualifiedName().contentEquals("ceylon.language.Identifiable")) {
            if (method.name.contentEquals("equals") || method.name.contentEquals("hashCode")) {
                return true;
            }
        }
View Full Code Here

        return getOverriddenMethod(method, types) != null;
    }

    @Override
    protected boolean isOverloadingMethod(MethodMirror methodMirror) {
        final MethodSymbol method = ((JavacMethod)methodMirror).methodSymbol;
        return isOverloadingMethod(method);
    }
View Full Code Here

        java.util.List<Symbol> enclosedElements = getEnclosedElements(invTarget, cut, stmt);
        Symbol s = contains(enclosedElements, typeParams, mName, args);
        if (s != null) {
            return (MethodSymbol) s;
        }
        MethodSymbol ms = (MethodSymbol) contains(elementUtils.getAllMembers((TypeElement) invTarget), typeParams, mName, args);
        if (ms == null) {
            throw new NoSuchElementException(mi.toString());
        }
        return ms;
    }
View Full Code Here

            }
            accessor = getAccessor((JCFieldAccess) fa.selected, cut, stmt);
            return getSymbol(((JCFieldAccess) fa.selected).name, accessor, cut, stmt);
        }
        if (fa.selected instanceof JCMethodInvocation) {
            MethodSymbol s = getSymbol((JCMethodInvocation) fa.selected, cut, stmt);
            Type returnType = s.getReturnType();
            return returnType.asElement();
        } else if (fa.selected instanceof JCArrayTypeTree) {
            JCArrayTypeTree arr = (JCArrayTypeTree) fa.selected;
            return getSymbol(arr.elemtype, cut, stmt);
        } else if (fa.selected instanceof JCArrayAccess) {
View Full Code Here

            final JCNewClass nc = (JCNewClass) mi.meth;
            final JCExpression clas = nc.clazz;
            Symbol symbol = getSymbol(cut, stmt, mi.typeargs, getName(clas), mi.args);
            return symbol;
        } else if (mi.meth instanceof JCMethodInvocation) {
            MethodSymbol symbol = getSymbol(mi, cut, stmt);
            final Type returnType = symbol.getReturnType();
            return returnType.tsym;
        }
        throw new NoSuchElementException(mi.toString());
    }
View Full Code Here

            if (args != null) { //isEmpty means empty-args method
                final List<VarSymbol> formalArgs;
                List<TypeSymbol> formalTypeParams;
                final boolean varArgs;
                if (e.getKind().equals(ElementKind.METHOD) || e.getKind().equals(ElementKind.CONSTRUCTOR)) {
                    MethodSymbol me = (MethodSymbol) e;
                    formalArgs = me.getParameters();
                    formalTypeParams = me.getTypeParameters();
                    varArgs = me.isVarArgs();
                } else {
                    formalArgs = null;
                    formalTypeParams = null;
                    varArgs = false;
                }
View Full Code Here

        java.util.List<Symbol> enclosedElements = getEnclosedElements(invTarget);
        Symbol s = contains(enclosedElements, typeParams, mName, args);
        if (s != null) {
            return (MethodSymbol) s;
        }
        MethodSymbol ms = (MethodSymbol) contains(elementUtils.getAllMembers((TypeElement) invTarget), typeParams, mName, args);
        if (ms == null) {
            throw new NoSuchElementException(mi.toString());
        }
        return ms;
    }
View Full Code Here

            }
            accessor = getAccessor((JCFieldAccess) fa.selected, cut, n);
            return getSymbol(((JCFieldAccess) fa.selected).name, accessor, cut, n, false);
        }
        if (fa.selected instanceof JCMethodInvocation) {
            MethodSymbol s = (MethodSymbol) getSymbol(fa.selected, cut, n);
            Type returnType = s.getReturnType();
            return returnType.asElement();
        } else if (fa.selected instanceof JCArrayTypeTree) {
            JCArrayTypeTree arr = (JCArrayTypeTree) fa.selected;
            return getSymbol(arr.elemtype, cut, n);
        } else if (fa.selected instanceof JCArrayAccess) {
View Full Code Here

            final JCNewClass nc = (JCNewClass) mi.meth;
            final JCExpression clas = nc.clazz;
            Symbol symbol = getSymbol(cut, n, mi.typeargs, getName(clas), mi.args);
            return symbol;
        } else if (mi.meth instanceof JCMethodInvocation) {
            MethodSymbol symbol = getSymbol(mi, cut, n);
            final Type returnType = symbol.getReturnType();
            return returnType.tsym;
        }
        throw new NoSuchElementException(mi.toString());
    }
View Full Code Here

TOP

Related Classes of com.sun.tools.javac.code.Symbol.MethodSymbol

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.