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;
}
Aggregations