123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762 |
- .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 <clinit>()V
- .locals 1
- new-instance v0, Lcom/google/gson/internal/Excluder;
- invoke-direct {v0}, Lcom/google/gson/internal/Excluder;-><init>()V
- sput-object v0, Lcom/google/gson/internal/Excluder;->DEFAULT:Lcom/google/gson/internal/Excluder;
- return-void
- .end method
- .method public constructor <init>()V
- .locals 2
- invoke-direct {p0}, Ljava/lang/Object;-><init>()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;-><init>(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 = {
- "<T:",
- "Ljava/lang/Object;",
- ">(",
- "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;-><init>(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;-><init>(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;-><init>(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;-><init>(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
|