1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306 |
- .class public Lcom/google/gson/stream/JsonWriter;
- .super Ljava/lang/Object;
- .source ""
- # interfaces
- .implements Ljava/io/Closeable;
- .implements Ljava/io/Flushable;
- # static fields
- .field private static final HTML_SAFE_REPLACEMENT_CHARS:[Ljava/lang/String;
- .field private static final REPLACEMENT_CHARS:[Ljava/lang/String;
- # instance fields
- .field private deferredName:Ljava/lang/String;
- .field private htmlSafe:Z
- .field private indent:Ljava/lang/String;
- .field private lenient:Z
- .field private final out:Ljava/io/Writer;
- .field private separator:Ljava/lang/String;
- .field private serializeNulls:Z
- .field private stack:[I
- .field private stackSize:I
- # direct methods
- .method static constructor <clinit>()V
- .locals 5
- const/16 v0, 0x80
- new-array v0, v0, [Ljava/lang/String;
- sput-object v0, Lcom/google/gson/stream/JsonWriter;->REPLACEMENT_CHARS:[Ljava/lang/String;
- const/4 v0, 0x0
- const/4 v1, 0x0
- :goto_0
- const/16 v2, 0x1f
- if-gt v1, v2, :cond_0
- sget-object v2, Lcom/google/gson/stream/JsonWriter;->REPLACEMENT_CHARS:[Ljava/lang/String;
- const/4 v3, 0x1
- new-array v3, v3, [Ljava/lang/Object;
- invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
- move-result-object v4
- aput-object v4, v3, v0
- const-string v4, "\\u%04x"
- invoke-static {v4, v3}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
- move-result-object v3
- aput-object v3, v2, v1
- add-int/lit8 v1, v1, 0x1
- goto :goto_0
- :cond_0
- sget-object v0, Lcom/google/gson/stream/JsonWriter;->REPLACEMENT_CHARS:[Ljava/lang/String;
- const/16 v1, 0x22
- const-string v2, "\\\""
- aput-object v2, v0, v1
- const/16 v1, 0x5c
- const-string v2, "\\\\"
- aput-object v2, v0, v1
- const/16 v1, 0x9
- const-string v2, "\\t"
- aput-object v2, v0, v1
- const/16 v1, 0x8
- const-string v2, "\\b"
- aput-object v2, v0, v1
- const/16 v1, 0xa
- const-string v2, "\\n"
- aput-object v2, v0, v1
- const/16 v1, 0xd
- const-string v2, "\\r"
- aput-object v2, v0, v1
- const/16 v1, 0xc
- const-string v2, "\\f"
- aput-object v2, v0, v1
- invoke-virtual {v0}, [Ljava/lang/String;->clone()Ljava/lang/Object;
- move-result-object v0
- check-cast v0, [Ljava/lang/String;
- sput-object v0, Lcom/google/gson/stream/JsonWriter;->HTML_SAFE_REPLACEMENT_CHARS:[Ljava/lang/String;
- sget-object v0, Lcom/google/gson/stream/JsonWriter;->HTML_SAFE_REPLACEMENT_CHARS:[Ljava/lang/String;
- const/16 v1, 0x3c
- const-string v2, "\\u003c"
- aput-object v2, v0, v1
- const/16 v1, 0x3e
- const-string v2, "\\u003e"
- aput-object v2, v0, v1
- const/16 v1, 0x26
- const-string v2, "\\u0026"
- aput-object v2, v0, v1
- const/16 v1, 0x3d
- const-string v2, "\\u003d"
- aput-object v2, v0, v1
- const/16 v1, 0x27
- const-string v2, "\\u0027"
- aput-object v2, v0, v1
- return-void
- .end method
- .method public constructor <init>(Ljava/io/Writer;)V
- .locals 1
- invoke-direct {p0}, Ljava/lang/Object;-><init>()V
- const/16 v0, 0x20
- new-array v0, v0, [I
- iput-object v0, p0, Lcom/google/gson/stream/JsonWriter;->stack:[I
- const/4 v0, 0x0
- iput v0, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
- const/4 v0, 0x6
- invoke-direct {p0, v0}, Lcom/google/gson/stream/JsonWriter;->push(I)V
- const-string v0, ":"
- iput-object v0, p0, Lcom/google/gson/stream/JsonWriter;->separator:Ljava/lang/String;
- const/4 v0, 0x1
- iput-boolean v0, p0, Lcom/google/gson/stream/JsonWriter;->serializeNulls:Z
- if-eqz p1, :cond_0
- iput-object p1, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
- return-void
- :cond_0
- new-instance p1, Ljava/lang/NullPointerException;
- const-string v0, "out == null"
- invoke-direct {p1, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
- throw p1
- .end method
- .method private beforeName()V
- .locals 2
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->peek()I
- move-result v0
- const/4 v1, 0x5
- if-ne v0, v1, :cond_0
- iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
- const/16 v1, 0x2c
- invoke-virtual {v0, v1}, Ljava/io/Writer;->write(I)V
- goto :goto_0
- :cond_0
- const/4 v1, 0x3
- if-ne v0, v1, :cond_1
- :goto_0
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->newline()V
- const/4 v0, 0x4
- invoke-direct {p0, v0}, Lcom/google/gson/stream/JsonWriter;->replaceTop(I)V
- return-void
- :cond_1
- new-instance v0, Ljava/lang/IllegalStateException;
- const-string v1, "Nesting problem."
- invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
- throw v0
- .end method
- .method private beforeValue()V
- .locals 3
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->peek()I
- move-result v0
- const/4 v1, 0x1
- const/4 v2, 0x2
- if-eq v0, v1, :cond_5
- if-eq v0, v2, :cond_4
- const/4 v1, 0x4
- if-eq v0, v1, :cond_3
- const/4 v1, 0x6
- const/4 v2, 0x7
- if-eq v0, v1, :cond_2
- if-ne v0, v2, :cond_1
- iget-boolean v0, p0, Lcom/google/gson/stream/JsonWriter;->lenient:Z
- if-eqz v0, :cond_0
- goto :goto_0
- :cond_0
- new-instance v0, Ljava/lang/IllegalStateException;
- const-string v1, "JSON must have only one top-level value."
- invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
- throw v0
- :cond_1
- new-instance v0, Ljava/lang/IllegalStateException;
- const-string v1, "Nesting problem."
- invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
- throw v0
- :cond_2
- :goto_0
- invoke-direct {p0, v2}, Lcom/google/gson/stream/JsonWriter;->replaceTop(I)V
- goto :goto_2
- :cond_3
- iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
- iget-object v1, p0, Lcom/google/gson/stream/JsonWriter;->separator:Ljava/lang/String;
- invoke-virtual {v0, v1}, Ljava/io/Writer;->append(Ljava/lang/CharSequence;)Ljava/io/Writer;
- const/4 v0, 0x5
- invoke-direct {p0, v0}, Lcom/google/gson/stream/JsonWriter;->replaceTop(I)V
- goto :goto_2
- :cond_4
- iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
- const/16 v1, 0x2c
- invoke-virtual {v0, v1}, Ljava/io/Writer;->append(C)Ljava/io/Writer;
- goto :goto_1
- :cond_5
- invoke-direct {p0, v2}, Lcom/google/gson/stream/JsonWriter;->replaceTop(I)V
- :goto_1
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->newline()V
- :goto_2
- return-void
- .end method
- .method private close(IILjava/lang/String;)Lcom/google/gson/stream/JsonWriter;
- .locals 1
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->peek()I
- move-result v0
- if-eq v0, p2, :cond_1
- if-ne v0, p1, :cond_0
- goto :goto_0
- :cond_0
- new-instance p1, Ljava/lang/IllegalStateException;
- const-string p2, "Nesting problem."
- invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
- throw p1
- :cond_1
- :goto_0
- iget-object p1, p0, Lcom/google/gson/stream/JsonWriter;->deferredName:Ljava/lang/String;
- if-nez p1, :cond_3
- iget p1, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
- add-int/lit8 p1, p1, -0x1
- iput p1, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
- if-ne v0, p2, :cond_2
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->newline()V
- :cond_2
- iget-object p1, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
- invoke-virtual {p1, p3}, Ljava/io/Writer;->write(Ljava/lang/String;)V
- return-object p0
- :cond_3
- new-instance p1, Ljava/lang/IllegalStateException;
- new-instance p2, Ljava/lang/StringBuilder;
- invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
- const-string p3, "Dangling name: "
- invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- iget-object p3, p0, Lcom/google/gson/stream/JsonWriter;->deferredName:Ljava/lang/String;
- invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object p2
- invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
- throw p1
- .end method
- .method private newline()V
- .locals 4
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->indent:Ljava/lang/String;
- if-nez v0, :cond_0
- return-void
- :cond_0
- iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
- const-string v1, "\n"
- invoke-virtual {v0, v1}, Ljava/io/Writer;->write(Ljava/lang/String;)V
- iget v0, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
- const/4 v1, 0x1
- :goto_0
- if-ge v1, v0, :cond_1
- iget-object v2, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
- iget-object v3, p0, Lcom/google/gson/stream/JsonWriter;->indent:Ljava/lang/String;
- invoke-virtual {v2, v3}, Ljava/io/Writer;->write(Ljava/lang/String;)V
- add-int/lit8 v1, v1, 0x1
- goto :goto_0
- :cond_1
- return-void
- .end method
- .method private open(ILjava/lang/String;)Lcom/google/gson/stream/JsonWriter;
- .locals 0
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->beforeValue()V
- invoke-direct {p0, p1}, Lcom/google/gson/stream/JsonWriter;->push(I)V
- iget-object p1, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
- invoke-virtual {p1, p2}, Ljava/io/Writer;->write(Ljava/lang/String;)V
- return-object p0
- .end method
- .method private peek()I
- .locals 2
- iget v0, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
- if-eqz v0, :cond_0
- iget-object v1, p0, Lcom/google/gson/stream/JsonWriter;->stack:[I
- add-int/lit8 v0, v0, -0x1
- aget v0, v1, v0
- return v0
- :cond_0
- new-instance v0, Ljava/lang/IllegalStateException;
- const-string v1, "JsonWriter is closed."
- invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
- throw v0
- .end method
- .method private push(I)V
- .locals 4
- iget v0, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
- iget-object v1, p0, Lcom/google/gson/stream/JsonWriter;->stack:[I
- array-length v2, v1
- if-ne v0, v2, :cond_0
- mul-int/lit8 v2, v0, 0x2
- new-array v2, v2, [I
- const/4 v3, 0x0
- invoke-static {v1, v3, v2, v3, v0}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
- iput-object v2, p0, Lcom/google/gson/stream/JsonWriter;->stack:[I
- :cond_0
- iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->stack:[I
- iget v1, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
- add-int/lit8 v2, v1, 0x1
- iput v2, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
- aput p1, v0, v1
- return-void
- .end method
- .method private replaceTop(I)V
- .locals 2
- iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->stack:[I
- iget v1, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
- add-int/lit8 v1, v1, -0x1
- aput p1, v0, v1
- return-void
- .end method
- .method private string(Ljava/lang/String;)V
- .locals 8
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- iget-boolean v0, p0, Lcom/google/gson/stream/JsonWriter;->htmlSafe:Z
- if-eqz v0, :cond_0
- sget-object v0, Lcom/google/gson/stream/JsonWriter;->HTML_SAFE_REPLACEMENT_CHARS:[Ljava/lang/String;
- goto :goto_0
- :cond_0
- sget-object v0, Lcom/google/gson/stream/JsonWriter;->REPLACEMENT_CHARS:[Ljava/lang/String;
- :goto_0
- iget-object v1, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
- const-string v2, "\""
- invoke-virtual {v1, v2}, Ljava/io/Writer;->write(Ljava/lang/String;)V
- invoke-virtual {p1}, Ljava/lang/String;->length()I
- move-result v1
- const/4 v3, 0x0
- const/4 v4, 0x0
- :goto_1
- if-ge v3, v1, :cond_6
- invoke-virtual {p1, v3}, Ljava/lang/String;->charAt(I)C
- move-result v5
- const/16 v6, 0x80
- if-ge v5, v6, :cond_1
- aget-object v5, v0, v5
- if-nez v5, :cond_3
- goto :goto_3
- :cond_1
- const/16 v6, 0x2028
- if-ne v5, v6, :cond_2
- const-string v5, "\\u2028"
- goto :goto_2
- :cond_2
- const/16 v6, 0x2029
- if-ne v5, v6, :cond_5
- const-string v5, "\\u2029"
- :cond_3
- :goto_2
- if-ge v4, v3, :cond_4
- iget-object v6, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
- sub-int v7, v3, v4
- invoke-virtual {v6, p1, v4, v7}, Ljava/io/Writer;->write(Ljava/lang/String;II)V
- :cond_4
- iget-object v4, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
- invoke-virtual {v4, v5}, Ljava/io/Writer;->write(Ljava/lang/String;)V
- add-int/lit8 v4, v3, 0x1
- :cond_5
- :goto_3
- add-int/lit8 v3, v3, 0x1
- goto :goto_1
- :cond_6
- if-ge v4, v1, :cond_7
- iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
- sub-int/2addr v1, v4
- invoke-virtual {v0, p1, v4, v1}, Ljava/io/Writer;->write(Ljava/lang/String;II)V
- :cond_7
- iget-object p1, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
- invoke-virtual {p1, v2}, Ljava/io/Writer;->write(Ljava/lang/String;)V
- return-void
- .end method
- .method private writeDeferredName()V
- .locals 1
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->deferredName:Ljava/lang/String;
- if-eqz v0, :cond_0
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->beforeName()V
- iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->deferredName:Ljava/lang/String;
- invoke-direct {p0, v0}, Lcom/google/gson/stream/JsonWriter;->string(Ljava/lang/String;)V
- const/4 v0, 0x0
- iput-object v0, p0, Lcom/google/gson/stream/JsonWriter;->deferredName:Ljava/lang/String;
- :cond_0
- return-void
- .end method
- # virtual methods
- .method public beginArray()Lcom/google/gson/stream/JsonWriter;
- .locals 2
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->writeDeferredName()V
- const/4 v0, 0x1
- const-string v1, "["
- invoke-direct {p0, v0, v1}, Lcom/google/gson/stream/JsonWriter;->open(ILjava/lang/String;)Lcom/google/gson/stream/JsonWriter;
- move-result-object v0
- return-object v0
- .end method
- .method public beginObject()Lcom/google/gson/stream/JsonWriter;
- .locals 2
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->writeDeferredName()V
- const/4 v0, 0x3
- const-string v1, "{"
- invoke-direct {p0, v0, v1}, Lcom/google/gson/stream/JsonWriter;->open(ILjava/lang/String;)Lcom/google/gson/stream/JsonWriter;
- move-result-object v0
- return-object v0
- .end method
- .method public close()V
- .locals 3
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
- invoke-virtual {v0}, Ljava/io/Writer;->close()V
- iget v0, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
- const/4 v1, 0x1
- if-gt v0, v1, :cond_1
- if-ne v0, v1, :cond_0
- iget-object v2, p0, Lcom/google/gson/stream/JsonWriter;->stack:[I
- sub-int/2addr v0, v1
- aget v0, v2, v0
- const/4 v1, 0x7
- if-ne v0, v1, :cond_1
- :cond_0
- const/4 v0, 0x0
- iput v0, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
- return-void
- :cond_1
- new-instance v0, Ljava/io/IOException;
- const-string v1, "Incomplete document"
- invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
- throw v0
- .end method
- .method public endArray()Lcom/google/gson/stream/JsonWriter;
- .locals 3
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- const/4 v0, 0x1
- const/4 v1, 0x2
- const-string v2, "]"
- invoke-direct {p0, v0, v1, v2}, Lcom/google/gson/stream/JsonWriter;->close(IILjava/lang/String;)Lcom/google/gson/stream/JsonWriter;
- move-result-object v0
- return-object v0
- .end method
- .method public endObject()Lcom/google/gson/stream/JsonWriter;
- .locals 3
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- const/4 v0, 0x3
- const/4 v1, 0x5
- const-string v2, "}"
- invoke-direct {p0, v0, v1, v2}, Lcom/google/gson/stream/JsonWriter;->close(IILjava/lang/String;)Lcom/google/gson/stream/JsonWriter;
- move-result-object v0
- return-object v0
- .end method
- .method public flush()V
- .locals 2
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- iget v0, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
- if-eqz v0, :cond_0
- iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
- invoke-virtual {v0}, Ljava/io/Writer;->flush()V
- return-void
- :cond_0
- new-instance v0, Ljava/lang/IllegalStateException;
- const-string v1, "JsonWriter is closed."
- invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
- throw v0
- .end method
- .method public final getSerializeNulls()Z
- .locals 1
- iget-boolean v0, p0, Lcom/google/gson/stream/JsonWriter;->serializeNulls:Z
- return v0
- .end method
- .method public final isHtmlSafe()Z
- .locals 1
- iget-boolean v0, p0, Lcom/google/gson/stream/JsonWriter;->htmlSafe:Z
- return v0
- .end method
- .method public isLenient()Z
- .locals 1
- iget-boolean v0, p0, Lcom/google/gson/stream/JsonWriter;->lenient:Z
- return v0
- .end method
- .method public jsonValue(Ljava/lang/String;)Lcom/google/gson/stream/JsonWriter;
- .locals 1
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- if-nez p1, :cond_0
- invoke-virtual {p0}, Lcom/google/gson/stream/JsonWriter;->nullValue()Lcom/google/gson/stream/JsonWriter;
- move-result-object p1
- return-object p1
- :cond_0
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->writeDeferredName()V
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->beforeValue()V
- iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
- invoke-virtual {v0, p1}, Ljava/io/Writer;->append(Ljava/lang/CharSequence;)Ljava/io/Writer;
- return-object p0
- .end method
- .method public name(Ljava/lang/String;)Lcom/google/gson/stream/JsonWriter;
- .locals 1
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- if-eqz p1, :cond_2
- iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->deferredName:Ljava/lang/String;
- if-nez v0, :cond_1
- iget v0, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
- if-eqz v0, :cond_0
- iput-object p1, p0, Lcom/google/gson/stream/JsonWriter;->deferredName:Ljava/lang/String;
- return-object p0
- :cond_0
- new-instance p1, Ljava/lang/IllegalStateException;
- const-string v0, "JsonWriter is closed."
- invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
- throw p1
- :cond_1
- new-instance p1, Ljava/lang/IllegalStateException;
- invoke-direct {p1}, Ljava/lang/IllegalStateException;-><init>()V
- throw p1
- :cond_2
- new-instance p1, Ljava/lang/NullPointerException;
- const-string v0, "name == null"
- invoke-direct {p1, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
- throw p1
- .end method
- .method public nullValue()Lcom/google/gson/stream/JsonWriter;
- .locals 2
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->deferredName:Ljava/lang/String;
- if-eqz v0, :cond_1
- iget-boolean v0, p0, Lcom/google/gson/stream/JsonWriter;->serializeNulls:Z
- if-eqz v0, :cond_0
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->writeDeferredName()V
- goto :goto_0
- :cond_0
- const/4 v0, 0x0
- iput-object v0, p0, Lcom/google/gson/stream/JsonWriter;->deferredName:Ljava/lang/String;
- return-object p0
- :cond_1
- :goto_0
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->beforeValue()V
- iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
- const-string v1, "null"
- invoke-virtual {v0, v1}, Ljava/io/Writer;->write(Ljava/lang/String;)V
- return-object p0
- .end method
- .method public final setHtmlSafe(Z)V
- .locals 0
- iput-boolean p1, p0, Lcom/google/gson/stream/JsonWriter;->htmlSafe:Z
- return-void
- .end method
- .method public final setIndent(Ljava/lang/String;)V
- .locals 1
- invoke-virtual {p1}, Ljava/lang/String;->length()I
- move-result v0
- if-nez v0, :cond_0
- const/4 p1, 0x0
- iput-object p1, p0, Lcom/google/gson/stream/JsonWriter;->indent:Ljava/lang/String;
- const-string p1, ":"
- goto :goto_0
- :cond_0
- iput-object p1, p0, Lcom/google/gson/stream/JsonWriter;->indent:Ljava/lang/String;
- const-string p1, ": "
- :goto_0
- iput-object p1, p0, Lcom/google/gson/stream/JsonWriter;->separator:Ljava/lang/String;
- return-void
- .end method
- .method public final setLenient(Z)V
- .locals 0
- iput-boolean p1, p0, Lcom/google/gson/stream/JsonWriter;->lenient:Z
- return-void
- .end method
- .method public final setSerializeNulls(Z)V
- .locals 0
- iput-boolean p1, p0, Lcom/google/gson/stream/JsonWriter;->serializeNulls:Z
- return-void
- .end method
- .method public value(D)Lcom/google/gson/stream/JsonWriter;
- .locals 3
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- invoke-static {p1, p2}, Ljava/lang/Double;->isNaN(D)Z
- move-result v0
- if-nez v0, :cond_0
- invoke-static {p1, p2}, Ljava/lang/Double;->isInfinite(D)Z
- move-result v0
- if-nez v0, :cond_0
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->writeDeferredName()V
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->beforeValue()V
- iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
- invoke-static {p1, p2}, Ljava/lang/Double;->toString(D)Ljava/lang/String;
- move-result-object p1
- invoke-virtual {v0, p1}, Ljava/io/Writer;->append(Ljava/lang/CharSequence;)Ljava/io/Writer;
- return-object p0
- :cond_0
- new-instance v0, Ljava/lang/IllegalArgumentException;
- new-instance v1, Ljava/lang/StringBuilder;
- invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
- const-string v2, "Numeric values must be finite, but was "
- invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v1, p1, p2}, Ljava/lang/StringBuilder;->append(D)Ljava/lang/StringBuilder;
- invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object p1
- invoke-direct {v0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
- throw v0
- .end method
- .method public value(J)Lcom/google/gson/stream/JsonWriter;
- .locals 1
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->writeDeferredName()V
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->beforeValue()V
- iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
- invoke-static {p1, p2}, Ljava/lang/Long;->toString(J)Ljava/lang/String;
- move-result-object p1
- invoke-virtual {v0, p1}, Ljava/io/Writer;->write(Ljava/lang/String;)V
- return-object p0
- .end method
- .method public value(Ljava/lang/Boolean;)Lcom/google/gson/stream/JsonWriter;
- .locals 1
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- if-nez p1, :cond_0
- invoke-virtual {p0}, Lcom/google/gson/stream/JsonWriter;->nullValue()Lcom/google/gson/stream/JsonWriter;
- move-result-object p1
- return-object p1
- :cond_0
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->writeDeferredName()V
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->beforeValue()V
- iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
- invoke-virtual {p1}, Ljava/lang/Boolean;->booleanValue()Z
- move-result p1
- if-eqz p1, :cond_1
- const-string p1, "true"
- goto :goto_0
- :cond_1
- const-string p1, "false"
- :goto_0
- invoke-virtual {v0, p1}, Ljava/io/Writer;->write(Ljava/lang/String;)V
- return-object p0
- .end method
- .method public value(Ljava/lang/Number;)Lcom/google/gson/stream/JsonWriter;
- .locals 3
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- if-nez p1, :cond_0
- invoke-virtual {p0}, Lcom/google/gson/stream/JsonWriter;->nullValue()Lcom/google/gson/stream/JsonWriter;
- move-result-object p1
- return-object p1
- :cond_0
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->writeDeferredName()V
- invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;
- move-result-object v0
- iget-boolean v1, p0, Lcom/google/gson/stream/JsonWriter;->lenient:Z
- if-nez v1, :cond_2
- const-string v1, "-Infinity"
- invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
- move-result v1
- if-nez v1, :cond_1
- const-string v1, "Infinity"
- invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
- move-result v1
- if-nez v1, :cond_1
- const-string v1, "NaN"
- invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
- move-result v1
- if-nez v1, :cond_1
- goto :goto_0
- :cond_1
- new-instance v0, Ljava/lang/IllegalArgumentException;
- new-instance v1, Ljava/lang/StringBuilder;
- invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
- const-string v2, "Numeric values must be finite, but was "
- invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
- invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object p1
- invoke-direct {v0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
- throw v0
- :cond_2
- :goto_0
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->beforeValue()V
- iget-object p1, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
- invoke-virtual {p1, v0}, Ljava/io/Writer;->append(Ljava/lang/CharSequence;)Ljava/io/Writer;
- return-object p0
- .end method
- .method public value(Ljava/lang/String;)Lcom/google/gson/stream/JsonWriter;
- .locals 0
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- if-nez p1, :cond_0
- invoke-virtual {p0}, Lcom/google/gson/stream/JsonWriter;->nullValue()Lcom/google/gson/stream/JsonWriter;
- move-result-object p1
- return-object p1
- :cond_0
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->writeDeferredName()V
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->beforeValue()V
- invoke-direct {p0, p1}, Lcom/google/gson/stream/JsonWriter;->string(Ljava/lang/String;)V
- return-object p0
- .end method
- .method public value(Z)Lcom/google/gson/stream/JsonWriter;
- .locals 1
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->writeDeferredName()V
- invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->beforeValue()V
- iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
- if-eqz p1, :cond_0
- const-string p1, "true"
- goto :goto_0
- :cond_0
- const-string p1, "false"
- :goto_0
- invoke-virtual {v0, p1}, Ljava/io/Writer;->write(Ljava/lang/String;)V
- return-object p0
- .end method
|