OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 149 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 149 Rev 156
Line 11... Line 11...
11
 * When distributing the software, include this License Header Notice in each file.
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
12
 */
13
 
13
 
14
 package org.openconcerto.ui.light;
14
 package org.openconcerto.ui.light;
15
 
15
 
-
 
16
import org.openconcerto.utils.io.JSONConverter;
-
 
17
import org.openconcerto.utils.io.Transferable;
-
 
18
 
-
 
19
import java.io.Externalizable;
-
 
20
import java.io.IOException;
-
 
21
import java.io.ObjectInput;
-
 
22
import java.io.ObjectOutput;
16
import java.util.ArrayList;
23
import java.util.ArrayList;
17
import java.util.List;
24
import java.util.List;
18
 
25
 
19
import org.openconcerto.utils.io.JSONConverter;
-
 
20
import org.openconcerto.utils.io.Transferable;
-
 
21
import net.minidev.json.JSONArray;
26
import net.minidev.json.JSONArray;
22
import net.minidev.json.JSONAware;
27
import net.minidev.json.JSONAware;
23
import net.minidev.json.JSONObject;
28
import net.minidev.json.JSONObject;
24
 
29
 
25
public class SearchSpec implements Transferable, JSONAware {
30
public class SearchSpec implements Transferable, JSONAware, Externalizable {
26
    private String tableId;
31
    private String tableId;
27
    private List<SearchContent> content = new ArrayList<SearchContent>();
32
    private List<SearchContent> content = new ArrayList<>();
-
 
33
 
-
 
34
    public SearchSpec() {
-
 
35
        // Serialization
-
 
36
    }
28
 
37
 
29
    public SearchSpec(final String tableId) {
38
    public SearchSpec(final String tableId) {
30
        this.tableId = tableId;
39
        this.tableId = tableId;
31
    }
40
    }
32
 
41
 
Line 67... Line 76...
67
     */
76
     */
68
    @Override
77
    @Override
69
    public String toJSONString() {
78
    public String toJSONString() {
70
        return toJSON().toJSONString();
79
        return toJSON().toJSONString();
71
    }
80
    }
-
 
81
 
-
 
82
    @Override
-
 
83
    public void writeExternal(ObjectOutput out) throws IOException {
-
 
84
        out.writeUTF(this.tableId);
-
 
85
        out.writeObject(this.content);
-
 
86
    }
-
 
87
 
-
 
88
    @Override
-
 
89
    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
-
 
90
        this.tableId = in.readUTF();
-
 
91
        this.content = (List<SearchContent>) in.readObject();
-
 
92
    }
72
}
93
}