use of org.robobinding.codegen.presentationmodel.ItemPresentationModelObjectClassGen in project RoboBinding by RoboBinding.
the class PresentationModelProcessor method createItemPresentationModelObjectSourceFiles.
private void createItemPresentationModelObjectSourceFiles(PresentationModelInfo presentationModelInfo, ProcessingContext context) throws JClassAlreadyExistsException, IOException {
for (DataSetPropertyInfo info : presentationModelInfo.dataSetProperties()) {
if (processedItemPresentationModels.contains(info.itemPresentationModelTypeName())) {
continue;
}
WrappedTypeElement typeElement = context.typeElementOf(info.itemPresentationModelTypeName());
PresentationModelInfoBuilder builder = new PresentationModelInfoBuilder(typeElement, info.itemPresentationModelObjectTypeName(), true);
PresentationModelInfo itemPresentationModelInfo = builder.build();
Logger log = typeElement.logger();
try {
ItemPresentationModelObjectClassGen gen = new ItemPresentationModelObjectClassGen(itemPresentationModelInfo);
run(gen);
gen.writeTo(createOutput());
log.info("ItemPresentationModel '" + itemPresentationModelInfo.getPresentationModelObjectTypeName() + "' generated.");
} catch (java.lang.NoClassDefFoundError e) {
RuntimeException error = new RuntimeException("an error occured when generating source code for '" + presentationModelInfo.getPresentationModelObjectTypeName() + "'", e);
log.error(error);
throw error;
}
processedItemPresentationModels.add(info.itemPresentationModelTypeName());
}
}
Aggregations