Rabbit-R1/android (non root)/smali/smali_classes2/com/alibaba/fastjson/serializer/EnumSerializer.smali
2024-05-21 17:08:36 -04:00

88 lines
2.3 KiB
Smali

.class Lcom/alibaba/fastjson/serializer/EnumSerializer;
.super Ljava/lang/Object;
.source "EnumSerializer.java"
# interfaces
.implements Lcom/alibaba/fastjson/serializer/ObjectSerializer;
# direct methods
.method constructor <init>()V
.locals 0
.line 24
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public write(Lcom/alibaba/fastjson/serializer/JSONSerializer;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/reflect/Type;)V
.locals 0
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 26
iget-object p0, p1, Lcom/alibaba/fastjson/serializer/JSONSerializer;->out:Lcom/alibaba/fastjson/serializer/SerializeWriter;
.line 28
iget p1, p0, Lcom/alibaba/fastjson/serializer/SerializeWriter;->features:I
sget-object p3, Lcom/alibaba/fastjson/serializer/SerializerFeature;->WriteEnumUsingToString:Lcom/alibaba/fastjson/serializer/SerializerFeature;
iget p3, p3, Lcom/alibaba/fastjson/serializer/SerializerFeature;->mask:I
and-int/2addr p1, p3
if-eqz p1, :cond_1
.line 29
check-cast p2, Ljava/lang/Enum;
.line 31
invoke-virtual {p2}, Ljava/lang/Enum;->toString()Ljava/lang/String;
move-result-object p1
.line 32
iget p2, p0, Lcom/alibaba/fastjson/serializer/SerializeWriter;->features:I
sget-object p3, Lcom/alibaba/fastjson/serializer/SerializerFeature;->UseSingleQuotes:Lcom/alibaba/fastjson/serializer/SerializerFeature;
iget p3, p3, Lcom/alibaba/fastjson/serializer/SerializerFeature;->mask:I
and-int/2addr p2, p3
if-eqz p2, :cond_0
.line 35
invoke-virtual {p0, p1}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->writeStringWithSingleQuote(Ljava/lang/String;)V
goto :goto_0
:cond_0
const/4 p2, 0x0
.line 37
invoke-virtual {p0, p1, p2, p2}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->writeStringWithDoubleQuote(Ljava/lang/String;CZ)V
goto :goto_0
.line 40
:cond_1
check-cast p2, Ljava/lang/Enum;
.line 41
invoke-virtual {p2}, Ljava/lang/Enum;->ordinal()I
move-result p1
invoke-virtual {p0, p1}, Lcom/alibaba/fastjson/serializer/SerializeWriter;->writeInt(I)V
:goto_0
return-void
.end method