| 1 |
|
package net.sourceforge.pebble.plugins; |
| 2 |
|
|
| 3 |
|
import java.util.*; |
| 4 |
|
|
| 5 |
|
|
| 6 |
|
@author |
| 7 |
|
|
|
|
|
| 0% |
Uncovered Elements: 34 (34) |
Complexity: 14 |
Complexity Density: 0,74 |
|
| 8 |
|
public class AvailablePlugins { |
| 9 |
|
public static final String PERMALINK_PROVIDER = "permalink-provider"; |
| 10 |
|
public static final String CONTENT_DECORATOR = "content-decorator"; |
| 11 |
|
public static final String BLOG_LISTENER = "blog-listener"; |
| 12 |
|
public static final String BLOG_ENTRY_LISTENER = "blog-entry-listener"; |
| 13 |
|
public static final String COMMENT_LISTENER = "comment-listener"; |
| 14 |
|
public static final String COMMENT_CONFIRMATION_STRATEGY = "comment-confirmation-strategy"; |
| 15 |
|
public static final String TRACKBACK_LISTENER = "trackback-listener"; |
| 16 |
|
public static final String TRACKBACK_CONFIRMATION_STRATEGY = "trackback-confirmation-strategy"; |
| 17 |
|
public static final String LUCENCE_ANALYZER = "lucene-analyzer"; |
| 18 |
|
public static final String LOGGER = "logger"; |
| 19 |
|
|
| 20 |
|
private final Map<String, List<Plugin>> plugins; |
| 21 |
|
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0,25 |
|
| 22 |
0
|
public Map<String, List<Plugin>> copyMap()... |
| 23 |
|
{ |
| 24 |
0
|
Map<String, List<Plugin>> map = new HashMap<String, List<Plugin>>(); |
| 25 |
0
|
for (Map.Entry<String, List<Plugin>> entry : plugins.entrySet()) |
| 26 |
|
{ |
| 27 |
0
|
map.put(entry.getKey(), new ArrayList<Plugin>(entry.getValue())); |
| 28 |
|
} |
| 29 |
0
|
return map; |
| 30 |
|
} |
| 31 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 32 |
0
|
public AvailablePlugins(Map<String, List<Plugin>> plugins) {... |
| 33 |
0
|
this.plugins = plugins; |
| 34 |
|
} |
| 35 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 36 |
0
|
public Collection<Plugin> getPermalinkProviders() {... |
| 37 |
0
|
return getEmptyIfNull(PERMALINK_PROVIDER); |
| 38 |
|
} |
| 39 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 40 |
0
|
public Collection<Plugin> getContentDecorators() {... |
| 41 |
0
|
return getEmptyIfNull(CONTENT_DECORATOR); |
| 42 |
|
} |
| 43 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 44 |
0
|
public Collection<Plugin> getBlogListeners() {... |
| 45 |
0
|
return getEmptyIfNull(BLOG_LISTENER); |
| 46 |
|
} |
| 47 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 48 |
0
|
public Collection<Plugin> getBlogEntryListeners() {... |
| 49 |
0
|
return getEmptyIfNull(BLOG_ENTRY_LISTENER); |
| 50 |
|
} |
| 51 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 52 |
0
|
public Collection<Plugin> getCommentListeners() {... |
| 53 |
0
|
return getEmptyIfNull(COMMENT_LISTENER); |
| 54 |
|
} |
| 55 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 56 |
0
|
public Collection<Plugin> getCommentConfirmationStrategies() {... |
| 57 |
0
|
return getEmptyIfNull(COMMENT_CONFIRMATION_STRATEGY); |
| 58 |
|
} |
| 59 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 60 |
0
|
public Collection<Plugin> getTrackbackListeners() {... |
| 61 |
0
|
return getEmptyIfNull(TRACKBACK_LISTENER); |
| 62 |
|
} |
| 63 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 64 |
0
|
public Collection<Plugin> getTrackbackConfirmationStrategies() {... |
| 65 |
0
|
return getEmptyIfNull(TRACKBACK_CONFIRMATION_STRATEGY); |
| 66 |
|
} |
| 67 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 68 |
0
|
public Collection<Plugin> getLuceneAnalyzers() {... |
| 69 |
0
|
return getEmptyIfNull(LUCENCE_ANALYZER); |
| 70 |
|
} |
| 71 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 72 |
0
|
public Collection<Plugin> getLoggers() {... |
| 73 |
0
|
return getEmptyIfNull(LOGGER); |
| 74 |
|
} |
| 75 |
|
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0,5 |
|
| 76 |
0
|
private Collection<Plugin> getEmptyIfNull(String key) {... |
| 77 |
0
|
Collection<Plugin> list = plugins.get(key); |
| 78 |
0
|
if (list == null) { |
| 79 |
0
|
return Collections.emptyList(); |
| 80 |
|
} |
| 81 |
|
else { |
| 82 |
0
|
return Collections.unmodifiableCollection(list); |
| 83 |
|
} |
| 84 |
|
} |
| 85 |
|
|
| 86 |
|
} |