Project

General

Profile

1
package eu.dnetlib.data.bulktag;
2

    
3

    
4
import com.google.common.reflect.TypeToken;
5
import com.google.gson.Gson;
6
import eu.dnetlib.data.bulktag.selectioncriteria.VerbResolver;
7
import org.dom4j.Node;
8

    
9
import java.lang.reflect.Type;
10
import java.util.Collection;
11
import java.util.List;
12
import java.util.Map;
13

    
14
/**
15
 * Created by miriam on 01/08/2018.
16
 */
17
public class Datasource {
18

    
19
    private String openaireId;
20

    
21
    private SelectionConstraints sc;
22

    
23

    
24
    public SelectionConstraints getSelCriteria() {
25
        return sc;
26
    }
27

    
28

    
29

    
30
    public void setSelCriteria(SelectionConstraints selCriteria) {
31
        this.sc = selCriteria;
32
    }
33

    
34
    public String getOpenaireId() {
35
        return openaireId;
36
    }
37

    
38
    public void setOpenaireId(String openaireId) {
39
        this.openaireId = openaireId;
40
    }
41

    
42
    private void setSelCriteria(String json,VerbResolver resolver){
43
        sc = new Gson().fromJson(json, SelectionConstraints.class);
44
        sc.setSelection(resolver);
45
    }
46

    
47
    public void setSelCriteria(Node n, VerbResolver resolver){
48
        try{
49
            setSelCriteria(n.getText(),resolver);
50
        }catch(Exception e) {
51
            sc=null;
52
        }
53

    
54
    }
55

    
56

    
57

    
58
}
(6-6/9)