开发中复杂Json解析(LinkedTreeMap)

时间:2020-10-10 07:42:35
【文件属性】:

文件名称:开发中复杂Json解析(LinkedTreeMap)

文件大小:332KB

文件格式:RAR

更新时间:2020-10-10 07:42:35

Map Json

开发中遇到的复杂JSON,用TypeToken来进行处理:(当然还有第二种解析方式,请查看http://blog.csdn.net/jason_996/article/details/78039799) 处理方法: 1,先将接口返回的JSON,用gson.tojson(map)方法,将LinkedTreeMap对象转成String。 2,再通过gson.fromjson(string,type)方法,将String转成LinkedTreeMap。用到了Type type=new TypeToken(){}.getType; 3,再将LinkedTreeMapf进行遍历


【文件预览】:
.gitignore
app
----.gitignore(8B)
----build.gradle(960B)
----src()
--------androidTest()
--------main()
--------test()
----libs()
----proguard-rules.pro(683B)
----app.iml(13KB)
settings.gradle
LinkedTreeMap的json.png
build.gradle
MYMYJson.iml
gradlew
gradlew.bat
gradle.properties
.gradle
----2.14.1()
--------taskArtifacts()
--------tasks()
.idea
----misc.xml(3KB)
----encodings.xml(159B)
----libraries()
--------support_compat_26_0_0_alpha1.xml(651B)
--------exposed_instrumentation_api_publish_0_5.xml(721B)
--------hamcrest_library_1_3.xml(540B)
--------animated_vector_drawable_26_0_0_alpha1.xml(701B)
--------javawriter_2_1_1.xml(330B)
--------jsr305_2_0_1.xml(330B)
--------javax_inject_1.xml(511B)
--------gson_2_6_1.xml(507B)
--------support_core_ui_26_0_0_alpha1.xml(656B)
--------support_core_utils_26_0_0_alpha1.xml(671B)
--------support_vector_drawable_26_0_0_alpha1.xml(696B)
--------okhttp_3_2_0.xml(517B)
--------espresso_idling_resource_2_2_2.xml(703B)
--------junit_4_12.xml(477B)
--------converter_gson_2_0_1.xml(560B)
--------rules_0_5.xml(571B)
--------support_fragment_26_0_0_alpha1.xml(661B)
--------javax_annotation_api_1_2.xml(358B)
--------support_v4_26_0_0_alpha1.xml(631B)
--------runner_0_5.xml(576B)
--------hamcrest_core_1_3.xml(526B)
--------hamcrest_integration_1_3.xml(354B)
--------espresso_core_2_2_2.xml(648B)
--------appcompat_v7_26_0_0_alpha1.xml(641B)
--------support_annotations_26_0_0_alpha1.xml(572B)
--------retrofit_2_0_1.xml(530B)
--------support_media_compat_26_0_0_alpha1.xml(681B)
--------okio_1_6_0.xml(501B)
----workspace.xml(182KB)
----gradle.xml(626B)
----copyright()
--------profiles_settings.xml(76B)
----runConfigurations.xml(564B)
----compiler.xml(686B)
----modules.xml(353B)
gradle
----wrapper()
--------gradle-wrapper.properties(233B)
--------gradle-wrapper.jar(52KB)
local.properties

网友评论

  • 还没看先5分