Project

General

Profile

« Previous | Next » 

Revision 56415

removing not necessary incapsulation

View differences:

Datasource.java
1 1
package eu.dnetlib.data.bulktag;
2 2

  
3 3

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

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

  
14 8
/**
15 9
 * Created by miriam on 01/08/2018.
16 10
 */
......
18 12

  
19 13
    private String openaireId;
20 14

  
21
    private SelectionConstraints sc;
15
    private SelectionConstraints selectionConstraints;
22 16

  
23 17

  
24 18
    public SelectionConstraints getSelCriteria() {
25
        return sc;
19
        return selectionConstraints;
26 20
    }
27 21

  
22
    public SelectionConstraints getSelectionConstraints() {
23
        return selectionConstraints;
24
    }
28 25

  
26
    public void setSelectionConstraints(SelectionConstraints selectionConstraints) {
27
        this.selectionConstraints = selectionConstraints;
28
    }
29 29

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

  
34 34
    public String getOpenaireId() {
......
40 40
    }
41 41

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

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

  
54 54
    }

Also available in: Unified diff