use of com.devonfw.cobigen.impl.model.ModelBuilderImpl in project cobigen by devonfw.
the class CobiGenImpl method getModelBuilder.
@Override
public ModelBuilder getModelBuilder(Object input) {
List<String> matchingTriggerIds = getMatchingTriggerIds(input);
// Just take the first trigger as all trigger should have the same input reader. See javadoc.
Trigger trigger = this.configurationHolder.readContextConfiguration().getTrigger(matchingTriggerIds.get(0));
return new ModelBuilderImpl(input, trigger);
}
use of com.devonfw.cobigen.impl.model.ModelBuilderImpl in project cobigen by devonfw.
the class GenerationProcessorImpl method buildModel.
/**
* Builds the model for he given input.
*
* @param triggerInterpreter {@link TriggerInterpreter} to be used
* @param trigger activated {@link Trigger}
* @param generatorInput input for generation to retrieve information from.
* @param template the internal {@link Template} representation
* @return the object model for generation.
*/
private Map<String, Object> buildModel(TriggerInterpreter triggerInterpreter, Trigger trigger, Object generatorInput, Template template) {
ModelBuilderImpl modelBuilderImpl = new ModelBuilderImpl(generatorInput, trigger);
Map<String, Object> model;
if (this.rawModel != null) {
model = this.rawModel;
} else {
model = modelBuilderImpl.createModel(triggerInterpreter);
}
modelBuilderImpl.enrichByContextVariables(model, triggerInterpreter, template, this.targetRootPath, this.generationReport);
if (this.logicClassesModel != null) {
model.putAll(this.logicClassesModel);
}
return model;
}
Aggregations