如何在Java中将Big HTML / JSON文件的特定部分解析为域对象

问题描述

我得到了一个很大的HTML / JSON文件,只需很少的相关信息即可。

我只能从某些AWS控制台访问此文件,因此无法将其粘贴到此处。但是我会在这里尽可能多地描述它。

这是HTML / JSON文件:

<section id = "Competitions">
 <h2>text</h2>
<br/>
<h4>..</h4>
 ....multiple lines HTML code

[
{
"country_id" : "41","country_name" : "England","league_ID" : "1","league_name" : "ChampionShip"
},{
"country_id" : "42","country_name" : "Alaska","league_ID" : "2","league_name" : "ChampionShip2"
}
]

....few other html lines.
</section>


<section id = "Teams">
 <h2>text</h2>
<br/>
<h4>..</h4>
 ....multiple lines HTML code

[
{
"team_key" : "41","team_name" : "England","players": [
   // Key-value pairs
 ]
},{
"team_key" : "42","team_name" : "Brazil","players": [

 ]
}

]

// other HTML code.
</section>

我的域对象是:

public class DescriptionModel{
    String countryID;
    String countryName;
    String leagueID;
    String leagueName;

    String teamID;
    String teamName;

    // Setters and Getters

}

我需要知道如何将HTML / JSON文件解析为我的域对象。我需要一个包含多个域对象[DescriptionModel]的JSON,以便可以在UI上显示此信息。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...