Subversion Repositories bacoAlunos

Rev

Rev 1784 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1784 Rev 1789
Line 12... Line 12...
12
/**
12
/**
13
 * Created by jorgemachado on 15/09/16.
13
 * Created by jorgemachado on 15/09/16.
14
 */
14
 */
15
public class CursoImpl extends Curso
15
public class CursoImpl extends Curso
16
{
16
{
-
 
17
    public static Genson getGensonPlanoEstudosParaApiJsonWS(){
-
 
18
        Genson genson = new GensonBuilder()
-
 
19
                .useRuntimeType(true)
-
 
20
                .exclude("class")
-
 
21
                .exclude("siges", Curso.class)
-
 
22
                .exclude("nome",Curso.class)
-
 
23
                .exclude("codigoPlanoSiges",Curso.class)
-
 
24
                .exclude("anoPlanoSiges",Curso.class)
-
 
25
                .exclude("descPlanoSiges",Curso.class)
-
 
26
                .exclude("dep")
-
 
27
                .exclude("removed",UnidadeType.class)
-
 
28
                .exclude("perfilId",Semestre.Perfil.class)
-
 
29
                .exclude("semestreId",Semestre.class)
-
 
30
                .create();
-
 
31
        return genson;
-
 
32
    }
-
 
33
 
17
    public List<Semestre> getSemestre()
34
    public List<Semestre> getSemestre()
18
    {
35
    {
19
        if (semestre == null) {
36
        if (semestre == null) {
20
            semestre = new DynamicArrayList<Semestre>(SemestreImpl.class);
37
            semestre = new DynamicArrayList<Semestre>(SemestreImpl.class);
21
        }
38
        }
22
        return this.semestre;
39
        return this.semestre;
23
    }
40
    }
24
 
41
 
25
    //ESTE GENSON e apenas para propositos de interface. O JSON gerado para envio pelas API's e feito no servico
42
    //ESTE GENSON e apenas para propositos de interface. O JSON gerado para envio pelas API's e feito no servico
26
    //CourseService.savePlanoEstudosEditado que usa o Genson obtido em CourseService.getGensonPlanoEstudos
43
    //CourseService.savePlanoEstudosEditado que usa o Genson obtido em CourseService.getGensonPlanoEstudosParaApiJsonWS
27
 
44
 
28
    static Genson genson;
45
    static Genson genson;
29
 
46
 
30
    static {
47
    static {
31
        GensonBuilder gensonBuilder =  new GensonBuilder()
48
        GensonBuilder gensonBuilder =  new GensonBuilder()
32
                .exclude(5+0%2Fdocs%2Fapi+Object">Object.class)
49
                //.exclude(Object.class)
33
 
50
 
34
                .include(1.5.0/docs/api/java/lang/Boolean.html">Boolean.class)
51
                .include(1.5.0/docs/api/java/lang/Boolean.html">Boolean.class)
35
                .include(1.5.0/docs/api/java/lang/Integer.html">Integer.class)
52
                .include(1.5.0/docs/api/java/lang/Integer.html">Integer.class)
36
                .include(1.5.0/docs/api/java/lang/Long.html">Long.class)
53
                .include(1.5.0/docs/api/java/lang/Long.html">Long.class)
37
                .include(1.5.0/docs/api/java/lang/Double.html">Double.class)
54
                .include(1.5.0/docs/api/java/lang/Double.html">Double.class)
Line 66... Line 83...
66
 
83
 
67
    public JSONObject toJsonObject() throws 1.5.0/docs/api/java/io/IOException.html">IOException, JSONException {
84
    public JSONObject toJsonObject() throws 1.5.0/docs/api/java/io/IOException.html">IOException, JSONException {
68
        return new JSONObject(toJson());
85
        return new JSONObject(toJson());
69
    }
86
    }
70
 
87
 
-
 
88
    public JSONObject toJsonObjectJsonApiWS() throws 1.5.0/docs/api/java/io/IOException.html">IOException, JSONException {
-
 
89
        return new JSONObject(getGensonPlanoEstudosParaApiJsonWS().serialize(this));
-
 
90
    }
-
 
91
 
71
 
92
 
72
}
93
}