use of org.robobinding.codegen.presentationmodel.DataSetPropertyInfo 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());
}
}
use of org.robobinding.codegen.presentationmodel.DataSetPropertyInfo in project RoboBinding by RoboBinding.
the class PresentationModelItemInfoProcessor method generateAllClasses.
@Override
protected void generateAllClasses(PresentationModelInfo presentationModelInfo, ProcessingContext context, Logger log) throws IOException, JClassAlreadyExistsException, ClassNotFoundException {
DataSetPropertyInfo dataSetProperty = presentationModelInfo.dataSetProperties().toArray(new DataSetPropertyInfo[0])[0];
WrappedTypeElement typeElement = context.typeElementOf(dataSetProperty.itemPresentationModelTypeName());
PresentationModelInfoBuilder builder = new PresentationModelInfoBuilder(typeElement, dataSetProperty.itemPresentationModelObjectTypeName(), false);
result = builder.build();
}
Aggregations