use of com.buschmais.jqassistant.core.plugin.schema.v1.IdClassType in project jqa-core-framework by buschmais.
the class RulePluginRepositoryImpl method initialize.
@Override
public void initialize() {
for (JqassistantPlugin plugin : plugins) {
IdClassListType ruleParsers = plugin.getRuleParser();
if (ruleParsers != null) {
for (IdClassType pluginType : ruleParsers.getClazz()) {
RuleParserPlugin ruleParserPlugin = createInstance(pluginType.getValue());
try {
ruleParserPlugin.initialize();
} catch (RuleException e) {
throw new PluginRepositoryException("Cannot initialize plugin " + ruleParserPlugin, e);
}
ruleParserPlugins.add(ruleParserPlugin);
}
}
}
}
use of com.buschmais.jqassistant.core.plugin.schema.v1.IdClassType in project jqa-core-framework by buschmais.
the class AnalyzerPluginRepositoryImpl method initializeReportPlugins.
private void initializeReportPlugins(IdClassListType reportTypes) {
if (reportTypes != null) {
for (IdClassType classType : reportTypes.getClazz()) {
ReportPlugin reportPlugin = createInstance(classType.getValue());
if (reportPlugin != null) {
try {
reportPlugin.initialize();
} catch (ReportException e) {
throw new PluginRepositoryException("Cannot initialize report plugin " + reportPlugin, e);
}
String id = classType.getId();
if (id == null) {
id = reportPlugin.getClass().getSimpleName();
}
reportPlugins.put(id, reportPlugin);
}
}
}
}
use of com.buschmais.jqassistant.core.plugin.schema.v1.IdClassType in project jqa-core-framework by buschmais.
the class ScannerPluginRepositoryImpl method getScannerPlugins.
private void getScannerPlugins(List<JqassistantPlugin> plugins) {
for (JqassistantPlugin plugin : plugins) {
IdClassListType scannerTypes = plugin.getScanner();
if (scannerTypes != null) {
for (IdClassType classType : scannerTypes.getClazz()) {
ScannerPlugin<?, ?> scannerPlugin = createInstance(classType.getValue());
if (scannerPlugin != null) {
scannerPlugin.initialize();
String id = classType.getId();
if (id == null) {
id = scannerPlugin.getClass().getSimpleName();
}
scannerPlugins.put(id, scannerPlugin);
}
}
}
}
}
use of com.buschmais.jqassistant.core.plugin.schema.v1.IdClassType in project jqa-core-framework by buschmais.
the class ReportPluginRepositoryImpl method getReportPlugins.
private Map<String, ReportPlugin> getReportPlugins(List<JqassistantPlugin> plugins) throws PluginRepositoryException {
Map<String, ReportPlugin> reportPlugins = new HashMap<>();
for (JqassistantPlugin plugin : plugins) {
ReportType reportType = plugin.getReport();
if (reportType != null) {
for (IdClassType classType : reportType.getClazz()) {
ReportPlugin reportPlugin = createInstance(classType.getValue());
if (reportPlugin != null) {
try {
reportPlugin.initialize();
} catch (ReportException e) {
throw new PluginRepositoryException("Cannot initialize report plugin " + reportPlugin, e);
}
String id = classType.getId();
if (id == null) {
id = reportPlugin.getClass().getSimpleName();
}
reportPlugins.put(id, reportPlugin);
}
}
}
}
return reportPlugins;
}
use of com.buschmais.jqassistant.core.plugin.schema.v1.IdClassType in project jqa-core-framework by buschmais.
the class AnalyzerPluginRepositoryImpl method initializeRuleInterpreterPlugins.
private void initializeRuleInterpreterPlugins(JqassistantPlugin plugin) {
IdClassListType ruleInterpreters = plugin.getRuleInterpreter();
if (ruleInterpreters != null) {
for (IdClassType pluginType : ruleInterpreters.getClazz()) {
RuleInterpreterPlugin ruleInterpreterPlugin = createInstance(pluginType.getValue());
ruleInterpreterPlugin.initialize();
for (String language : ruleInterpreterPlugin.getLanguages()) {
Collection<RuleInterpreterPlugin> plugins = ruleInterpreterPlugins.get(language.toLowerCase());
if (plugins == null) {
plugins = new ArrayList<>();
ruleInterpreterPlugins.put(language.toLowerCase(), plugins);
}
plugins.add(ruleInterpreterPlugin);
}
}
}
}
Aggregations