Projekt

Obecné

Profil

« Předchozí | Další » 

Revize d63e43a4

Přidáno uživatelem Tomáš Šimandl před více než 5 roky(ů)

Used Gson in Spade converter

Zobrazit rozdíly:

sources/imiger-module/src/main/java/cz/zcu/kiv/imiger/vo/BaseVertex.java
11 11
    /** Name of vertex. */
12 12
    private String name;
13 13
    /** Index of vertex archetype. */
14
    private int archetypeIndex;
14
    private int archetype;
15 15
    /** Additional info. */
16 16
    private String text;
17 17

  
18 18
    public BaseVertex(int id, String name, int archetypeIndex, String text) {
19 19
        this.id = id;
20 20
        this.name = name;
21
        this.archetypeIndex = archetypeIndex;
21
        this.archetype = archetypeIndex;
22 22
        this.text = text;
23 23
    }
24 24

  
......
39 39
    }
40 40

  
41 41
    public int getArchetype() {
42
        return archetypeIndex;
42
        return archetype;
43 43
    }
44 44

  
45 45
    public void setArchetype(int archetypeIndex) {
46
        this.archetypeIndex = archetypeIndex;
46
        this.archetype = archetypeIndex;
47 47
    }
48 48

  
49 49
    public String getText() {
sources/imiger-spade-converter/src/main/java/cz/zcu/kiv/imiger/plugin/spade/Spade.java
1 1
package cz.zcu.kiv.imiger.plugin.spade;
2 2

  
3
import com.google.gson.Gson;
3 4
import cz.zcu.kiv.imiger.spi.IModule;
4 5
import cz.zcu.kiv.imiger.vo.Graph;
5 6
import cz.zcu.kiv.imiger.plugin.spade.graph.GraphManager;
6 7
import cz.zcu.kiv.imiger.plugin.spade.graph.loader.GraphJSONDataLoader;
7 8
import cz.zcu.kiv.imiger.plugin.spade.graph.loader.JSONConfigLoader;
8
import net.sf.json.JSONObject;
9 9

  
10 10
public class Spade implements IModule {
11 11
    @Override
......
25 25
        JSONConfigLoader configLoader = new JSONConfigLoader(graphManager);
26 26

  
27 27
        Graph graph = graphManager.createGraph(configLoader);
28
        JSONObject json = JSONObject.fromObject(graph);
29 28

  
30
        return json.toString();
29
        return new Gson().toJson(graph);
31 30
    }
32 31
}

Také k dispozici: Unified diff