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