use of org.jboss.forge.roaster.model.source.JavaInterfaceSource in project Entitas-Java by Rubentxu.
the class ComponentIndicesGenerator method addComponentFactories.
public void addComponentFactories(ComponentInfo[] componentInfos, JavaClassSource javaClass) {
String format = " %1$s.class,\n";
String code = "return new FactoryComponent[] {";
for (int i = 0; i < componentInfos.length; i++) {
ComponentInfo info = componentInfos[i];
JavaInterfaceSource interfaceSource = Roaster.parse(JavaInterfaceSource.class, String.format("public interface Factory%1$s extends FactoryComponent {}", info.typeName));
interfaceSource.addMethod().setName(String.format("create%1$s", info.typeName)).setReturnType(info.typeName).setPublic();
javaClass.addNestedType(interfaceSource.toString());
}
}
Aggregations