Skip to content

Commit e825e87

Browse files
committed
Remove unused AANull Gson adapters and imports
Commented-out code and unused imports related to AANull Gson adapters have been removed from AAChartView.kt and AANull.kt to clean up the codebase and improve maintainability.
1 parent e40b2a2 commit e825e87

File tree

2 files changed

+0
-53
lines changed

2 files changed

+0
-53
lines changed

charts/src/main/java/com/github/aachartmodel/aainfographics/aachartcreator/AAChartView.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ import com.github.aachartmodel.aainfographics.aaoptionsmodel.AAPointEvents
5151
import com.github.aachartmodel.aainfographics.aaoptionsmodel.AASeries
5252
import com.github.aachartmodel.aainfographics.aatools.AAColor
5353
import com.github.aachartmodel.aainfographics.aatools.AAJSStringPurer
54-
//import com.github.aachartmodel.aainfographics.aatools.AANull
55-
//import com.github.aachartmodel.aainfographics.aatools.AANullAdapter
56-
//import com.github.aachartmodel.aainfographics.aatools.AANullObjectAdapter
5754
import com.github.aachartmodel.aainfographics.aatools.aa_toJSArray
5855
import com.google.gson.Gson
5956
import com.google.gson.GsonBuilder
@@ -130,12 +127,8 @@ class AAChartView : WebView {
130127

131128
private var optionsJson: String? = null
132129

133-
// Centralized Gson configured to handle AANull and keep null fields
134130
private val aaGson: Gson by lazy {
135131
GsonBuilder()
136-
// .registerTypeAdapter(String::class.java, AANullAdapter())
137-
// .registerTypeAdapter(AANull::class.java, AANullObjectAdapter())
138-
// .serializeNulls()
139132
.create()
140133
}
141134

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,4 @@
11
package com.github.aachartmodel.aainfographics.aatools
22

3-
import com.google.gson.TypeAdapter
4-
import com.google.gson.annotations.JsonAdapter
5-
import com.google.gson.stream.JsonReader
6-
import com.google.gson.stream.JsonToken
7-
import com.google.gson.stream.JsonWriter
8-
9-
//// 实现 Javascript 中的 null 值的效果
10-
//@JsonAdapter(AANullObjectAdapter::class)
113
class AANull {
124
}
13-
//
14-
//// Adapter used for String properties: when the literal string "AANull" is encountered, output real JSON null
15-
//class AANullAdapter : TypeAdapter<String>() {
16-
// override fun write(out: JsonWriter, value: String?) {
17-
// if (value == "AANull") {
18-
// out.nullValue() // 输出真正的 null
19-
// } else {
20-
// out.value(value)
21-
// }
22-
// }
23-
//
24-
// override fun read(reader: JsonReader): String? {
25-
// return if (reader.peek() == JsonToken.NULL) {
26-
// reader.nextNull()
27-
// null
28-
// } else {
29-
// val result = reader.nextString()
30-
// if (result == "AANull") null else result
31-
// }
32-
// }
33-
//}
34-
//
35-
//// Adapter used for AANull object properties: serialize any AANull instance as JSON null
36-
//class AANullObjectAdapter : TypeAdapter<AANull>() {
37-
// override fun write(out: JsonWriter, value: AANull?) {
38-
// out.nullValue()
39-
// }
40-
//
41-
// override fun read(reader: JsonReader): AANull? {
42-
// if (reader.peek() == JsonToken.NULL) {
43-
// reader.nextNull()
44-
// } else {
45-
// // Consume any unexpected token to keep the stream consistent
46-
// reader.skipValue()
47-
// }
48-
// return null
49-
// }
50-
//}

0 commit comments

Comments
 (0)