1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.index.examples.indexing;
20
21 import javax.inject.Inject;
22 import javax.inject.Named;
23 import javax.inject.Singleton;
24
25 import java.util.ArrayList;
26 import java.util.List;
27 import java.util.Map;
28
29 import org.apache.maven.index.Indexer;
30 import org.apache.maven.index.Scanner;
31 import org.apache.maven.index.context.IndexCreator;
32
33
34
35
36
37
38
39 @Named
40 @Singleton
41 public class IndexerConfiguration {
42
43 private Indexer indexer;
44
45 private Scanner scanner;
46
47 private Map<String, IndexCreator> indexers;
48
49 @Inject
50 public IndexerConfiguration(Indexer indexer, Scanner scanner, Map<String, IndexCreator> indexers) {
51 this.indexer = indexer;
52 this.scanner = scanner;
53 this.indexers = indexers;
54 }
55
56 public List<IndexCreator> getIndexersAsList() {
57 return indexers == null ? new ArrayList<>(0) : new ArrayList<>(indexers.values());
58 }
59
60 public Indexer getIndexer() {
61 return indexer;
62 }
63
64 public void setIndexer(Indexer indexer) {
65 this.indexer = indexer;
66 }
67
68 public Scanner getScanner() {
69 return scanner;
70 }
71
72 public void setScanner(Scanner scanner) {
73 this.scanner = scanner;
74 }
75
76 public Map<String, IndexCreator> getIndexers() {
77 return indexers;
78 }
79
80 public void setIndexers(Map<String, IndexCreator> indexers) {
81 this.indexers = indexers;
82 }
83 }