return type;
}
private MethodDeclaration createFactoryMethod(NamedType objectType) {
assert objectType != null;
JavadocBuilder javadoc = new JavadocBuilder(factory);
javadoc.inline(flowClass.getDocumentation());
List<FormalParameterDeclaration> parameters = Lists.create();
List<Expression> arguments = Lists.create();
List<Expression> inputMetaData = Lists.create();
for (OperatorPortDeclaration var : flowClass.getInputPorts()) {
SimpleName name = factory.newSimpleName(var.getName());
javadoc.param(name).inline(var.getDocumentation());
parameters.add(util.toFactoryMethodInput(var, name));
inputMetaData.add(util.toMetaData(var, arguments.size()));
arguments.add(name);
}
List<Expression> outputMetaData = Lists.create();
for (OperatorPortDeclaration var : flowClass.getOutputPorts()) {
outputMetaData.add(util.toMetaData(var, -1));
}
List<Expression> parameterMetaData = Lists.create();
for (OperatorPortDeclaration var : flowClass.getParameters()) {
SimpleName name = factory.newSimpleName(var.getName());
javadoc.param(name).inline(var.getDocumentation());
parameters.add(factory.newFormalParameterDeclaration(
util.t(var.getType().getRepresentation()),
name));
parameterMetaData.add(util.toMetaData(var, arguments.size()));
arguments.add(name);
}
Type type = getType(objectType);
javadoc.returns().text("生成した演算子オブジェクト");
javadoc.seeType(util.t(flowClass.getElement()));
return factory.newMethodDeclaration(
javadoc.toJavadoc(),
new AttributeBuilder(factory)
.annotation(util.t(OperatorInfo.class),
"kind", factory.newClassLiteral(util.t(FlowPart.class)),
"input", factory.newArrayInitializer(inputMetaData),
"output", factory.newArrayInitializer(outputMetaData),