Class 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

      Constructors 
      Constructor Description
      DateSerializer()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Date deserialize​(java.lang.reflect.Type type, elemental.json.JsonValue jsonValue, ConnectorTracker connectorTracker)
      Creates and deserializes an object received from the client.
      elemental.json.JsonValue 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,
                                          elemental.json.JsonValue 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.
        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 elemental.json.JsonValue serialize​(java.util.Date value,
                                                  ConnectorTracker connectorTracker)
        Description copied from interface: JSONSerializer
        Serialize the given object into JSON. Must be compatible with JSONSerializer.deserialize(Type, JsonValue, 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