Search in sources :

Example 1 with ScannerType

use of com.buschmais.jqassistant.core.plugin.schema.v1.ScannerType in project jqa-core-framework by buschmais.

the class ScannerPluginRepositoryImpl method getScannerPlugins.

private <T extends ScannerPlugin> Map<String, T> getScannerPlugins(List<JqassistantPlugin> plugins) throws PluginRepositoryException {
    Map<String, T> scannerPlugins = new HashMap<>();
    for (JqassistantPlugin plugin : plugins) {
        ScannerType scannerType = plugin.getScanner();
        if (scannerType != null) {
            for (IdClassType classType : scannerType.getClazz()) {
                T scannerPlugin = createInstance(classType.getValue());
                if (scannerPlugin != null) {
                    scannerPlugin.initialize();
                    String id = classType.getId();
                    if (id == null) {
                        id = scannerPlugin.getClass().getSimpleName();
                    }
                    scannerPlugins.put(id, scannerPlugin);
                }
            }
        }
    }
    return scannerPlugins;
}
Also used : IdClassType(com.buschmais.jqassistant.core.plugin.schema.v1.IdClassType) HashMap(java.util.HashMap) JqassistantPlugin(com.buschmais.jqassistant.core.plugin.schema.v1.JqassistantPlugin) ScannerType(com.buschmais.jqassistant.core.plugin.schema.v1.ScannerType)

Aggregations

IdClassType (com.buschmais.jqassistant.core.plugin.schema.v1.IdClassType)1 JqassistantPlugin (com.buschmais.jqassistant.core.plugin.schema.v1.JqassistantPlugin)1 ScannerType (com.buschmais.jqassistant.core.plugin.schema.v1.ScannerType)1 HashMap (java.util.HashMap)1