Search in sources :

Example 1 with ComposedFParInfo

use of org.eclipse.n4js.scoping.members.ComposedMemberInfo.ComposedFParInfo in project n4js by eclipse.

the class MethodFactory method create.

@Override
public TMethod create(String name) {
    TMethod method = TypesFactory.eINSTANCE.createTMethod();
    method.setComposed(true);
    method.setDeclaredMemberAccessModifier(getAccessability());
    method.setName(name);
    TypeUtils.setMemberTypeRef(method, getReturnTypeRefComposition());
    if (!fpas.isEmpty()) {
        boolean variFparNecessary = cma.isVariadicButLastFParIsDifferent();
        if (variFparNecessary) {
            List<ComposedFParInfo> fpAggrs = cma.getFParAggregates();
            ComposedFParInfo lastFPAggr = fpAggrs.get(cma.getFParAggregates().size() - 1);
            List<TypeRef> variadicTypeRefs = lastFPAggr.getTypeRefsVariadicAccumulated();
            MethodFParFactory varpar = new NewLastVariadicFPar(variadicTypeRefs);
            fpas.add(varpar);
        }
    }
    for (MethodFParFactory currFparDesc : fpas) {
        TFormalParameter tFPar = currFparDesc.create();
        method.getFpars().add(tFPar);
    }
    return method;
}
Also used : TFormalParameter(org.eclipse.n4js.ts.types.TFormalParameter) TMethod(org.eclipse.n4js.ts.types.TMethod) ComposedFParInfo(org.eclipse.n4js.scoping.members.ComposedMemberInfo.ComposedFParInfo) TypeRef(org.eclipse.n4js.ts.typeRefs.TypeRef)

Aggregations

ComposedFParInfo (org.eclipse.n4js.scoping.members.ComposedMemberInfo.ComposedFParInfo)1 TypeRef (org.eclipse.n4js.ts.typeRefs.TypeRef)1 TFormalParameter (org.eclipse.n4js.ts.types.TFormalParameter)1 TMethod (org.eclipse.n4js.ts.types.TMethod)1