Rev 1830 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1830 | Rev 1848 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | import com.owlike.genson.Genson; |
3 | import com.owlike.genson.Genson; |
4 | import com.owlike.genson.GensonBuilder; |
4 | import com.owlike.genson.GensonBuilder; |
5 | import org.json.JSONException; |
5 | import org.json.JSONException; |
6 | import org.json.JSONObject; |
6 | import org.json.JSONObject; |
7 | import pt.estgp.estgweb.domain.utils.JsonView; |
7 | import pt.estgp.estgweb.domain.utils.JsonView; |
8 | import pt.estgp.estgweb.services.courses.coursereport.documentmodel.ReportCourseDocument; |
8 | import pt.estgp.estgweb.services.courses.coursereport.documentmodel.CourseReportDocument; |
9 | 9 | ||
10 | import java.util.ArrayList; |
- | |
11 | import java.util.Date; |
10 | import java.util.Date; |
12 | import java.util.List; |
11 | import java.util.List; |
13 | 12 | ||
14 | /** |
13 | /** |
15 | * Created by jorgemachado on 31/10/17. |
14 | * Created by jorgemachado on 31/10/17. |
16 | */ |
15 | */ |
17 | public class 5+0%2Fdocs%2Fapi+Document">Document implements JsonView |
16 | public class 5+0%2Fdocs%2Fapi+Document">Document extends SectionContainer implements JsonView |
18 | { |
17 | { |
19 | List<DocumentSection> sections = new ArrayList<DocumentSection>(); |
- | |
20 | 18 | ||
21 | public List<DocumentSection> getSections() { |
- | |
22 | return sections; |
- | |
23 | } |
- | |
24 | - | ||
25 | public void setSections(List<DocumentSection> sections) { |
- | |
26 | this.sections = sections; |
- | |
27 | } |
- | |
28 | 19 | ||
29 | private static Genson gensonGenericLoad; |
20 | private static Genson gensonGenericLoad; |
30 | static{ |
21 | static{ |
31 | gensonGenericLoad = new GensonBuilder() |
22 | gensonGenericLoad = new GensonBuilder() |
32 | .useMethods(true) |
23 | .useMethods(true) |
Line 38... | Line 29... | ||
38 | .exclude(java.sql.5+0%2Fdocs%2Fapi+Timestamp">Timestamp.class) |
29 | .exclude(java.sql.5+0%2Fdocs%2Fapi+Timestamp">Timestamp.class) |
39 | .exclude(java.sql.5+0%2Fdocs%2Fapi+Date">Date.class) |
30 | .exclude(java.sql.5+0%2Fdocs%2Fapi+Date">Date.class) |
40 | .create(); |
31 | .create(); |
41 | } |
32 | } |
42 | 33 | ||
43 | public static ReportCourseDocument fromJson(1.5.0/docs/api/java/lang/String.html">String json) |
34 | public static CourseReportDocument fromJson(1.5.0/docs/api/java/lang/String.html">String json) |
44 | { |
35 | { |
45 | return gensonGenericLoad.deserialize(json,ReportCourseDocument.class); |
36 | return gensonGenericLoad.deserialize(json,CourseReportDocument.class); |
46 | } |
37 | } |
47 | 38 | ||
48 | 39 | ||
49 | 40 | ||
50 | public List<String> getJsonExcludedProperties() { |
41 | public List<String> getJsonExcludedProperties() { |