Subversion Repositories bacoAlunos

Rev

Rev 1505 | Rev 1670 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

package pt.estgp.estgweb.domain;

import com.owlike.genson.Genson;
import com.owlike.genson.TransformationException;
import pt.estgp.estgweb.utils.ConfigProperties;

import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;

/**
 * Created by jorgemachado on 14/09/16.
 */

public class CourseDepartmentImpl extends CourseDepartment {
    @1.5.0/docs/api/java/lang/Override.html">Override
    public 1.5.0/docs/api/java/io/Serializable.html">Serializable getSerializable() {
        return getSigla();
    }

    public 1.5.0/docs/api/java/lang/String.html">String getSchoolFromInstitutionalCode()
    {
        return ConfigProperties.getProperty("institution.code.prefix." + getInstitutionalCode());
    }

    static Genson courseDepartmentGenson = new Genson.Builder()
            .exclude(5+0%2Fdocs%2Fapi+Object">Object.class)
            .include(CourseDepartment.class)
            .include("id", CourseDepartment.class)
            .include("active", CourseDepartment.class)
            .include("institutionalCode", CourseDepartment.class)
            .include("name", CourseDepartment.class)
            .include("nameEn", CourseDepartment.class)
            .include("nameEs", CourseDepartment.class)
            .include("nameFr",CourseDepartment.class)
            .create();

    public 1.5.0/docs/api/java/lang/String.html">String getJson() throws 1.5.0/docs/api/java/io/IOException.html">IOException, TransformationException
    {
        return courseDepartmentGenson.serialize(this);
    }

    public static 1.5.0/docs/api/java/lang/String.html">String getJson(ArrayList<CourseDepartment> departments) throws 1.5.0/docs/api/java/io/IOException.html">IOException, TransformationException
    {
        return courseDepartmentGenson.serialize(departments);
    }
}