Revision 48139
Added by Alessia Bardi over 6 years ago
PatchHostedBy.java | ||
---|---|---|
3 | 3 |
import java.io.StringReader; |
4 | 4 |
import java.util.Map; |
5 | 5 |
|
6 |
import eu.dnetlib.miscutils.functional.UnaryFunction; |
|
6 | 7 |
import org.apache.commons.logging.Log; |
7 | 8 |
import org.apache.commons.logging.LogFactory; |
8 | 9 |
import org.dom4j.Document; |
... | ... | |
10 | 11 |
import org.dom4j.Node; |
11 | 12 |
import org.dom4j.io.SAXReader; |
12 | 13 |
|
13 |
import eu.dnetlib.miscutils.functional.UnaryFunction; |
|
14 |
|
|
15 | 14 |
/** |
16 | 15 |
* The Class PatchHostedBy. |
17 | 16 |
*/ |
18 | 17 |
public class PatchHostedBy implements UnaryFunction<String, String> { |
19 | 18 |
|
20 |
/** The set spec hosted by map. */ |
|
19 |
/** |
|
20 |
* The set spec hosted by map. |
|
21 |
*/ |
|
21 | 22 |
private Map<String, HostedByEntry> setSpecHostedByMap; |
22 | 23 |
|
23 |
/** The counters. */ |
|
24 |
/** |
|
25 |
* The counters. |
|
26 |
*/ |
|
24 | 27 |
private HostedByCounters counters; |
25 | 28 |
|
26 |
/** The xpath. */ |
|
29 |
/** |
|
30 |
* The xpath. |
|
31 |
*/ |
|
27 | 32 |
private String xpath; |
28 | 33 |
|
29 |
/** The reader. */ |
|
34 |
/** |
|
35 |
* The reader. |
|
36 |
*/ |
|
30 | 37 |
private final SAXReader reader = new SAXReader(); |
31 | 38 |
|
32 |
/** The Constant log. */ |
|
39 |
/** |
|
40 |
* The Constant log. |
|
41 |
*/ |
|
33 | 42 |
private static final Log log = LogFactory.getLog(PatchHostedBy.class); |
34 | 43 |
|
35 | 44 |
/** |
36 | 45 |
* Instantiates a new patch hosted by. |
37 | 46 |
* |
38 |
* @param setSpecHostedByMap |
|
39 |
* the set spec hosted by map |
|
40 |
* @param xpath |
|
41 |
* the xpath |
|
42 |
* @param counters |
|
43 |
* the counters |
|
47 |
* @param setSpecHostedByMap the set spec hosted by map |
|
48 |
* @param xpath the xpath |
|
49 |
* @param counters the counters |
|
44 | 50 |
*/ |
45 | 51 |
public PatchHostedBy(final Map<String, HostedByEntry> setSpecHostedByMap, final String xpath, final HostedByCounters counters) { |
46 | 52 |
this.setSpecHostedByMap = setSpecHostedByMap; |
... | ... | |
59 | 65 |
/** |
60 | 66 |
* Evaluate. |
61 | 67 |
* |
62 |
* @param record |
|
63 |
* the record |
|
68 |
* @param record the record |
|
64 | 69 |
* @return the string |
65 | 70 |
*/ |
66 | 71 |
@Override |
... | ... | |
88 | 93 |
/** |
89 | 94 |
* Find hosted by. |
90 | 95 |
* |
91 |
* @param doc |
|
92 |
* the doc |
|
96 |
* @param doc the doc |
|
93 | 97 |
* @return the hosted by entry |
94 | 98 |
*/ |
95 | 99 |
private HostedByEntry findHostedBy(final Document doc) { |
Also available in: Unified diff
integrated (hopefully) all required changes from dnet40