Package com.redhat.ceylon.compiler.loader.model

Examples of com.redhat.ceylon.compiler.loader.model.JavaMethod


    }

    private Method addMethod(ClassOrInterface klass, MethodMirror methodMirror, ClassMirror classMirror,
                             boolean isCeylon, boolean isOverloaded) {
       
        JavaMethod method = new JavaMethod(methodMirror);
        String methodName = methodMirror.getName();
       
        method.setContainer(klass);
        method.setScope(klass);
        method.setRealName(methodName);
        method.setUnit(klass.getUnit());
        method.setOverloaded(isOverloaded || isOverloadingMethod(methodMirror));
        ProducedType type = null;
        try{
            setMethodOrValueFlags(klass, methodMirror, method, isCeylon);
        }catch(ModelResolutionException x){
            // collect an error in its type
            type = logModelResolutionException(x, klass, "method '"+methodMirror.getName()+"' (checking if it is an overriding method");
        }
        if(methodName.equals("hash")
                || methodName.equals("string"))
            method.setName(methodName+"_method");
        else
            method.setName(Util.strip(methodName, isCeylon, method.isShared()));
        method.setDefaultedAnnotation(methodMirror.isDefault());

        // type params first
        setTypeParameters(method, methodMirror, isCeylon);

        // and its return type
        // do not log an additional error if we had one from checking if it was overriding
        if(type == null)
            type = obtainType(methodMirror.getReturnType(), methodMirror, method, Decl.getModuleContainer(method), VarianceLocation.COVARIANT,
                              "method '"+methodMirror.getName()+"'", klass);
        method.setType(type);
       
        // now its parameters
        if(isEqualsMethod(methodMirror))
            setEqualsParameters(method, methodMirror);
        else
            setParameters(method, methodMirror, isCeylon, klass);
       
        method.setUncheckedNullType((!isCeylon && !methodMirror.getReturnType().isPrimitive()) || isUncheckedNull(methodMirror));
        type.setRaw(isRaw(Decl.getModuleContainer(klass), methodMirror.getReturnType()));
        markDeclaredVoid(method, methodMirror);
        markUnboxed(method, methodMirror, methodMirror.getReturnType());
        markTypeErased(method, methodMirror, methodMirror.getReturnType());
        markUntrustedType(method, methodMirror, methodMirror.getReturnType());
View Full Code Here

TOP

Related Classes of com.redhat.ceylon.compiler.loader.model.JavaMethod

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.