mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2025-01-09 13:43:22 +00:00
1289 lines
38 KiB
Smali
1289 lines
38 KiB
Smali
.class public Lcom/alibaba/fastjson/serializer/JSONSerializer;
|
|
.super Ljava/lang/Object;
|
|
.source "JSONSerializer.java"
|
|
|
|
|
|
# instance fields
|
|
.field protected afterFilters:Ljava/util/List;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"Lcom/alibaba/fastjson/serializer/AfterFilter;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field protected beforeFilters:Ljava/util/List;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"Lcom/alibaba/fastjson/serializer/BeforeFilter;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final config:Lcom/alibaba/fastjson/serializer/SerializeConfig;
|
|
|
|
.field protected context:Lcom/alibaba/fastjson/serializer/SerialContext;
|
|
|
|
.field private dateFormat:Ljava/text/DateFormat;
|
|
|
|
.field private dateFormatPattern:Ljava/lang/String;
|
|
|
|
.field private indentCount:I
|
|
|
|
.field public locale:Ljava/util/Locale;
|
|
|
|
.field protected nameFilters:Ljava/util/List;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"Lcom/alibaba/fastjson/serializer/NameFilter;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
.field protected propertyFilters:Ljava/util/List;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"Lcom/alibaba/fastjson/serializer/PropertyFilter;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field protected propertyPreFilters:Ljava/util/List;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"Lcom/alibaba/fastjson/serializer/PropertyPreFilter;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field protected references:Ljava/util/IdentityHashMap;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/IdentityHashMap<",
|
|
"Ljava/lang/Object;",
|
|
"Lcom/alibaba/fastjson/serializer/SerialContext;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public timeZone:Ljava/util/TimeZone;
|
|
|
|
.field protected valueFilters:Ljava/util/List;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"Lcom/alibaba/fastjson/serializer/ValueFilter;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 4
|
|
|
|
.line 61
|
|
new-instance v0, Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
move-object v2, v1
|
|
|
|
check-cast v2, Ljava/io/Writer;
|
|
|
|
sget v2, Lcom/alibaba/fastjson/JSON;->DEFAULT_GENERATE_FEATURE:I
|
|
|
|
sget-object v3, Lcom/alibaba/fastjson/serializer/SerializerFeature;->EMPTY:[Lcom/alibaba/fastjson/serializer/SerializerFeature;
|
|
|
|
invoke-direct {v0, v1, v2, v3}, Lcom/alibaba/fastjson/serializer/SerializeWriter;-><init>(Ljava/io/Writer;I[Lcom/alibaba/fastjson/serializer/SerializerFeature;)V
|
|
|
|
sget-object v1, Lcom/alibaba/fastjson/serializer/SerializeConfig;->globalInstance:Lcom/alibaba/fastjson/serializer/SerializeConfig;
|
|
|
|
invoke-direct {p0, v0, v1}, Lcom/alibaba/fastjson/serializer/JSONSerializer;-><init>(Lcom/alibaba/fastjson/serializer/SerializeWriter;Lcom/alibaba/fastjson/serializer/SerializeConfig;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Lcom/alibaba/fastjson/serializer/SerializeConfig;)V
|
|
.locals 4
|
|
|
|
.line 70
|
|
new-instance v0, Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
move-object v2, v1
|
|
|
|
check-cast v2, Ljava/io/Writer;
|
|
|
|
sget v2, Lcom/alibaba/fastjson/JSON;->DEFAULT_GENERATE_FEATURE:I
|
|
|
|
sget-object v3, Lcom/alibaba/fastjson/serializer/SerializerFeature;->EMPTY:[Lcom/alibaba/fastjson/serializer/SerializerFeature;
|
|
|
|
invoke-direct {v0, v1, v2, v3}, Lcom/alibaba/fastjson/serializer/SerializeWriter;-><init>(Ljava/io/Writer;I[Lcom/alibaba/fastjson/serializer/SerializerFeature;)V
|
|
|
|
invoke-direct {p0, v0, p1}, Lcom/alibaba/fastjson/serializer/JSONSerializer;-><init>(Lcom/alibaba/fastjson/serializer/SerializeWriter;Lcom/alibaba/fastjson/serializer/SerializeConfig;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Lcom/alibaba/fastjson/serializer/SerializeWriter;)V
|
|
.locals 1
|
|
|
|
.line 66
|
|
sget-object v0, Lcom/alibaba/fastjson/serializer/SerializeConfig;->globalInstance:Lcom/alibaba/fastjson/serializer/SerializeConfig;
|
|
|
|
invoke-direct {p0, p1, v0}, Lcom/alibaba/fastjson/serializer/JSONSerializer;-><init>(Lcom/alibaba/fastjson/serializer/SerializeWriter;Lcom/alibaba/fastjson/serializer/SerializeConfig;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Lcom/alibaba/fastjson/serializer/SerializeWriter;Lcom/alibaba/fastjson/serializer/SerializeConfig;)V
|
|
.locals 2
|
|
|
|
.line 73
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->beforeFilters:Ljava/util/List;
|
|
|
|
iput-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->afterFilters:Ljava/util/List;
|
|
|
|
iput-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->propertyFilters:Ljava/util/List;
|
|
|
|
iput-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->valueFilters:Ljava/util/List;
|
|
|
|
iput-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->nameFilters:Ljava/util/List;
|
|
|
|
iput-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->propertyPreFilters:Ljava/util/List;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
iput v1, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->indentCount:I
|
|
|
|
iput-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->references:Ljava/util/IdentityHashMap;
|
|
|
|
.line 57
|
|
sget-object v0, Lcom/alibaba/fastjson/JSON;->defaultTimeZone:Ljava/util/TimeZone;
|
|
|
|
iput-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->timeZone:Ljava/util/TimeZone;
|
|
|
|
.line 58
|
|
sget-object v0, Lcom/alibaba/fastjson/JSON;->defaultLocale:Ljava/util/Locale;
|
|
|
|
iput-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->locale:Ljava/util/Locale;
|
|
|
|
iput-object p1, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
iput-object p2, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->config:Lcom/alibaba/fastjson/serializer/SerializeConfig;
|
|
|
|
.line 76
|
|
sget-object p1, Lcom/alibaba/fastjson/JSON;->defaultTimeZone:Ljava/util/TimeZone;
|
|
|
|
iput-object p1, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->timeZone:Ljava/util/TimeZone;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static processValue(Lcom/alibaba/fastjson/serializer/JSONSerializer;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
.locals 2
|
|
|
|
.line 333
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->valueFilters:Ljava/util/List;
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
.line 335
|
|
instance-of v0, p2, Ljava/lang/String;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 336
|
|
invoke-static {p2}, Lcom/alibaba/fastjson/JSON;->toJSONString(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
.line 338
|
|
:cond_0
|
|
invoke-interface {p0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
:goto_0
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/alibaba/fastjson/serializer/ValueFilter;
|
|
|
|
.line 339
|
|
move-object v1, p2
|
|
|
|
check-cast v1, Ljava/lang/String;
|
|
|
|
invoke-interface {v0, p1, v1, p3}, Lcom/alibaba/fastjson/serializer/ValueFilter;->process(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p3
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
return-object p3
|
|
.end method
|
|
|
|
.method public static final write(Lcom/alibaba/fastjson/serializer/SerializeWriter;Ljava/lang/Object;)V
|
|
.locals 2
|
|
|
|
.line 248
|
|
new-instance v0, Lcom/alibaba/fastjson/serializer/JSONSerializer;
|
|
|
|
sget-object v1, Lcom/alibaba/fastjson/serializer/SerializeConfig;->globalInstance:Lcom/alibaba/fastjson/serializer/SerializeConfig;
|
|
|
|
invoke-direct {v0, p0, v1}, Lcom/alibaba/fastjson/serializer/JSONSerializer;-><init>(Lcom/alibaba/fastjson/serializer/SerializeWriter;Lcom/alibaba/fastjson/serializer/SerializeConfig;)V
|
|
|
|
.line 249
|
|
invoke-virtual {v0, p1}, Lcom/alibaba/fastjson/serializer/JSONSerializer;->write(Ljava/lang/Object;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final write(Ljava/io/Writer;Ljava/lang/Object;)V
|
|
.locals 4
|
|
|
|
.line 234
|
|
new-instance v0, Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
move-object v2, v1
|
|
|
|
check-cast v2, Ljava/io/Writer;
|
|
|
|
sget v2, Lcom/alibaba/fastjson/JSON;->DEFAULT_GENERATE_FEATURE:I
|
|
|
|
sget-object v3, Lcom/alibaba/fastjson/serializer/SerializerFeature;->EMPTY:[Lcom/alibaba/fastjson/serializer/SerializerFeature;
|
|
|
|
invoke-direct {v0, v1, v2, v3}, Lcom/alibaba/fastjson/serializer/SerializeWriter;-><init>(Ljava/io/Writer;I[Lcom/alibaba/fastjson/serializer/SerializerFeature;)V
|
|
|
|
.line 237
|
|
:try_start_0
|
|
new-instance v1, Lcom/alibaba/fastjson/serializer/JSONSerializer;
|
|
|
|
sget-object v2, Lcom/alibaba/fastjson/serializer/SerializeConfig;->globalInstance:Lcom/alibaba/fastjson/serializer/SerializeConfig;
|
|
|
|
invoke-direct {v1, v0, v2}, Lcom/alibaba/fastjson/serializer/JSONSerializer;-><init>(Lcom/alibaba/fastjson/serializer/SerializeWriter;Lcom/alibaba/fastjson/serializer/SerializeConfig;)V
|
|
|
|
.line 238
|
|
invoke-virtual {v1, p1}, Lcom/alibaba/fastjson/serializer/JSONSerializer;->write(Ljava/lang/Object;)V
|
|
|
|
.line 239
|
|
invoke-virtual {v0, p0}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->writeTo(Ljava/io/Writer;)V
|
|
:try_end_0
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 243
|
|
invoke-virtual {v0}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->close()V
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
.line 241
|
|
:try_start_1
|
|
new-instance p1, Lcom/alibaba/fastjson/JSONException;
|
|
|
|
invoke-virtual {p0}, Ljava/io/IOException;->getMessage()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {p1, v1, p0}, Lcom/alibaba/fastjson/JSONException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
throw p1
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
.line 243
|
|
:goto_0
|
|
invoke-virtual {v0}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->close()V
|
|
|
|
.line 244
|
|
throw p0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public apply(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
.locals 3
|
|
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->propertyFilters:Ljava/util/List;
|
|
|
|
const/4 v0, 0x1
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
if-eqz p2, :cond_1
|
|
|
|
.line 387
|
|
instance-of v1, p2, Ljava/lang/String;
|
|
|
|
if-nez v1, :cond_1
|
|
|
|
.line 388
|
|
invoke-static {p2}, Lcom/alibaba/fastjson/JSON;->toJSONString(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
.line 391
|
|
:cond_1
|
|
invoke-interface {p0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
:cond_2
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_3
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Lcom/alibaba/fastjson/serializer/PropertyFilter;
|
|
|
|
.line 392
|
|
move-object v2, p2
|
|
|
|
check-cast v2, Ljava/lang/String;
|
|
|
|
invoke-interface {v1, p1, v2, p3}, Lcom/alibaba/fastjson/serializer/PropertyFilter;->apply(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_2
|
|
|
|
const/4 p0, 0x0
|
|
|
|
return p0
|
|
|
|
:cond_3
|
|
return v0
|
|
.end method
|
|
|
|
.method public applyName(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
.locals 4
|
|
|
|
iget-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->propertyPreFilters:Ljava/util/List;
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
return v1
|
|
|
|
.line 367
|
|
:cond_0
|
|
invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_1
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_3
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lcom/alibaba/fastjson/serializer/PropertyPreFilter;
|
|
|
|
if-eqz p2, :cond_2
|
|
|
|
.line 368
|
|
instance-of v3, p2, Ljava/lang/String;
|
|
|
|
if-nez v3, :cond_2
|
|
|
|
.line 369
|
|
invoke-static {p2}, Lcom/alibaba/fastjson/JSON;->toJSONString(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
.line 372
|
|
:cond_2
|
|
move-object v3, p2
|
|
|
|
check-cast v3, Ljava/lang/String;
|
|
|
|
invoke-interface {v2, p0, p1, v3}, Lcom/alibaba/fastjson/serializer/PropertyPreFilter;->apply(Lcom/alibaba/fastjson/serializer/JSONSerializer;Ljava/lang/Object;Ljava/lang/String;)Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_1
|
|
|
|
const/4 p0, 0x0
|
|
|
|
return p0
|
|
|
|
:cond_3
|
|
return v1
|
|
.end method
|
|
|
|
.method public close()V
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
.line 329
|
|
invoke-virtual {p0}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->close()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public config(Lcom/alibaba/fastjson/serializer/SerializerFeature;Z)V
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
.line 230
|
|
invoke-virtual {p0, p1, p2}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->config(Lcom/alibaba/fastjson/serializer/SerializerFeature;Z)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public decrementIdent()V
|
|
.locals 1
|
|
|
|
iget v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->indentCount:I
|
|
|
|
add-int/lit8 v0, v0, -0x1
|
|
|
|
iput v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->indentCount:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public getAfterFilters()Ljava/util/List;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Ljava/util/List<",
|
|
"Lcom/alibaba/fastjson/serializer/AfterFilter;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->afterFilters:Ljava/util/List;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 195
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iput-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->afterFilters:Ljava/util/List;
|
|
|
|
:cond_0
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->afterFilters:Ljava/util/List;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public getBeforeFilters()Ljava/util/List;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Ljava/util/List<",
|
|
"Lcom/alibaba/fastjson/serializer/BeforeFilter;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->beforeFilters:Ljava/util/List;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 187
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iput-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->beforeFilters:Ljava/util/List;
|
|
|
|
:cond_0
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->beforeFilters:Ljava/util/List;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public getContext()Lcom/alibaba/fastjson/serializer/SerialContext;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->context:Lcom/alibaba/fastjson/serializer/SerialContext;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public getDateFormat()Ljava/text/DateFormat;
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->dateFormat:Ljava/text/DateFormat;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->dateFormatPattern:Ljava/lang/String;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 89
|
|
new-instance v0, Ljava/text/SimpleDateFormat;
|
|
|
|
iget-object v1, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->dateFormatPattern:Ljava/lang/String;
|
|
|
|
iget-object v2, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->locale:Ljava/util/Locale;
|
|
|
|
invoke-direct {v0, v1, v2}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;Ljava/util/Locale;)V
|
|
|
|
iput-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->dateFormat:Ljava/text/DateFormat;
|
|
|
|
iget-object v1, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->timeZone:Ljava/util/TimeZone;
|
|
|
|
.line 90
|
|
invoke-virtual {v0, v1}, Ljava/text/DateFormat;->setTimeZone(Ljava/util/TimeZone;)V
|
|
|
|
:cond_0
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->dateFormat:Ljava/text/DateFormat;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public getDateFormatPattern()Ljava/lang/String;
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->dateFormat:Ljava/text/DateFormat;
|
|
|
|
.line 80
|
|
instance-of v1, v0, Ljava/text/SimpleDateFormat;
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
.line 81
|
|
check-cast v0, Ljava/text/SimpleDateFormat;
|
|
|
|
invoke-virtual {v0}, Ljava/text/SimpleDateFormat;->toPattern()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->dateFormatPattern:Ljava/lang/String;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public getNameFilters()Ljava/util/List;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Ljava/util/List<",
|
|
"Lcom/alibaba/fastjson/serializer/NameFilter;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->nameFilters:Ljava/util/List;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 203
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iput-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->nameFilters:Ljava/util/List;
|
|
|
|
:cond_0
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->nameFilters:Ljava/util/List;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public getPropertyFilters()Ljava/util/List;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Ljava/util/List<",
|
|
"Lcom/alibaba/fastjson/serializer/PropertyFilter;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->propertyFilters:Ljava/util/List;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 219
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iput-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->propertyFilters:Ljava/util/List;
|
|
|
|
:cond_0
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->propertyFilters:Ljava/util/List;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public getPropertyPreFilters()Ljava/util/List;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Ljava/util/List<",
|
|
"Lcom/alibaba/fastjson/serializer/PropertyPreFilter;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->propertyPreFilters:Ljava/util/List;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 211
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iput-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->propertyPreFilters:Ljava/util/List;
|
|
|
|
:cond_0
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->propertyPreFilters:Ljava/util/List;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public getValueFilters()Ljava/util/List;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Ljava/util/List<",
|
|
"Lcom/alibaba/fastjson/serializer/ValueFilter;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->valueFilters:Ljava/util/List;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 164
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iput-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->valueFilters:Ljava/util/List;
|
|
|
|
:cond_0
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->valueFilters:Ljava/util/List;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public getWriter()Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public incrementIndent()V
|
|
.locals 1
|
|
|
|
iget v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->indentCount:I
|
|
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
iput v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->indentCount:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public println()V
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
const/16 v1, 0xa
|
|
|
|
.line 179
|
|
invoke-virtual {v0, v1}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->write(I)V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
iget v1, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->indentCount:I
|
|
|
|
if-ge v0, v1, :cond_0
|
|
|
|
iget-object v1, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
const/16 v2, 0x9
|
|
|
|
.line 181
|
|
invoke-virtual {v1, v2}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->write(I)V
|
|
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public processKey(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
.locals 1
|
|
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->nameFilters:Ljava/util/List;
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
.line 349
|
|
instance-of v0, p2, Ljava/lang/String;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 350
|
|
invoke-static {p2}, Lcom/alibaba/fastjson/JSON;->toJSONString(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
.line 352
|
|
:cond_0
|
|
invoke-interface {p0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
:goto_0
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/alibaba/fastjson/serializer/NameFilter;
|
|
|
|
.line 353
|
|
check-cast p2, Ljava/lang/String;
|
|
|
|
invoke-interface {v0, p1, p2, p3}, Lcom/alibaba/fastjson/serializer/NameFilter;->process(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
return-object p2
|
|
.end method
|
|
|
|
.method public setContext(Lcom/alibaba/fastjson/serializer/SerialContext;Ljava/lang/Object;Ljava/lang/Object;I)V
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
.line 112
|
|
iget v0, v0, Lcom/alibaba/fastjson/serializer/SerializeWriter;->features:I
|
|
|
|
sget-object v1, Lcom/alibaba/fastjson/serializer/SerializerFeature;->DisableCircularReferenceDetect:Lcom/alibaba/fastjson/serializer/SerializerFeature;
|
|
|
|
iget v1, v1, Lcom/alibaba/fastjson/serializer/SerializerFeature;->mask:I
|
|
|
|
and-int/2addr v0, v1
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
.line 113
|
|
new-instance v0, Lcom/alibaba/fastjson/serializer/SerialContext;
|
|
|
|
invoke-direct {v0, p1, p2, p3, p4}, Lcom/alibaba/fastjson/serializer/SerialContext;-><init>(Lcom/alibaba/fastjson/serializer/SerialContext;Ljava/lang/Object;Ljava/lang/Object;I)V
|
|
|
|
iput-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->context:Lcom/alibaba/fastjson/serializer/SerialContext;
|
|
|
|
iget-object p1, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->references:Ljava/util/IdentityHashMap;
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
.line 115
|
|
new-instance p1, Ljava/util/IdentityHashMap;
|
|
|
|
invoke-direct {p1}, Ljava/util/IdentityHashMap;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->references:Ljava/util/IdentityHashMap;
|
|
|
|
:cond_0
|
|
iget-object p1, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->references:Ljava/util/IdentityHashMap;
|
|
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->context:Lcom/alibaba/fastjson/serializer/SerialContext;
|
|
|
|
.line 117
|
|
invoke-virtual {p1, p2, p0}, Ljava/util/IdentityHashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
.method public setDateFormat(Ljava/lang/String;)V
|
|
.locals 0
|
|
|
|
iput-object p1, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->dateFormatPattern:Ljava/lang/String;
|
|
|
|
iget-object p1, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->dateFormat:Ljava/text/DateFormat;
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
iput-object p1, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->dateFormat:Ljava/text/DateFormat;
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public setDateFormat(Ljava/text/DateFormat;)V
|
|
.locals 0
|
|
|
|
iput-object p1, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->dateFormat:Ljava/text/DateFormat;
|
|
|
|
iget-object p1, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->dateFormatPattern:Ljava/lang/String;
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
iput-object p1, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->dateFormatPattern:Ljava/lang/String;
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public toString()Ljava/lang/String;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
.line 226
|
|
invoke-virtual {p0}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public final write(Ljava/lang/Object;)V
|
|
.locals 2
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
.line 254
|
|
invoke-virtual {p0}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->writeNull()V
|
|
|
|
return-void
|
|
|
|
.line 258
|
|
:cond_0
|
|
invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v1, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->config:Lcom/alibaba/fastjson/serializer/SerializeConfig;
|
|
|
|
.line 259
|
|
invoke-virtual {v1, v0}, Lcom/alibaba/fastjson/serializer/SerializeConfig;->get(Ljava/lang/Class;)Lcom/alibaba/fastjson/serializer/ObjectSerializer;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
.line 262
|
|
:try_start_0
|
|
invoke-interface {v0, p0, p1, v1, v1}, Lcom/alibaba/fastjson/serializer/ObjectSerializer;->write(Lcom/alibaba/fastjson/serializer/JSONSerializer;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/reflect/Type;)V
|
|
:try_end_0
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-void
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
.line 264
|
|
new-instance p1, Lcom/alibaba/fastjson/JSONException;
|
|
|
|
invoke-virtual {p0}, Ljava/io/IOException;->getMessage()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p1, v0, p0}, Lcom/alibaba/fastjson/JSONException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final write(Ljava/lang/String;)V
|
|
.locals 2
|
|
|
|
if-nez p1, :cond_1
|
|
|
|
iget-object p1, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
.line 313
|
|
iget p1, p1, Lcom/alibaba/fastjson/serializer/SerializeWriter;->features:I
|
|
|
|
sget-object v0, Lcom/alibaba/fastjson/serializer/SerializerFeature;->WriteNullStringAsEmpty:Lcom/alibaba/fastjson/serializer/SerializerFeature;
|
|
|
|
iget v0, v0, Lcom/alibaba/fastjson/serializer/SerializerFeature;->mask:I
|
|
|
|
and-int/2addr p1, v0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
const-string p1, ""
|
|
|
|
.line 314
|
|
invoke-virtual {p0, p1}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->writeString(Ljava/lang/String;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
.line 316
|
|
invoke-virtual {p0}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->writeNull()V
|
|
|
|
:goto_0
|
|
return-void
|
|
|
|
:cond_1
|
|
iget-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
.line 321
|
|
iget v0, v0, Lcom/alibaba/fastjson/serializer/SerializeWriter;->features:I
|
|
|
|
sget-object v1, Lcom/alibaba/fastjson/serializer/SerializerFeature;->UseSingleQuotes:Lcom/alibaba/fastjson/serializer/SerializerFeature;
|
|
|
|
iget v1, v1, Lcom/alibaba/fastjson/serializer/SerializerFeature;->mask:I
|
|
|
|
and-int/2addr v0, v1
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
.line 322
|
|
invoke-virtual {p0, p1}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->writeStringWithSingleQuote(Ljava/lang/String;)V
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
.line 324
|
|
invoke-virtual {p0, p1, v0, v1}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->writeStringWithDoubleQuote(Ljava/lang/String;CZ)V
|
|
|
|
:goto_1
|
|
return-void
|
|
.end method
|
|
|
|
.method protected final writeKeyValue(CLjava/lang/String;Ljava/lang/Object;)V
|
|
.locals 1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
.line 274
|
|
invoke-virtual {v0, p1}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->write(I)V
|
|
|
|
:cond_0
|
|
iget-object p1, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
const/4 v0, 0x1
|
|
|
|
.line 276
|
|
invoke-virtual {p1, p2, v0}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->writeFieldName(Ljava/lang/String;Z)V
|
|
|
|
.line 277
|
|
invoke-virtual {p0, p3}, Lcom/alibaba/fastjson/serializer/JSONSerializer;->write(Ljava/lang/Object;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public writeReference(Ljava/lang/Object;)V
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->context:Lcom/alibaba/fastjson/serializer/SerialContext;
|
|
|
|
.line 123
|
|
iget-object v1, v0, Lcom/alibaba/fastjson/serializer/SerialContext;->object:Ljava/lang/Object;
|
|
|
|
if-ne p1, v1, :cond_0
|
|
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
const-string p1, "{\"$ref\":\"@\"}"
|
|
|
|
.line 126
|
|
invoke-virtual {p0, p1}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->write(Ljava/lang/String;)V
|
|
|
|
return-void
|
|
|
|
.line 130
|
|
:cond_0
|
|
iget-object v1, v0, Lcom/alibaba/fastjson/serializer/SerialContext;->parent:Lcom/alibaba/fastjson/serializer/SerialContext;
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
.line 133
|
|
iget-object v1, v1, Lcom/alibaba/fastjson/serializer/SerialContext;->object:Ljava/lang/Object;
|
|
|
|
if-ne p1, v1, :cond_1
|
|
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
const-string p1, "{\"$ref\":\"..\"}"
|
|
|
|
.line 134
|
|
invoke-virtual {p0, p1}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->write(Ljava/lang/String;)V
|
|
|
|
return-void
|
|
|
|
.line 141
|
|
:cond_1
|
|
:goto_0
|
|
iget-object v1, v0, Lcom/alibaba/fastjson/serializer/SerialContext;->parent:Lcom/alibaba/fastjson/serializer/SerialContext;
|
|
|
|
if-nez v1, :cond_3
|
|
|
|
.line 147
|
|
iget-object v0, v0, Lcom/alibaba/fastjson/serializer/SerialContext;->object:Ljava/lang/Object;
|
|
|
|
if-ne p1, v0, :cond_2
|
|
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
const-string p1, "{\"$ref\":\"$\"}"
|
|
|
|
.line 148
|
|
invoke-virtual {p0, p1}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->write(Ljava/lang/String;)V
|
|
|
|
return-void
|
|
|
|
:cond_2
|
|
iget-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->references:Ljava/util/IdentityHashMap;
|
|
|
|
.line 152
|
|
invoke-virtual {v0, p1}, Ljava/util/IdentityHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Lcom/alibaba/fastjson/serializer/SerialContext;
|
|
|
|
.line 154
|
|
invoke-virtual {p1}, Lcom/alibaba/fastjson/serializer/SerialContext;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
iget-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
const-string v1, "{\"$ref\":\""
|
|
|
|
.line 156
|
|
invoke-virtual {v0, v1}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->write(Ljava/lang/String;)V
|
|
|
|
iget-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
.line 157
|
|
invoke-virtual {v0, p1}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->write(Ljava/lang/String;)V
|
|
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
const-string p1, "\"}"
|
|
|
|
.line 158
|
|
invoke-virtual {p0, p1}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->write(Ljava/lang/String;)V
|
|
|
|
return-void
|
|
|
|
.line 144
|
|
:cond_3
|
|
iget-object v0, v0, Lcom/alibaba/fastjson/serializer/SerialContext;->parent:Lcom/alibaba/fastjson/serializer/SerialContext;
|
|
|
|
goto :goto_0
|
|
.end method
|
|
|
|
.method public final writeWithFieldName(Ljava/lang/Object;Ljava/lang/Object;)V
|
|
.locals 2
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
.line 269
|
|
invoke-virtual {p0, p1, p2, v0, v1}, Lcom/alibaba/fastjson/serializer/JSONSerializer;->writeWithFieldName(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/reflect/Type;I)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final writeWithFieldName(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/reflect/Type;I)V
|
|
.locals 1
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
:try_start_0
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
.line 283
|
|
invoke-virtual {p0}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->writeNull()V
|
|
|
|
return-void
|
|
|
|
.line 287
|
|
:cond_0
|
|
invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object p4
|
|
|
|
iget-object v0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->config:Lcom/alibaba/fastjson/serializer/SerializeConfig;
|
|
|
|
.line 289
|
|
invoke-virtual {v0, p4}, Lcom/alibaba/fastjson/serializer/SerializeConfig;->get(Ljava/lang/Class;)Lcom/alibaba/fastjson/serializer/ObjectSerializer;
|
|
|
|
move-result-object p4
|
|
|
|
.line 291
|
|
invoke-interface {p4, p0, p1, p2, p3}, Lcom/alibaba/fastjson/serializer/ObjectSerializer;->write(Lcom/alibaba/fastjson/serializer/JSONSerializer;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/reflect/Type;)V
|
|
:try_end_0
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-void
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
.line 293
|
|
new-instance p1, Lcom/alibaba/fastjson/JSONException;
|
|
|
|
invoke-virtual {p0}, Ljava/io/IOException;->getMessage()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {p1, p2, p0}, Lcom/alibaba/fastjson/JSONException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final writeWithFormat(Ljava/lang/Object;Ljava/lang/String;)V
|
|
.locals 2
|
|
|
|
.line 298
|
|
instance-of v0, p1, Ljava/util/Date;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 299
|
|
invoke-virtual {p0}, Lcom/alibaba/fastjson/serializer/JSONSerializer;->getDateFormat()Ljava/text/DateFormat;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 301
|
|
new-instance v0, Ljava/text/SimpleDateFormat;
|
|
|
|
iget-object v1, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->locale:Ljava/util/Locale;
|
|
|
|
invoke-direct {v0, p2, v1}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;Ljava/util/Locale;)V
|
|
|
|
iget-object p2, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->timeZone:Ljava/util/TimeZone;
|
|
|
|
.line 302
|
|
invoke-virtual {v0, p2}, Ljava/text/DateFormat;->setTimeZone(Ljava/util/TimeZone;)V
|
|
|
|
.line 304
|
|
:cond_0
|
|
check-cast p1, Ljava/util/Date;
|
|
|
|
invoke-virtual {v0, p1}, Ljava/text/DateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
iget-object p0, p0, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
|
|
|
|
.line 305
|
|
invoke-virtual {p0, p1}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->writeString(Ljava/lang/String;)V
|
|
|
|
return-void
|
|
|
|
.line 308
|
|
:cond_1
|
|
invoke-virtual {p0, p1}, Lcom/alibaba/fastjson/serializer/JSONSerializer;->write(Ljava/lang/Object;)V
|
|
|
|
return-void
|
|
.end method
|