Update AnalyzeByJSonPath.kt

新增设置平衡函数的参数
pull/1108/head
bushixuanqi 3 years ago committed by GitHub
parent c5c72511b4
commit d5aba03fcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSonPath.kt

@ -30,7 +30,7 @@ class AnalyzeByJSonPath(json: Any) {
fun getString(rule: String): String? { fun getString(rule: String): String? {
if (rule.isEmpty()) return null if (rule.isEmpty()) return null
var result: String var result: String
val ruleAnalyzes = RuleAnalyzer(rule) val ruleAnalyzes = RuleAnalyzer(rule,true) //设置平衡组为代码平衡
val rules = ruleAnalyzes.splitRule("&&","||") val rules = ruleAnalyzes.splitRule("&&","||")
if (rules.size == 1) { if (rules.size == 1) {
@ -83,7 +83,7 @@ class AnalyzeByJSonPath(json: Any) {
internal fun getStringList(rule: String): List<String> { internal fun getStringList(rule: String): List<String> {
val result = ArrayList<String>() val result = ArrayList<String>()
if (rule.isEmpty()) return result if (rule.isEmpty()) return result
val ruleAnalyzes = RuleAnalyzer(rule) val ruleAnalyzes = RuleAnalyzer(rule,true) //设置平衡组为代码平衡
val rules = ruleAnalyzes.splitRule("&&","||","%%") val rules = ruleAnalyzes.splitRule("&&","||","%%")
if (rules.size == 1) { if (rules.size == 1) {
@ -148,7 +148,7 @@ class AnalyzeByJSonPath(json: Any) {
internal fun getList(rule: String): ArrayList<Any>? { internal fun getList(rule: String): ArrayList<Any>? {
val result = ArrayList<Any>() val result = ArrayList<Any>()
if (rule.isEmpty()) return result if (rule.isEmpty()) return result
val ruleAnalyzes = RuleAnalyzer(rule) val ruleAnalyzes = RuleAnalyzer(rule,true) //设置平衡组为代码平衡
val rules = ruleAnalyzes.splitRule("&&","||","%%") val rules = ruleAnalyzes.splitRule("&&","||","%%")
if (rules.size == 1) { if (rules.size == 1) {
ctx.let { ctx.let {

Loading…
Cancel
Save