g.smali

.class public Ld/a/a/g;
.super Ld/a/a/d;
.source "JythonNumberModel.java"

# interfaces
.implements Lfreemarker/template/J;


# static fields
.field static final e:Lfreemarker/ext/util/e;

.field static synthetic f:Ljava/lang/Class;


# direct methods
.method static constructor <clinit>()V
    .registers 1

    .line 1
    new-instance v0, Ld/a/a/f;

    invoke-direct {v0}, Ld/a/a/f;-><init>()V

    sput-object v0, Ld/a/a/g;->e:Lfreemarker/ext/util/e;

    return-void
.end method

.method public constructor <init>(Lorg/python/core/PyObject;Ld/a/a/m;)V
    .registers 3

    .line 1
    invoke-direct {p0, p1, p2}, Ld/a/a/d;-><init>(Lorg/python/core/PyObject;Ld/a/a/m;)V

    return-void
.end method

.method static synthetic a(Ljava/lang/String;)Ljava/lang/Class;
    .registers 2

    .line 1
    :try_start_0
    invoke-static {p0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object p0
    :try_end_4
    .catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_4} :catch_5

    return-object p0

    :catch_5
    move-exception p0

    new-instance v0, Ljava/lang/NoClassDefFoundError;

    invoke-direct {v0}, Ljava/lang/NoClassDefFoundError;-><init>()V

    invoke-virtual {v0, p0}, Ljava/lang/NoClassDefFoundError;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable;

    move-result-object p0

    throw p0
.end method


# virtual methods
.method public getAsNumber()Ljava/lang/Number;
    .registers 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lfreemarker/template/TemplateModelException;
        }
    .end annotation

    .line 1
    :try_start_0
    iget-object v0, p0, Ld/a/a/d;->c:Lorg/python/core/PyObject;

    sget-object v1, Ld/a/a/g;->f:Ljava/lang/Class;

    if-nez v1, :cond_f

    const-string v1, "java.lang.Number"

    invoke-static {v1}, Ld/a/a/g;->a(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v1

    sput-object v1, Ld/a/a/g;->f:Ljava/lang/Class;

    goto :goto_11

    :cond_f
    sget-object v1, Ld/a/a/g;->f:Ljava/lang/Class;

    :goto_11
    invoke-virtual {v0, v1}, Lorg/python/core/PyObject;->__tojava__(Ljava/lang/Class;)Ljava/lang/Object;

    move-result-object v0

    if-eqz v0, :cond_1f

    .line 2
    sget-object v1, Lorg/python/core/Py;->NoConversion:Ljava/lang/Object;

    if-ne v0, v1, :cond_1c

    goto :goto_1f

    .line 3
    :cond_1c
    check-cast v0, Ljava/lang/Number;

    return-object v0

    .line 4
    :cond_1f
    :goto_1f
    new-instance v0, Ljava/lang/Double;

    iget-object v1, p0, Ld/a/a/d;->c:Lorg/python/core/PyObject;

    invoke-virtual {v1}, Lorg/python/core/PyObject;->__float__()Lorg/python/core/PyFloat;

    move-result-object v1

    invoke-virtual {v1}, Lorg/python/core/PyFloat;->getValue()D

    move-result-wide v1

    invoke-direct {v0, v1, v2}, Ljava/lang/Double;-><init>(D)V
    :try_end_2e
    .catch Lorg/python/core/PyException; {:try_start_0 .. :try_end_2e} :catch_2f

    return-object v0

    :catch_2f
    move-exception v0

    .line 5
    new-instance v1, Lfreemarker/template/TemplateModelException;

    invoke-direct {v1, v0}, Lfreemarker/template/TemplateModelException;-><init>(Ljava/lang/Exception;)V

    throw v1
.end method