2019-07-24 11:27:29 +00:00
|
|
|
.class public final Landroidx/sqlite/db/SupportSQLiteQueryBuilder;
|
|
|
|
.super Ljava/lang/Object;
|
|
|
|
.source "SupportSQLiteQueryBuilder.java"
|
|
|
|
|
|
|
|
|
|
|
|
# static fields
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public static final sLimitPattern:Ljava/util/regex/Pattern;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
# instance fields
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public mBindArgs:[Ljava/lang/Object;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public mColumns:[Ljava/lang/String;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public mDistinct:Z
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public mGroupBy:Ljava/lang/String;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public mHaving:Ljava/lang/String;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public mLimit:Ljava/lang/String;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public mOrderBy:Ljava/lang/String;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public mSelection:Ljava/lang/String;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public final mTable:Ljava/lang/String;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public static constructor <clinit>()V
|
2019-07-24 11:27:29 +00:00
|
|
|
.locals 1
|
|
|
|
|
|
|
|
const-string v0, "\\s*\\d+\\s*(,\\s*\\d+\\s*)?"
|
|
|
|
|
|
|
|
invoke-static {v0}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
sput-object v0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->sLimitPattern:Ljava/util/regex/Pattern;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public constructor <init>(Ljava/lang/String;)V
|
2019-07-24 11:27:29 +00:00
|
|
|
.locals 1
|
|
|
|
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
iput-boolean v0, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mDistinct:Z
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
iput-object v0, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mColumns:[Ljava/lang/String;
|
|
|
|
|
|
|
|
iput-object v0, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mGroupBy:Ljava/lang/String;
|
|
|
|
|
|
|
|
iput-object v0, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mHaving:Ljava/lang/String;
|
|
|
|
|
|
|
|
iput-object v0, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mOrderBy:Ljava/lang/String;
|
|
|
|
|
|
|
|
iput-object v0, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mLimit:Ljava/lang/String;
|
|
|
|
|
|
|
|
iput-object p1, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mTable:Ljava/lang/String;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public static appendClause(Ljava/lang/StringBuilder;Ljava/lang/String;Ljava/lang/String;)V
|
2019-07-24 11:27:29 +00:00
|
|
|
.locals 1
|
|
|
|
|
|
|
|
invoke-static {p2}, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->isEmpty(Ljava/lang/String;)Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {p0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {p0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public static appendColumns(Ljava/lang/StringBuilder;[Ljava/lang/String;)V
|
2019-07-24 11:27:29 +00:00
|
|
|
.locals 4
|
|
|
|
|
|
|
|
array-length v0, p1
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
if-ge v1, v0, :cond_1
|
|
|
|
|
|
|
|
aget-object v2, p1, v1
|
|
|
|
|
|
|
|
if-lez v1, :cond_0
|
|
|
|
|
|
|
|
const-string v3, ", "
|
|
|
|
|
|
|
|
invoke-virtual {p0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-virtual {p0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
const/16 p1, 0x20
|
|
|
|
|
|
|
|
invoke-virtual {p0, p1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static builder(Ljava/lang/String;)Landroidx/sqlite/db/SupportSQLiteQueryBuilder;
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
new-instance v0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;
|
|
|
|
|
|
|
|
invoke-direct {v0, p0}, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public static isEmpty(Ljava/lang/String;)Z
|
2019-07-24 11:27:29 +00:00
|
|
|
.locals 0
|
|
|
|
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
|
|
|
|
|
|
|
move-result p0
|
|
|
|
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/4 p0, 0x0
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
goto :goto_1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
:cond_1
|
|
|
|
:goto_0
|
|
|
|
const/4 p0, 0x1
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
:goto_1
|
2019-07-24 11:27:29 +00:00
|
|
|
return p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public columns([Ljava/lang/String;)Landroidx/sqlite/db/SupportSQLiteQueryBuilder;
|
2019-07-24 11:27:29 +00:00
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iput-object p1, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mColumns:[Ljava/lang/String;
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public create()Landroidx/sqlite/db/SupportSQLiteQuery;
|
2019-07-24 11:27:29 +00:00
|
|
|
.locals 3
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mGroupBy:Ljava/lang/String;
|
|
|
|
|
|
|
|
invoke-static {v0}, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->isEmpty(Ljava/lang/String;)Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mHaving:Ljava/lang/String;
|
|
|
|
|
|
|
|
invoke-static {v0}, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->isEmpty(Ljava/lang/String;)Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
new-instance v0, Ljava/lang/IllegalArgumentException;
|
|
|
|
|
|
|
|
const-string v1, "HAVING clauses are only permitted when using a groupBy clause"
|
|
|
|
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw v0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
:goto_0
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const/16 v1, 0x78
|
|
|
|
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(I)V
|
|
|
|
|
|
|
|
const-string v1, "SELECT "
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
iget-boolean v1, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mDistinct:Z
|
|
|
|
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
|
|
|
|
const-string v1, "DISTINCT "
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
iget-object v1, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mColumns:[Ljava/lang/String;
|
|
|
|
|
|
|
|
if-eqz v1, :cond_3
|
|
|
|
|
|
|
|
array-length v2, v1
|
|
|
|
|
|
|
|
if-eqz v2, :cond_3
|
|
|
|
|
|
|
|
invoke-static {v0, v1}, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->appendColumns(Ljava/lang/StringBuilder;[Ljava/lang/String;)V
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
const-string v1, " * "
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
:goto_1
|
|
|
|
const-string v1, " FROM "
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
iget-object v1, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mTable:Ljava/lang/String;
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
iget-object v1, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mSelection:Ljava/lang/String;
|
|
|
|
|
|
|
|
const-string v2, " WHERE "
|
|
|
|
|
|
|
|
invoke-static {v0, v2, v1}, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->appendClause(Ljava/lang/StringBuilder;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
iget-object v1, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mGroupBy:Ljava/lang/String;
|
|
|
|
|
|
|
|
const-string v2, " GROUP BY "
|
|
|
|
|
|
|
|
invoke-static {v0, v2, v1}, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->appendClause(Ljava/lang/StringBuilder;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
iget-object v1, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mHaving:Ljava/lang/String;
|
|
|
|
|
|
|
|
const-string v2, " HAVING "
|
|
|
|
|
|
|
|
invoke-static {v0, v2, v1}, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->appendClause(Ljava/lang/StringBuilder;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
iget-object v1, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mOrderBy:Ljava/lang/String;
|
|
|
|
|
|
|
|
const-string v2, " ORDER BY "
|
|
|
|
|
|
|
|
invoke-static {v0, v2, v1}, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->appendClause(Ljava/lang/StringBuilder;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
iget-object v1, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mLimit:Ljava/lang/String;
|
|
|
|
|
|
|
|
const-string v2, " LIMIT "
|
|
|
|
|
|
|
|
invoke-static {v0, v2, v1}, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->appendClause(Ljava/lang/StringBuilder;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
new-instance v1, Landroidx/sqlite/db/SimpleSQLiteQuery;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
iget-object v2, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mBindArgs:[Ljava/lang/Object;
|
|
|
|
|
|
|
|
invoke-direct {v1, v0, v2}, Landroidx/sqlite/db/SimpleSQLiteQuery;-><init>(Ljava/lang/String;[Ljava/lang/Object;)V
|
|
|
|
|
|
|
|
return-object v1
|
|
|
|
.end method
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public distinct()Landroidx/sqlite/db/SupportSQLiteQueryBuilder;
|
2019-07-24 11:27:29 +00:00
|
|
|
.locals 1
|
|
|
|
|
|
|
|
const/4 v0, 0x1
|
|
|
|
|
|
|
|
iput-boolean v0, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mDistinct:Z
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public groupBy(Ljava/lang/String;)Landroidx/sqlite/db/SupportSQLiteQueryBuilder;
|
2019-07-24 11:27:29 +00:00
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iput-object p1, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mGroupBy:Ljava/lang/String;
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public having(Ljava/lang/String;)Landroidx/sqlite/db/SupportSQLiteQueryBuilder;
|
2019-07-24 11:27:29 +00:00
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iput-object p1, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mHaving:Ljava/lang/String;
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public limit(Ljava/lang/String;)Landroidx/sqlite/db/SupportSQLiteQueryBuilder;
|
2019-07-24 11:27:29 +00:00
|
|
|
.locals 2
|
|
|
|
|
|
|
|
invoke-static {p1}, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->isEmpty(Ljava/lang/String;)Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
|
|
|
|
sget-object v0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->sLimitPattern:Ljava/util/regex/Pattern;
|
|
|
|
|
|
|
|
invoke-virtual {v0, p1}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/util/regex/Matcher;->matches()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
new-instance v0, Ljava/lang/IllegalArgumentException;
|
|
|
|
|
|
|
|
const-string v1, "invalid LIMIT clauses:"
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-static {v1, p1}, Le/e/b/a/a;->a(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-direct {v0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw v0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
:goto_0
|
|
|
|
iput-object p1, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mLimit:Ljava/lang/String;
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public orderBy(Ljava/lang/String;)Landroidx/sqlite/db/SupportSQLiteQueryBuilder;
|
2019-07-24 11:27:29 +00:00
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iput-object p1, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mOrderBy:Ljava/lang/String;
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public selection(Ljava/lang/String;[Ljava/lang/Object;)Landroidx/sqlite/db/SupportSQLiteQueryBuilder;
|
2019-07-24 11:27:29 +00:00
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iput-object p1, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mSelection:Ljava/lang/String;
|
|
|
|
|
|
|
|
iput-object p2, p0, Landroidx/sqlite/db/SupportSQLiteQueryBuilder;->mBindArgs:[Ljava/lang/Object;
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|