com.vaadin.server.communication
Class DateSerializer

java.lang.Object
  extended by com.vaadin.server.communication.DateSerializer
All Implemented Interfaces:
JSONSerializer<java.util.Date>

public class DateSerializer
extends java.lang.Object
implements JSONSerializer<java.util.Date>

Server side serializer/deserializer for java.util.Date

Since:
7.2
Author:
Vaadin Ltd

Constructor Summary
DateSerializer()
           
 
Method Summary
 java.util.Date deserialize(java.lang.reflect.Type type, java.lang.Object jsonValue, ConnectorTracker connectorTracker)
          Creates and deserializes an object received from the client.
 java.lang.Object serialize(java.util.Date value, ConnectorTracker connectorTracker)
          Serialize the given object into JSON.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateSerializer

public DateSerializer()
Method Detail

deserialize

public java.util.Date deserialize(java.lang.reflect.Type type,
                                  java.lang.Object jsonValue,
                                  ConnectorTracker connectorTracker)
Description copied from interface: JSONSerializer
Creates and deserializes an object received from the client. Must be compatible with JSONSerializer.serialize(Object, ConnectorTracker) and also with the client side com.vaadin.client.communication.JSONSerializer.

The json parameter is of type Object as org.json JSON classes have no other common super class

Specified by:
deserialize in interface JSONSerializer<java.util.Date>
Parameters:
type - The expected return type
jsonValue - the value from the JSON
connectorTracker - the connector tracker instance for the UI
Returns:
A deserialized object

serialize

public java.lang.Object serialize(java.util.Date value,
                                  ConnectorTracker connectorTracker)
Description copied from interface: JSONSerializer
Serialize the given object into JSON. Must be compatible with #deserialize(Object, connectorTracker) and the client side com.vaadin.client.communication.JSONSerializer

Specified by:
serialize in interface JSONSerializer<java.util.Date>
Parameters:
value - The object to serialize
connectorTracker - The connector tracker instance for the UI
Returns:
A JSON serialized version of the object


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.