Skip to content

Commit

Permalink
Merge pull request #4 from imod/professional_educational_data
Browse files Browse the repository at this point in the history
add support for professional_experience and educational_background
  • Loading branch information
jonnybbb committed Jun 10, 2014
2 parents f101003 + c03a881 commit 5b5f244
Show file tree
Hide file tree
Showing 17 changed files with 662 additions and 32 deletions.
@@ -0,0 +1,27 @@
package org.springframework.social.xing.api;

import java.io.Serializable;

/**
* Created by json2pojo
*/
public class Award implements Serializable {

private static final long serialVersionUID = -2650314056830306979L;
private String name;
private Long dateAwarded;
private String url;

public String getName() {
return name;
}

public Long getDateAwarded() {
return dateAwarded;
}

public Object getUrl() {
return url;
}

}
@@ -0,0 +1,64 @@
package org.springframework.social.xing.api;

import java.io.Serializable;

public class Company implements Serializable {

private static final long serialVersionUID = 8680835034881540914L;
private String id;
private String industry;
private String companySize;
private XingDate endDate;
private String tag;
private String name;
private String url;
private String careerLevel;
private String title;
private XingDate beginDate;
private String description;

public String getId() {
return id;
}

public String getIndustry() {
return industry;
}

public String getCompanySize() {
return companySize;
}

public XingDate getEndDate() {
return endDate;
}

public String getTag() {
return tag;
}

public String getName() {
return name;
}

public String getUrl() {
return url;
}

public String getCareerLevel() {
return careerLevel;
}

public String getTitle() {
return title;
}

public XingDate getBeginDate() {
return beginDate;
}

public String getDescription() {
return description;
}

}
@@ -0,0 +1,28 @@
package org.springframework.social.xing.api;

import java.io.Serializable;
import java.util.List;

/**
* Created by json2pojo
*/
public class EducationalBackground implements Serializable {

private static final long serialVersionUID = 7273795597965337052L;
private School primarySchool;
private List<String> qualifications;
private List<School> schools;

public List<String> getQualifications() {
return qualifications;
}

public List<School> getSchools() {
return schools;
}

public School getPrimarySchool() {
return primarySchool;
}

}
@@ -0,0 +1,28 @@
package org.springframework.social.xing.api;

import java.io.Serializable;
import java.util.List;

/**
* Created by json2pojo
*/
public class ProfessionalExperience implements Serializable {

private static final long serialVersionUID = -2093383150432795268L;
private List<Company> nonPrimaryCompanies;
private Company primaryCompany;
private List<Award> awards;

public List<Company> getNonPrimaryCompanies() {
return nonPrimaryCompanies;
}

public Company getPrimaryCompany() {
return primaryCompany;
}

public List<Award> getAwards() {
return awards;
}

}
@@ -0,0 +1,47 @@
package org.springframework.social.xing.api;

import java.io.Serializable;

/**
* Created by json2pojo
*/
public class School implements Serializable {

private static final long serialVersionUID = -2390425436172680486L;
private String id;
private String subject;
private XingDate endDate;
private String degree;
private String name;
private XingDate beginDate;
private String notes;

public String getId() {
return id;
}

public String getSubject() {
return subject;
}

public XingDate getEndDate() {
return endDate;
}

public String getDegree() {
return degree;
}

public String getName() {
return name;
}

public XingDate getBeginDate() {
return beginDate;
}

public String getNotes() {
return notes;
}

}
@@ -0,0 +1,35 @@
package org.springframework.social.xing.api;

import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class XingDate implements Serializable {

private static final long serialVersionUID = 6747607636067970948L;
private Integer year;
private Integer month;

public XingDate(String dateString) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM");
try {
Calendar cal = Calendar.getInstance();
Date date = format.parse(dateString);
cal.setTime(date);
month = cal.get(Calendar.MONTH) + 1; // MONTH is zero based
year = cal.get(Calendar.YEAR);
} catch (ParseException e) {
e.printStackTrace();
}
}

public Integer getMonth() {
return month;
}

public Integer getYear() {
return year;
}
}
Expand Up @@ -41,6 +41,8 @@ public class XingProfile implements Serializable {
private String permalink;
private String activeEmail;
private String displayName;
private ProfessionalExperience professionalExperience;
private EducationalBackground educationalBackground;

public XingProfile() {
}
Expand Down Expand Up @@ -157,4 +159,12 @@ public String getActiveEmail() {
public String getDisplayName() {
return displayName;
}

public ProfessionalExperience getProfessionalExperience() {
return professionalExperience;
}

public EducationalBackground getEducationalBackground() {
return educationalBackground;
}
}
@@ -0,0 +1,18 @@
package org.springframework.social.xing.api.impl.json;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Created by json2pojo
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class AwardMixin {
@JsonProperty("name")
private String name;
@JsonProperty("date_awarded")
private Long dateAwarded;
@JsonProperty("url")
private Object url;

}
@@ -0,0 +1,34 @@
package org.springframework.social.xing.api.impl.json;

import org.springframework.social.xing.api.XingDate;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonIgnoreProperties(ignoreUnknown = true)
abstract class CompanyMixin {

@JsonProperty("id")
private String id;
@JsonProperty("industry")
private String industry;
@JsonProperty("company_size")
private String companySize;
@JsonProperty("end_date")
private XingDate endDate;
@JsonProperty("tag")
private String tag;
@JsonProperty("name")
private String name;
@JsonProperty("url")
private String url;
@JsonProperty("career_level")
private String careerLevel;
@JsonProperty("title")
private String title;
@JsonProperty("begin_date")
private XingDate beginDate;
@JsonProperty("description")
private String description;

}
@@ -0,0 +1,20 @@
package org.springframework.social.xing.api.impl.json;

import java.util.List;

import org.springframework.social.xing.api.School;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonIgnoreProperties(ignoreUnknown = true)
public class EducationalBackgroundMixin {

@JsonProperty("primary_school")
private School primarySchool;
@JsonProperty("qualifications")
private List<String> qualifications;
@JsonProperty("schools")
private List<School> schools;

}
@@ -0,0 +1,24 @@
package org.springframework.social.xing.api.impl.json;

import java.util.List;

import org.springframework.social.xing.api.Award;
import org.springframework.social.xing.api.Company;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Created by json2pojo
*/
@JsonIgnoreProperties(ignoreUnknown = true)
abstract class ProfessionalExperienceMixin {

@JsonProperty("non_primary_companies")
private List<Company> nonPrimaryCompanies;
@JsonProperty("awards")
private List<Award> awards;
@JsonProperty("primary_company")
private Company primaryCompany;

}
@@ -0,0 +1,29 @@
package org.springframework.social.xing.api.impl.json;

import org.springframework.social.xing.api.XingDate;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Created by json2pojo
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class SchoolMixin {

@JsonProperty("id")
private String id;
@JsonProperty("subject")
private String subject;
@JsonProperty("end_date")
private XingDate endDate;
@JsonProperty("degree")
private String degree;
@JsonProperty("name")
private String name;
@JsonProperty("begin_date")
private XingDate beginDate;
@JsonProperty("notes")
private String notes;

}

0 comments on commit 5b5f244

Please sign in to comment.