168 lines
5.4 KiB
Smali
168 lines
5.4 KiB
Smali
.class public Lcom/esotericsoftware/kryo/serializers/EnumNameSerializer;
|
|
.super Lcom/esotericsoftware/kryo/Serializer;
|
|
.source "EnumNameSerializer.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lcom/esotericsoftware/kryo/Serializer<",
|
|
"Ljava/lang/Enum;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public final enumType:Ljava/lang/Class;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/lang/Class<",
|
|
"+",
|
|
"Ljava/lang/Enum;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final stringSerializer:Lcom/esotericsoftware/kryo/Serializer;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lcom/esotericsoftware/kryo/Kryo;Ljava/lang/Class;)V
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lcom/esotericsoftware/kryo/Kryo;",
|
|
"Ljava/lang/Class<",
|
|
"+",
|
|
"Ljava/lang/Enum;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-direct {p0}, Lcom/esotericsoftware/kryo/Serializer;-><init>()V
|
|
|
|
iput-object p2, p0, Lcom/esotericsoftware/kryo/serializers/EnumNameSerializer;->enumType:Ljava/lang/Class;
|
|
|
|
const-class p2, Ljava/lang/String;
|
|
|
|
invoke-virtual {p1, p2}, Lcom/esotericsoftware/kryo/Kryo;->getSerializer(Ljava/lang/Class;)Lcom/esotericsoftware/kryo/Serializer;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/esotericsoftware/kryo/serializers/EnumNameSerializer;->stringSerializer:Lcom/esotericsoftware/kryo/Serializer;
|
|
|
|
const/4 p1, 0x1
|
|
|
|
invoke-virtual {p0, p1}, Lcom/esotericsoftware/kryo/Serializer;->setImmutable(Z)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public read(Lcom/esotericsoftware/kryo/Kryo;Lcom/esotericsoftware/kryo/io/Input;Ljava/lang/Class;)Ljava/lang/Enum;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lcom/esotericsoftware/kryo/Kryo;",
|
|
"Lcom/esotericsoftware/kryo/io/Input;",
|
|
"Ljava/lang/Class<",
|
|
"Ljava/lang/Enum;",
|
|
">;)",
|
|
"Ljava/lang/Enum;"
|
|
}
|
|
.end annotation
|
|
|
|
const-class p3, Ljava/lang/String;
|
|
|
|
iget-object v0, p0, Lcom/esotericsoftware/kryo/serializers/EnumNameSerializer;->stringSerializer:Lcom/esotericsoftware/kryo/Serializer;
|
|
|
|
invoke-virtual {p1, p2, p3, v0}, Lcom/esotericsoftware/kryo/Kryo;->readObject(Lcom/esotericsoftware/kryo/io/Input;Ljava/lang/Class;Lcom/esotericsoftware/kryo/Serializer;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Ljava/lang/String;
|
|
|
|
:try_start_0
|
|
iget-object p2, p0, Lcom/esotericsoftware/kryo/serializers/EnumNameSerializer;->enumType:Ljava/lang/Class;
|
|
|
|
invoke-static {p2, p1}, Ljava/lang/Enum;->valueOf(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;
|
|
|
|
move-result-object p1
|
|
:try_end_0
|
|
.catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-object p1
|
|
|
|
:catch_0
|
|
move-exception p2
|
|
|
|
new-instance p3, Lcom/esotericsoftware/kryo/KryoException;
|
|
|
|
const-string v0, "Invalid name for enum \""
|
|
|
|
invoke-static {v0}, Lf/e/c/a/a;->E(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v1, p0, Lcom/esotericsoftware/kryo/serializers/EnumNameSerializer;->enumType:Ljava/lang/Class;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Class;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, "\": "
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p3, p1, p2}, Lcom/esotericsoftware/kryo/KryoException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
throw p3
|
|
.end method
|
|
|
|
.method public bridge synthetic read(Lcom/esotericsoftware/kryo/Kryo;Lcom/esotericsoftware/kryo/io/Input;Ljava/lang/Class;)Ljava/lang/Object;
|
|
.locals 0
|
|
|
|
invoke-virtual {p0, p1, p2, p3}, Lcom/esotericsoftware/kryo/serializers/EnumNameSerializer;->read(Lcom/esotericsoftware/kryo/Kryo;Lcom/esotericsoftware/kryo/io/Input;Ljava/lang/Class;)Ljava/lang/Enum;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public write(Lcom/esotericsoftware/kryo/Kryo;Lcom/esotericsoftware/kryo/io/Output;Ljava/lang/Enum;)V
|
|
.locals 1
|
|
|
|
invoke-virtual {p3}, Ljava/lang/Enum;->name()Ljava/lang/String;
|
|
|
|
move-result-object p3
|
|
|
|
iget-object v0, p0, Lcom/esotericsoftware/kryo/serializers/EnumNameSerializer;->stringSerializer:Lcom/esotericsoftware/kryo/Serializer;
|
|
|
|
invoke-virtual {p1, p2, p3, v0}, Lcom/esotericsoftware/kryo/Kryo;->writeObject(Lcom/esotericsoftware/kryo/io/Output;Ljava/lang/Object;Lcom/esotericsoftware/kryo/Serializer;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public bridge synthetic write(Lcom/esotericsoftware/kryo/Kryo;Lcom/esotericsoftware/kryo/io/Output;Ljava/lang/Object;)V
|
|
.locals 0
|
|
|
|
check-cast p3, Ljava/lang/Enum;
|
|
|
|
invoke-virtual {p0, p1, p2, p3}, Lcom/esotericsoftware/kryo/serializers/EnumNameSerializer;->write(Lcom/esotericsoftware/kryo/Kryo;Lcom/esotericsoftware/kryo/io/Output;Ljava/lang/Enum;)V
|
|
|
|
return-void
|
|
.end method
|