Project

General

Profile

« Previous | Next » 

Revision 36982

Added by Eri Katsari about 9 years ago

testing collected from using source field from result.metadata

View differences:

FundingParser.java
7 7
public class FundingParser {
8 8
    private String NULL_STRING = "null";
9 9

  
10
    private String ENCLOSED = "#";
11
    private String DELIM = "!";
12
  private Logger log = Logger.getLogger(this.getClass());
10
    private String ENCLOSED ="#";
11
    private String DELIM ="!";
13 12

  
13
    private Logger log = Logger.getLogger(this.getClass());
14

  
14 15
    String getFundingLevel(String funding_level, int level) {
15 16

  
16 17

  
......
30 31
        funding_level = split[1];
31 32

  
32 33
        funding_level = funding_level.substring(0, funding_level.indexOf("</name>"));
33
         log.debug("Funding lvl out" + funding_level);
34
         log.info("Funding lvl out" + funding_level);
34 35

  
35 36
        return ENCLOSED + funding_level + ENCLOSED + DELIM;
36 37
    }
37 38

  
38 39

  
39 40
    public String getFundingInfo(String buff) {
40
log.debug("Funding lvl input" + buff);
41
   log.info("Funding lvl input" + buff);
41 42
        
42
return getFunder(buff) + getFundingLevel(buff, 0)
43
         return getFunder(buff) + getFundingLevel(buff, 0)
43 44
                + (getFundingLevel(buff, 1) + getFundingLevel(buff, 2) + getFundingLevel(buff, 3));
44 45

  
45 46
    }
46 47

  
47 48
    public String getFunder(String buff) {
48 49

  
50
        return  ENCLOSED  + "STARTS HERE" +buff +"ENDS HERE" + ENCLOSED + DELIM;
51

  
49 52
        if (buff.isEmpty()) {
50 53
            return ENCLOSED  + NULL_STRING  + ENCLOSED + DELIM;
51 54

  
......
54 57
        if (!buff.contains("<funder>")) {
55 58
            return ENCLOSED  + NULL_STRING  + ENCLOSED + DELIM;
56 59
        }
60

  
61

  
57 62
        String[] split = buff.split("<funder>");
58 63
        String funder = split[1];
59 64

  
......
62 67
        funder = split[1];
63 68

  
64 69
        funder = funder.substring(0, funder.indexOf("</name>"));
65
        log.debug("Funder" + funder);
70
        log.info("Funder" + funder);
66 71

  
67 72
        return ENCLOSED + funder + ENCLOSED + DELIM;
68 73
    }

Also available in: Unified diff