.class public Lcom/amazonaws/util/json/DateDeserializer; .super Ljava/lang/Object; .source "SourceFile" # interfaces .implements Lcom/google/gson/JsonDeserializer; .implements Lcom/google/gson/JsonSerializer; # annotations .annotation system Ldalvik/annotation/Signature; value = { "Ljava/lang/Object;", "Lcom/google/gson/JsonDeserializer<", "Ljava/util/Date;", ">;", "Lcom/google/gson/JsonSerializer<", "Ljava/util/Date;", ">;" } .end annotation # instance fields .field public final dateFormats:Ljava/util/List; .field public final mIso8601DateFormat:Ljava/text/SimpleDateFormat; .field public mSimpleDateFormat:Ljava/text/SimpleDateFormat; # virtual methods .method public bridge synthetic deserialize(Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/lang/Object; .locals 0 .line 23 invoke-virtual {p0, p1, p2, p3}, Lcom/amazonaws/util/json/DateDeserializer;->deserialize(Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/util/Date; move-result-object p1 return-object p1 .end method .method public deserialize(Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/util/Date; .locals 3 .line 41 invoke-virtual {p1}, Lcom/google/gson/JsonElement;->getAsString()Ljava/lang/String; move-result-object p1 iget-object p2, p0, Lcom/amazonaws/util/json/DateDeserializer;->dateFormats:Ljava/util/List; .line 43 invoke-interface {p2}, Ljava/util/List;->iterator()Ljava/util/Iterator; move-result-object p2 :catch_0 invoke-interface {p2}, Ljava/util/Iterator;->hasNext()Z move-result p3 if-eqz p3, :cond_0 invoke-interface {p2}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object p3 check-cast p3, Ljava/lang/String; .line 45 :try_start_0 new-instance v0, Ljava/util/Date; invoke-direct {v0}, Ljava/util/Date;->()V .line 46 new-instance v1, Ljava/text/SimpleDateFormat; invoke-direct {v1, p3}, Ljava/text/SimpleDateFormat;->(Ljava/lang/String;)V iput-object v1, p0, Lcom/amazonaws/util/json/DateDeserializer;->mSimpleDateFormat:Ljava/text/SimpleDateFormat; .line 47 invoke-virtual {v1, p1}, Ljava/text/DateFormat;->parse(Ljava/lang/String;)Ljava/util/Date; move-result-object p3 invoke-virtual {p3}, Ljava/util/Date;->getTime()J move-result-wide v1 invoke-virtual {v0, v1, v2}, Ljava/util/Date;->setTime(J)V :try_end_0 .catch Ljava/text/ParseException; {:try_start_0 .. :try_end_0} :catch_0 return-object v0 :cond_0 const/4 p2, 0x2 .line 55 :try_start_1 invoke-static {p2}, Ljava/text/DateFormat;->getDateInstance(I)Ljava/text/DateFormat; move-result-object p2 invoke-virtual {p2, p1}, Ljava/text/DateFormat;->parse(Ljava/lang/String;)Ljava/util/Date; move-result-object p1 :try_end_1 .catch Ljava/text/ParseException; {:try_start_1 .. :try_end_1} :catch_1 return-object p1 :catch_1 move-exception p1 .line 57 new-instance p2, Lcom/google/gson/JsonParseException; invoke-virtual {p1}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String; move-result-object p3 invoke-direct {p2, p3, p1}, Lcom/google/gson/JsonParseException;->(Ljava/lang/String;Ljava/lang/Throwable;)V throw p2 .end method .method public bridge synthetic serialize(Ljava/lang/Object;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement; .locals 0 .line 23 check-cast p1, Ljava/util/Date; invoke-virtual {p0, p1, p2, p3}, Lcom/amazonaws/util/json/DateDeserializer;->serialize(Ljava/util/Date;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement; move-result-object p1 return-object p1 .end method .method public serialize(Ljava/util/Date;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement; .locals 0 iget-object p2, p0, Lcom/amazonaws/util/json/DateDeserializer;->mIso8601DateFormat:Ljava/text/SimpleDateFormat; .line 65 monitor-enter p2 :try_start_0 iget-object p3, p0, Lcom/amazonaws/util/json/DateDeserializer;->mIso8601DateFormat:Ljava/text/SimpleDateFormat; .line 66 invoke-virtual {p3, p1}, Ljava/text/DateFormat;->format(Ljava/util/Date;)Ljava/lang/String; move-result-object p1 .line 67 new-instance p3, Lcom/google/gson/JsonPrimitive; invoke-direct {p3, p1}, Lcom/google/gson/JsonPrimitive;->(Ljava/lang/String;)V monitor-exit p2 return-object p3 :catchall_0 move-exception p1 .line 68 monitor-exit p2 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 throw p1 .end method