.class public final Lcom/google/gson/internal/Excluder; .super Ljava/lang/Object; .source "" # interfaces .implements Lcom/google/gson/TypeAdapterFactory; .implements Ljava/lang/Cloneable; # static fields .field public static final DEFAULT:Lcom/google/gson/internal/Excluder; .field private static final IGNORE_VERSIONS:D = -1.0 # instance fields .field private deserializationStrategies:Ljava/util/List; .annotation system Ldalvik/annotation/Signature; value = { "Ljava/util/List<", "Lcom/google/gson/ExclusionStrategy;", ">;" } .end annotation .end field .field private modifiers:I .field private requireExpose:Z .field private serializationStrategies:Ljava/util/List; .annotation system Ldalvik/annotation/Signature; value = { "Ljava/util/List<", "Lcom/google/gson/ExclusionStrategy;", ">;" } .end annotation .end field .field private serializeInnerClasses:Z .field private version:D # direct methods .method static constructor ()V .locals 1 new-instance v0, Lcom/google/gson/internal/Excluder; invoke-direct {v0}, Lcom/google/gson/internal/Excluder;->()V sput-object v0, Lcom/google/gson/internal/Excluder;->DEFAULT:Lcom/google/gson/internal/Excluder; return-void .end method .method public constructor ()V .locals 2 invoke-direct {p0}, Ljava/lang/Object;->()V const-wide/high16 v0, -0x4010000000000000L # -1.0 iput-wide v0, p0, Lcom/google/gson/internal/Excluder;->version:D const/16 v0, 0x88 iput v0, p0, Lcom/google/gson/internal/Excluder;->modifiers:I const/4 v0, 0x1 iput-boolean v0, p0, Lcom/google/gson/internal/Excluder;->serializeInnerClasses:Z invoke-static {}, Ljava/util/Collections;->emptyList()Ljava/util/List; move-result-object v0 iput-object v0, p0, Lcom/google/gson/internal/Excluder;->serializationStrategies:Ljava/util/List; invoke-static {}, Ljava/util/Collections;->emptyList()Ljava/util/List; move-result-object v0 iput-object v0, p0, Lcom/google/gson/internal/Excluder;->deserializationStrategies:Ljava/util/List; return-void .end method .method private isAnonymousOrLocal(Ljava/lang/Class;)Z .locals 1 .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/lang/Class<", "*>;)Z" } .end annotation const-class v0, Ljava/lang/Enum; invoke-virtual {v0, p1}, Ljava/lang/Class;->isAssignableFrom(Ljava/lang/Class;)Z move-result v0 if-nez v0, :cond_1 invoke-virtual {p1}, Ljava/lang/Class;->isAnonymousClass()Z move-result v0 if-nez v0, :cond_0 invoke-virtual {p1}, Ljava/lang/Class;->isLocalClass()Z move-result p1 if-eqz p1, :cond_1 :cond_0 const/4 p1, 0x1 goto :goto_0 :cond_1 const/4 p1, 0x0 :goto_0 return p1 .end method .method private isInnerClass(Ljava/lang/Class;)Z .locals 1 .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/lang/Class<", "*>;)Z" } .end annotation invoke-virtual {p1}, Ljava/lang/Class;->isMemberClass()Z move-result v0 if-eqz v0, :cond_0 invoke-direct {p0, p1}, Lcom/google/gson/internal/Excluder;->isStatic(Ljava/lang/Class;)Z move-result p1 if-nez p1, :cond_0 const/4 p1, 0x1 goto :goto_0 :cond_0 const/4 p1, 0x0 :goto_0 return p1 .end method .method private isStatic(Ljava/lang/Class;)Z .locals 0 .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/lang/Class<", "*>;)Z" } .end annotation invoke-virtual {p1}, Ljava/lang/Class;->getModifiers()I move-result p1 and-int/lit8 p1, p1, 0x8 if-eqz p1, :cond_0 const/4 p1, 0x1 goto :goto_0 :cond_0 const/4 p1, 0x0 :goto_0 return p1 .end method .method private isValidSince(Lcom/google/gson/annotations/Since;)Z .locals 4 if-eqz p1, :cond_0 invoke-interface {p1}, Lcom/google/gson/annotations/Since;->value()D move-result-wide v0 iget-wide v2, p0, Lcom/google/gson/internal/Excluder;->version:D cmpl-double p1, v0, v2 if-lez p1, :cond_0 const/4 p1, 0x0 return p1 :cond_0 const/4 p1, 0x1 return p1 .end method .method private isValidUntil(Lcom/google/gson/annotations/Until;)Z .locals 4 if-eqz p1, :cond_0 invoke-interface {p1}, Lcom/google/gson/annotations/Until;->value()D move-result-wide v0 iget-wide v2, p0, Lcom/google/gson/internal/Excluder;->version:D cmpg-double p1, v0, v2 if-gtz p1, :cond_0 const/4 p1, 0x0 return p1 :cond_0 const/4 p1, 0x1 return p1 .end method .method private isValidVersion(Lcom/google/gson/annotations/Since;Lcom/google/gson/annotations/Until;)Z .locals 0 invoke-direct {p0, p1}, Lcom/google/gson/internal/Excluder;->isValidSince(Lcom/google/gson/annotations/Since;)Z move-result p1 if-eqz p1, :cond_0 invoke-direct {p0, p2}, Lcom/google/gson/internal/Excluder;->isValidUntil(Lcom/google/gson/annotations/Until;)Z move-result p1 if-eqz p1, :cond_0 const/4 p1, 0x1 goto :goto_0 :cond_0 const/4 p1, 0x0 :goto_0 return p1 .end method # virtual methods .method protected clone()Lcom/google/gson/internal/Excluder; .locals 2 :try_start_0 invoke-super {p0}, Ljava/lang/Object;->clone()Ljava/lang/Object; move-result-object v0 check-cast v0, Lcom/google/gson/internal/Excluder; :try_end_0 .catch Ljava/lang/CloneNotSupportedException; {:try_start_0 .. :try_end_0} :catch_0 return-object v0 :catch_0 move-exception v0 new-instance v1, Ljava/lang/AssertionError; invoke-direct {v1, v0}, Ljava/lang/AssertionError;->(Ljava/lang/Object;)V throw v1 .end method .method protected bridge synthetic clone()Ljava/lang/Object; .locals 1 .annotation system Ldalvik/annotation/Throws; value = { Ljava/lang/CloneNotSupportedException; } .end annotation invoke-virtual {p0}, Lcom/google/gson/internal/Excluder;->clone()Lcom/google/gson/internal/Excluder; move-result-object v0 return-object v0 .end method .method public create(Lcom/google/gson/Gson;Lcom/google/gson/reflect/TypeToken;)Lcom/google/gson/TypeAdapter; .locals 8 .annotation system Ldalvik/annotation/Signature; value = { "(", "Lcom/google/gson/Gson;", "Lcom/google/gson/reflect/TypeToken<", "TT;>;)", "Lcom/google/gson/TypeAdapter<", "TT;>;" } .end annotation invoke-virtual {p2}, Lcom/google/gson/reflect/TypeToken;->getRawType()Ljava/lang/Class; move-result-object v0 const/4 v1, 0x1 invoke-virtual {p0, v0, v1}, Lcom/google/gson/internal/Excluder;->excludeClass(Ljava/lang/Class;Z)Z move-result v5 const/4 v1, 0x0 invoke-virtual {p0, v0, v1}, Lcom/google/gson/internal/Excluder;->excludeClass(Ljava/lang/Class;Z)Z move-result v4 if-nez v5, :cond_0 if-nez v4, :cond_0 const/4 p1, 0x0 return-object p1 :cond_0 new-instance v0, Lcom/google/gson/internal/Excluder$1; move-object v2, v0 move-object v3, p0 move-object v6, p1 move-object v7, p2 invoke-direct/range {v2 .. v7}, Lcom/google/gson/internal/Excluder$1;->(Lcom/google/gson/internal/Excluder;ZZLcom/google/gson/Gson;Lcom/google/gson/reflect/TypeToken;)V return-object v0 .end method .method public disableInnerClassSerialization()Lcom/google/gson/internal/Excluder; .locals 2 invoke-virtual {p0}, Lcom/google/gson/internal/Excluder;->clone()Lcom/google/gson/internal/Excluder; move-result-object v0 const/4 v1, 0x0 iput-boolean v1, v0, Lcom/google/gson/internal/Excluder;->serializeInnerClasses:Z return-object v0 .end method .method public excludeClass(Ljava/lang/Class;Z)Z .locals 6 .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/lang/Class<", "*>;Z)Z" } .end annotation iget-wide v0, p0, Lcom/google/gson/internal/Excluder;->version:D const/4 v2, 0x1 const-wide/high16 v3, -0x4010000000000000L # -1.0 cmpl-double v5, v0, v3 if-eqz v5, :cond_0 const-class v0, Lcom/google/gson/annotations/Since; invoke-virtual {p1, v0}, Ljava/lang/Class;->getAnnotation(Ljava/lang/Class;)Ljava/lang/annotation/Annotation; move-result-object v0 check-cast v0, Lcom/google/gson/annotations/Since; const-class v1, Lcom/google/gson/annotations/Until; invoke-virtual {p1, v1}, Ljava/lang/Class;->getAnnotation(Ljava/lang/Class;)Ljava/lang/annotation/Annotation; move-result-object v1 check-cast v1, Lcom/google/gson/annotations/Until; invoke-direct {p0, v0, v1}, Lcom/google/gson/internal/Excluder;->isValidVersion(Lcom/google/gson/annotations/Since;Lcom/google/gson/annotations/Until;)Z move-result v0 if-nez v0, :cond_0 return v2 :cond_0 iget-boolean v0, p0, Lcom/google/gson/internal/Excluder;->serializeInnerClasses:Z if-nez v0, :cond_1 invoke-direct {p0, p1}, Lcom/google/gson/internal/Excluder;->isInnerClass(Ljava/lang/Class;)Z move-result v0 if-eqz v0, :cond_1 return v2 :cond_1 invoke-direct {p0, p1}, Lcom/google/gson/internal/Excluder;->isAnonymousOrLocal(Ljava/lang/Class;)Z move-result v0 if-eqz v0, :cond_2 return v2 :cond_2 if-eqz p2, :cond_3 iget-object p2, p0, Lcom/google/gson/internal/Excluder;->serializationStrategies:Ljava/util/List; goto :goto_0 :cond_3 iget-object p2, p0, Lcom/google/gson/internal/Excluder;->deserializationStrategies:Ljava/util/List; :goto_0 invoke-interface {p2}, Ljava/util/List;->iterator()Ljava/util/Iterator; move-result-object p2 :cond_4 invoke-interface {p2}, Ljava/util/Iterator;->hasNext()Z move-result v0 if-eqz v0, :cond_5 invoke-interface {p2}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v0 check-cast v0, Lcom/google/gson/ExclusionStrategy; invoke-interface {v0, p1}, Lcom/google/gson/ExclusionStrategy;->shouldSkipClass(Ljava/lang/Class;)Z move-result v0 if-eqz v0, :cond_4 return v2 :cond_5 const/4 p1, 0x0 return p1 .end method .method public excludeField(Ljava/lang/reflect/Field;Z)Z .locals 6 iget v0, p0, Lcom/google/gson/internal/Excluder;->modifiers:I invoke-virtual {p1}, Ljava/lang/reflect/Field;->getModifiers()I move-result v1 and-int/2addr v0, v1 const/4 v1, 0x1 if-eqz v0, :cond_0 return v1 :cond_0 iget-wide v2, p0, Lcom/google/gson/internal/Excluder;->version:D const-wide/high16 v4, -0x4010000000000000L # -1.0 cmpl-double v0, v2, v4 if-eqz v0, :cond_1 const-class v0, Lcom/google/gson/annotations/Since; invoke-virtual {p1, v0}, Ljava/lang/reflect/Field;->getAnnotation(Ljava/lang/Class;)Ljava/lang/annotation/Annotation; move-result-object v0 check-cast v0, Lcom/google/gson/annotations/Since; const-class v2, Lcom/google/gson/annotations/Until; invoke-virtual {p1, v2}, Ljava/lang/reflect/Field;->getAnnotation(Ljava/lang/Class;)Ljava/lang/annotation/Annotation; move-result-object v2 check-cast v2, Lcom/google/gson/annotations/Until; invoke-direct {p0, v0, v2}, Lcom/google/gson/internal/Excluder;->isValidVersion(Lcom/google/gson/annotations/Since;Lcom/google/gson/annotations/Until;)Z move-result v0 if-nez v0, :cond_1 return v1 :cond_1 invoke-virtual {p1}, Ljava/lang/reflect/Field;->isSynthetic()Z move-result v0 if-eqz v0, :cond_2 return v1 :cond_2 iget-boolean v0, p0, Lcom/google/gson/internal/Excluder;->requireExpose:Z if-eqz v0, :cond_5 const-class v0, Lcom/google/gson/annotations/Expose; invoke-virtual {p1, v0}, Ljava/lang/reflect/Field;->getAnnotation(Ljava/lang/Class;)Ljava/lang/annotation/Annotation; move-result-object v0 check-cast v0, Lcom/google/gson/annotations/Expose; if-eqz v0, :cond_4 if-eqz p2, :cond_3 invoke-interface {v0}, Lcom/google/gson/annotations/Expose;->serialize()Z move-result v0 if-nez v0, :cond_5 goto :goto_0 :cond_3 invoke-interface {v0}, Lcom/google/gson/annotations/Expose;->deserialize()Z move-result v0 if-nez v0, :cond_5 :cond_4 :goto_0 return v1 :cond_5 iget-boolean v0, p0, Lcom/google/gson/internal/Excluder;->serializeInnerClasses:Z if-nez v0, :cond_6 invoke-virtual {p1}, Ljava/lang/reflect/Field;->getType()Ljava/lang/Class; move-result-object v0 invoke-direct {p0, v0}, Lcom/google/gson/internal/Excluder;->isInnerClass(Ljava/lang/Class;)Z move-result v0 if-eqz v0, :cond_6 return v1 :cond_6 invoke-virtual {p1}, Ljava/lang/reflect/Field;->getType()Ljava/lang/Class; move-result-object v0 invoke-direct {p0, v0}, Lcom/google/gson/internal/Excluder;->isAnonymousOrLocal(Ljava/lang/Class;)Z move-result v0 if-eqz v0, :cond_7 return v1 :cond_7 if-eqz p2, :cond_8 iget-object p2, p0, Lcom/google/gson/internal/Excluder;->serializationStrategies:Ljava/util/List; goto :goto_1 :cond_8 iget-object p2, p0, Lcom/google/gson/internal/Excluder;->deserializationStrategies:Ljava/util/List; :goto_1 invoke-interface {p2}, Ljava/util/List;->isEmpty()Z move-result v0 if-nez v0, :cond_a new-instance v0, Lcom/google/gson/FieldAttributes; invoke-direct {v0, p1}, Lcom/google/gson/FieldAttributes;->(Ljava/lang/reflect/Field;)V invoke-interface {p2}, Ljava/util/List;->iterator()Ljava/util/Iterator; move-result-object p1 :cond_9 invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z move-result p2 if-eqz p2, :cond_a invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object p2 check-cast p2, Lcom/google/gson/ExclusionStrategy; invoke-interface {p2, v0}, Lcom/google/gson/ExclusionStrategy;->shouldSkipField(Lcom/google/gson/FieldAttributes;)Z move-result p2 if-eqz p2, :cond_9 return v1 :cond_a const/4 p1, 0x0 return p1 .end method .method public excludeFieldsWithoutExposeAnnotation()Lcom/google/gson/internal/Excluder; .locals 2 invoke-virtual {p0}, Lcom/google/gson/internal/Excluder;->clone()Lcom/google/gson/internal/Excluder; move-result-object v0 const/4 v1, 0x1 iput-boolean v1, v0, Lcom/google/gson/internal/Excluder;->requireExpose:Z return-object v0 .end method .method public withExclusionStrategy(Lcom/google/gson/ExclusionStrategy;ZZ)Lcom/google/gson/internal/Excluder; .locals 2 invoke-virtual {p0}, Lcom/google/gson/internal/Excluder;->clone()Lcom/google/gson/internal/Excluder; move-result-object v0 if-eqz p2, :cond_0 new-instance p2, Ljava/util/ArrayList; iget-object v1, p0, Lcom/google/gson/internal/Excluder;->serializationStrategies:Ljava/util/List; invoke-direct {p2, v1}, Ljava/util/ArrayList;->(Ljava/util/Collection;)V iput-object p2, v0, Lcom/google/gson/internal/Excluder;->serializationStrategies:Ljava/util/List; iget-object p2, v0, Lcom/google/gson/internal/Excluder;->serializationStrategies:Ljava/util/List; invoke-interface {p2, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z :cond_0 if-eqz p3, :cond_1 new-instance p2, Ljava/util/ArrayList; iget-object p3, p0, Lcom/google/gson/internal/Excluder;->deserializationStrategies:Ljava/util/List; invoke-direct {p2, p3}, Ljava/util/ArrayList;->(Ljava/util/Collection;)V iput-object p2, v0, Lcom/google/gson/internal/Excluder;->deserializationStrategies:Ljava/util/List; iget-object p2, v0, Lcom/google/gson/internal/Excluder;->deserializationStrategies:Ljava/util/List; invoke-interface {p2, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z :cond_1 return-object v0 .end method .method public varargs withModifiers([I)Lcom/google/gson/internal/Excluder; .locals 5 invoke-virtual {p0}, Lcom/google/gson/internal/Excluder;->clone()Lcom/google/gson/internal/Excluder; move-result-object v0 const/4 v1, 0x0 iput v1, v0, Lcom/google/gson/internal/Excluder;->modifiers:I array-length v2, p1 :goto_0 if-ge v1, v2, :cond_0 aget v3, p1, v1 iget v4, v0, Lcom/google/gson/internal/Excluder;->modifiers:I or-int/2addr v3, v4 iput v3, v0, Lcom/google/gson/internal/Excluder;->modifiers:I add-int/lit8 v1, v1, 0x1 goto :goto_0 :cond_0 return-object v0 .end method .method public withVersion(D)Lcom/google/gson/internal/Excluder; .locals 1 invoke-virtual {p0}, Lcom/google/gson/internal/Excluder;->clone()Lcom/google/gson/internal/Excluder; move-result-object v0 iput-wide p1, v0, Lcom/google/gson/internal/Excluder;->version:D return-object v0 .end method