Search in sources :

Example 1 with Scope

use of com.buschmais.jqassistant.core.scanner.api.Scope in project jqa-core-framework by buschmais.

the class ScopePluginRepositoryImpl method getScopes.

private Map<String, Scope> getScopes(List<JqassistantPlugin> plugins) throws PluginRepositoryException {
    Map<String, Scope> scopes = new HashMap<>();
    for (JqassistantPlugin plugin : plugins) {
        ScopeType scopeType = plugin.getScope();
        if (scopeType != null) {
            for (String scopePluginName : scopeType.getClazz()) {
                Class<? extends Enum<?>> type = getType(scopePluginName);
                for (Enum enumConstant : type.getEnumConstants()) {
                    Scope scope = (Scope) enumConstant;
                    String scopeName = scope.getPrefix() + ":" + scope.getName();
                    scopes.put(scopeName.toLowerCase(), scope);
                }
            }
        }
    }
    return scopes;
}
Also used : ScopeType(com.buschmais.jqassistant.core.plugin.schema.v1.ScopeType) Scope(com.buschmais.jqassistant.core.scanner.api.Scope) HashMap(java.util.HashMap) JqassistantPlugin(com.buschmais.jqassistant.core.plugin.schema.v1.JqassistantPlugin)

Example 2 with Scope

use of com.buschmais.jqassistant.core.scanner.api.Scope in project jqa-core-framework by buschmais.

the class ScannerPluginRepositoryImpl method getScopes.

private Map<String, Scope> getScopes(List<JqassistantPlugin> plugins) {
    Map<String, Scope> scopes = new HashMap<>();
    for (JqassistantPlugin plugin : plugins) {
        ClassListType scopeTypes = plugin.getScope();
        if (scopeTypes != null) {
            for (String scopePluginName : scopeTypes.getClazz()) {
                Class<? extends Enum<?>> type = getType(scopePluginName);
                for (Enum enumConstant : type.getEnumConstants()) {
                    Scope scope = (Scope) enumConstant;
                    String scopeName = scope.getPrefix() + ":" + scope.getName();
                    scopes.put(scopeName.toLowerCase(), scope);
                }
            }
        }
    }
    return scopes;
}
Also used : Scope(com.buschmais.jqassistant.core.scanner.api.Scope) HashMap(java.util.HashMap) JqassistantPlugin(org.jqassistant.schema.plugin.v1.JqassistantPlugin) IdClassListType(org.jqassistant.schema.plugin.v1.IdClassListType) ClassListType(org.jqassistant.schema.plugin.v1.ClassListType)

Aggregations

Scope (com.buschmais.jqassistant.core.scanner.api.Scope)2 HashMap (java.util.HashMap)2 JqassistantPlugin (com.buschmais.jqassistant.core.plugin.schema.v1.JqassistantPlugin)1 ScopeType (com.buschmais.jqassistant.core.plugin.schema.v1.ScopeType)1 ClassListType (org.jqassistant.schema.plugin.v1.ClassListType)1 IdClassListType (org.jqassistant.schema.plugin.v1.IdClassListType)1 JqassistantPlugin (org.jqassistant.schema.plugin.v1.JqassistantPlugin)1