/**
 * Copyright 2010-2013 Ralph Schaer <ralphschaer@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package ch.rasc.extdirectspring.demo.sch;

import org.joda.time.DateTime;

import ch.rasc.extdirectspring.demo.util.ISO8601DateTimeDeserializer;
import ch.rasc.extdirectspring.demo.util.ISO8601DateTimeSerializer;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

@JsonIgnoreProperties({ "id", "Cls" })
public class Event {

	@JsonProperty("Id")
	private String id;

	@JsonProperty("Name")
	private String name;

	@JsonProperty("StartDate")
	private DateTime startDate;

	@JsonProperty("EndDate")
	private DateTime endDate;

	@JsonProperty("ResourceId")
	private String resourceId;

	private boolean resizable;

	private boolean draggable;

	private String cls;

	private String text;

	private int duration;

	private String synopsis;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@JsonSerialize(using = ISO8601DateTimeSerializer.class)
	public DateTime getStartDate() {
		return startDate;
	}

	@JsonDeserialize(using = ISO8601DateTimeDeserializer.class)
	public void setStartDate(DateTime startDate) {
		this.startDate = startDate;
	}

	@JsonSerialize(using = ISO8601DateTimeSerializer.class)
	public DateTime getEndDate() {
		return endDate;
	}

	@JsonDeserialize(using = ISO8601DateTimeDeserializer.class)
	public void setEndDate(DateTime endDate) {
		this.endDate = endDate;
	}

	public String getResourceId() {
		return resourceId;
	}

	public void setResourceId(String resourceId) {
		this.resourceId = resourceId;
	}

	public boolean isResizable() {
		return resizable;
	}

	public void setResizable(boolean resizable) {
		this.resizable = resizable;
	}

	public boolean isDraggable() {
		return draggable;
	}

	public void setDraggable(boolean draggable) {
		this.draggable = draggable;
	}

	public String getCls() {
		return cls;
	}

	public void setCls(String cls) {
		this.cls = cls;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public int getDuration() {
		return duration;
	}

	public void setDuration(int duration) {
		this.duration = duration;
	}

	public String getSynopsis() {
		return synopsis;
	}

	public void setSynopsis(String synopsis) {
		this.synopsis = synopsis;
	}

	@Override
	public String toString() {
		return "Event [id=" + id + ", name=" + name + ", startDate=" + startDate + ", endDate=" + endDate
				+ ", resourceId=" + resourceId + ", resizable=" + resizable + ", draggable=" + draggable + ", cls="
				+ cls + ", text=" + text + ", duration=" + duration + ", synopsis=" + synopsis + "]";
	}

}

@@ -1260,61 +1260,297 @@
 %22)%0A%09
-private DateTime startDate;%0A%0A%09@JsonProperty(%22EndDate%22
+@JsonSerialize(using = ISO8601DateTimeSerializer.class)%0A%09@JsonDeserialize(using = ISO8601DateTimeDeserializer.class)%0A%09private DateTime startDate;%0A%0A%09@JsonProperty(%22EndDate%22)%0A%09@JsonSerialize(using = ISO8601DateTimeSerializer.class)%0A%09@JsonDeserialize(using = ISO8601DateTimeDeserializer.class
 )%0A%09p
@@ -1991,65 +1991,8 @@
 %09%7D%0A%0A
-%09@JsonSerialize(using = ISO8601DateTimeSerializer.class)%0A
 %09pub
@@ -2049,69 +2049,8 @@
 %09%7D%0A%0A
-%09@JsonDeserialize(using = ISO8601DateTimeDeserializer.class)%0A
 %09pub
@@ -2132,178 +2132,60 @@
 %7D%0A%0A%09
-@JsonSerialize(using = ISO8601DateTimeSerializer.class)%0A%09public DateTime getEndDate() %7B%0A%09%09return endDate;%0A%09%7D%0A%0A%09@JsonDeserialize(using = ISO8601DateTimeDeserializer.class)
+public DateTime getEndDate() %7B%0A%09%09return endDate;%0A%09%7D%0A
 %0A%09pu

Move jackson annotations to the fields.