public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException
  {
    if (!(json instanceof JsonPrimitive)) {
      throw new JsonParseException("The date should be a string value");
    }

    Date date = deserializeToDate(json);

    if (typeOfT == Date.class) {
      return date;
    }
    throw new IllegalArgumentException(getClass() + " cannot deserialize to " + typeOfT);
  }