|
|
@ -39,10 +39,11 @@ class AnalyzeRule(var book: BaseBook? = null) : JsExtensions { |
|
|
|
private var objectChangedJP = false |
|
|
|
private var objectChangedJP = false |
|
|
|
|
|
|
|
|
|
|
|
@Throws(Exception::class) |
|
|
|
@Throws(Exception::class) |
|
|
|
fun setContent(content: Any?): AnalyzeRule { |
|
|
|
fun setContent(content: Any?, baseUrl: String? = null): AnalyzeRule { |
|
|
|
if (content == null) throw AssertionError("Content cannot be null") |
|
|
|
if (content == null) throw AssertionError("Content cannot be null") |
|
|
|
isJSON = content.toString().isJson() |
|
|
|
|
|
|
|
this.content = content |
|
|
|
this.content = content |
|
|
|
|
|
|
|
setBaseUrl(baseUrl) |
|
|
|
|
|
|
|
isJSON = content.toString().isJson() |
|
|
|
objectChangedXP = true |
|
|
|
objectChangedXP = true |
|
|
|
objectChangedJS = true |
|
|
|
objectChangedJS = true |
|
|
|
objectChangedJP = true |
|
|
|
objectChangedJP = true |
|
|
@ -50,8 +51,8 @@ class AnalyzeRule(var book: BaseBook? = null) : JsExtensions { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun setBaseUrl(baseUrl: String?): AnalyzeRule { |
|
|
|
fun setBaseUrl(baseUrl: String?): AnalyzeRule { |
|
|
|
this.baseUrl = baseUrl |
|
|
|
|
|
|
|
baseUrl?.let { |
|
|
|
baseUrl?.let { |
|
|
|
|
|
|
|
this.baseUrl = baseUrl |
|
|
|
try { |
|
|
|
try { |
|
|
|
baseURL = URL(baseUrl.substringBefore(",")) |
|
|
|
baseURL = URL(baseUrl.substringBefore(",")) |
|
|
|
} catch (e: Exception) { |
|
|
|
} catch (e: Exception) { |
|
|
|