use of org.mybatis.generator.internal.PluginAggregator in project generator by mybatis.
the class Context method generateFiles.
/**
* Generate files.
*
* @param callback
* the callback
* @param generatedJavaFiles
* the generated java files
* @param generatedXmlFiles
* the generated xml files
* @param warnings
* the warnings
* @throws InterruptedException
* the interrupted exception
*/
public void generateFiles(ProgressCallback callback, List<GeneratedJavaFile> generatedJavaFiles, List<GeneratedXmlFile> generatedXmlFiles, List<String> warnings) throws InterruptedException {
pluginAggregator = new PluginAggregator();
for (PluginConfiguration pluginConfiguration : pluginConfigurations) {
Plugin plugin = ObjectFactory.createPlugin(this, pluginConfiguration);
if (plugin.validate(warnings)) {
pluginAggregator.addPlugin(plugin);
} else {
warnings.add(getString(//$NON-NLS-1$
"Warning.24", pluginConfiguration.getConfigurationType(), id));
}
}
if (introspectedTables != null) {
for (IntrospectedTable introspectedTable : introspectedTables) {
callback.checkCancel();
introspectedTable.initialize();
introspectedTable.calculateGenerators(warnings, callback);
generatedJavaFiles.addAll(introspectedTable.getGeneratedJavaFiles());
generatedXmlFiles.addAll(introspectedTable.getGeneratedXmlFiles());
generatedJavaFiles.addAll(pluginAggregator.contextGenerateAdditionalJavaFiles(introspectedTable));
generatedXmlFiles.addAll(pluginAggregator.contextGenerateAdditionalXmlFiles(introspectedTable));
}
}
generatedJavaFiles.addAll(pluginAggregator.contextGenerateAdditionalJavaFiles());
generatedXmlFiles.addAll(pluginAggregator.contextGenerateAdditionalXmlFiles());
}
use of org.mybatis.generator.internal.PluginAggregator in project generator by mybatis.
the class Context method generateFiles.
public void generateFiles(ProgressCallback callback, List<GeneratedJavaFile> generatedJavaFiles, List<GeneratedXmlFile> generatedXmlFiles, List<GeneratedKotlinFile> generatedKotlinFiles, List<String> warnings) throws InterruptedException {
pluginAggregator = new PluginAggregator();
for (PluginConfiguration pluginConfiguration : pluginConfigurations) {
Plugin plugin = ObjectFactory.createPlugin(this, pluginConfiguration);
if (plugin.validate(warnings)) {
pluginAggregator.addPlugin(plugin);
} else {
warnings.add(getString(// $NON-NLS-1$
"Warning.24", pluginConfiguration.getConfigurationType(), id));
}
}
// items in the configuration.
for (IntrospectedTable introspectedTable : introspectedTables) {
callback.checkCancel();
introspectedTable.initialize();
introspectedTable.calculateGenerators(warnings, callback);
}
for (IntrospectedTable introspectedTable : introspectedTables) {
callback.checkCancel();
generatedJavaFiles.addAll(introspectedTable.getGeneratedJavaFiles());
generatedXmlFiles.addAll(introspectedTable.getGeneratedXmlFiles());
generatedKotlinFiles.addAll(introspectedTable.getGeneratedKotlinFiles());
generatedJavaFiles.addAll(pluginAggregator.contextGenerateAdditionalJavaFiles(introspectedTable));
generatedXmlFiles.addAll(pluginAggregator.contextGenerateAdditionalXmlFiles(introspectedTable));
generatedKotlinFiles.addAll(pluginAggregator.contextGenerateAdditionalKotlinFiles(introspectedTable));
}
generatedJavaFiles.addAll(pluginAggregator.contextGenerateAdditionalJavaFiles());
generatedXmlFiles.addAll(pluginAggregator.contextGenerateAdditionalXmlFiles());
generatedKotlinFiles.addAll(pluginAggregator.contextGenerateAdditionalKotlinFiles());
}
Aggregations