成人国产在线小视频_日韩寡妇人妻调教在线播放_色成人www永久在线观看_2018国产精品久久_亚洲欧美高清在线30p_亚洲少妇综合一区_黄色在线播放国产_亚洲另类技巧小说校园_国产主播xx日韩_a级毛片在线免费

資訊專欄INFORMATION COLUMN

籃球數(shù)據(jù)API接口 - 【籃球隊(duì)員】API調(diào)用示例代碼

zhisheng / 703人閱讀

摘要:野子電競數(shù)據(jù)官網(wǎng)改版全新登場籃球隊(duì)員獲取返回內(nèi)容這里為了方便測試我使用了一份本地文件,使用時應(yīng)替換為真實(shí)接口返回內(nèi)容

野子電競數(shù)據(jù)官網(wǎng)改版https://www.xxe.io/全新登場
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.ByteArrayInputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;

/**

@API: 7.籃球隊(duì)員

@Website: https://www.xxe.io/

*/
public class BasketballPlayerInfo {

public static void main(String[] args) {
    try {
        String content = getContent();

        JAXBContext jaxbContext = JAXBContext.newInstance(PlayerList.class);
        Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();

        PlayerList list = (PlayerList) unmarshaller.unmarshal(new ByteArrayInputStream(content.getBytes()));
        list.getPlayerList().forEach(System.out::println);

    } catch (Throwable t) {
        t.printStackTrace();
    }
}

/**
 * 獲取API返回內(nèi)容
 * 

* Note: 這里為了方便測試我使用了一份本地文件,使用時應(yīng)替換為真實(shí)接口返回內(nèi)容 */ private static String getContent() { try { StringBuilder builder = new StringBuilder(); List lines = Files.readAllLines(Paths.get("./src/main/resources/BasketballPlayerInfo.xml"), StandardCharsets.UTF_8); lines.forEach(builder::append); return builder.toString(); } catch (Throwable t) { t.printStackTrace(); return ""; } } @XmlRootElement(name = "list") public static class PlayerList{ @XmlElement(name = "i") private List playerList; public List getPlayerList() { return playerList; } } public static class Player { @XmlElement(name = "id") private String id; @XmlElement(name = "Number") private String number; @XmlElement(name = "Name_F") private String nameBig; @XmlElement(name = "Name_JS") private String nameGbShort; @XmlElement(name = "Name_J") private String nameGb; @XmlElement(name = "Name_E") private String nameEn; @XmlElement(name = "TeamID") private String teamId; @XmlElement(name = "Place") private String place; @XmlElement(name = "Birthday") private String birthday; @XmlElement(name = "Tallness") private String tallness; @XmlElement(name = "Weight") private String weight; @XmlElement(name = "Photo") private String photo; @XmlElement(name = "NbaAge") private String nbaAge; @XmlElement(name = "Salary") private String salary; @Override public String toString() { return "Player{" + "id="" + id + """ + ", number="" + number + """ + ", nameBig="" + nameBig + """ + ", nameGbShort="" + nameGbShort + """ + ", nameGb="" + nameGb + """ + ", nameEn="" + nameEn + """ + ", teamId="" + teamId + """ + ", place="" + place + """ + ", birthday="" + birthday + """ + ", tallness="" + tallness + """ + ", weight="" + weight + """ + ", photo="" + photo + """ + ", nbaAge="" + nbaAge + """ + ", salary="" + salary + """ + "}"; } }

}

文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請注明本文地址:http://systransis.cn/yun/116355.html

相關(guān)文章

  • 籃球即時比分api接口調(diào)用示例代碼

    摘要:分享籃球即時比分接口調(diào)用的示例代碼,可查看在線調(diào)用文檔,需注冊下即時變化的比分?jǐn)?shù)據(jù)獲取返回內(nèi)容這里為了方便測試我使用了一份本地文件,使用時應(yīng)替換為真實(shí)接口返回內(nèi)容返回?cái)?shù)據(jù)如下部分 分享籃球即時比分api接口調(diào)用的示例代碼,可查看在線調(diào)用文檔,需注冊下https://www.feijing88.com/bas... package com.huaying.demo.basketball;...

    bigdevil_s 評論0 收藏0
  • 籃球即時比分api接口調(diào)用示例代碼

    摘要:分享籃球即時比分接口調(diào)用的示例代碼,可查看在線調(diào)用文檔,需注冊下即時變化的比分?jǐn)?shù)據(jù)獲取返回內(nèi)容這里為了方便測試我使用了一份本地文件,使用時應(yīng)替換為真實(shí)接口返回內(nèi)容返回?cái)?shù)據(jù)如下部分 分享籃球即時比分api接口調(diào)用的示例代碼,可查看在線調(diào)用文檔,需注冊下https://www.feijing88.com/bas... package com.huaying.demo.basketball;...

    mengera88 評論0 收藏0
  • 籃球即時比分api接口調(diào)用示例代碼

    摘要:分享籃球即時比分接口調(diào)用的示例代碼,可查看在線調(diào)用文檔,需注冊下即時變化的比分?jǐn)?shù)據(jù)獲取返回內(nèi)容這里為了方便測試我使用了一份本地文件,使用時應(yīng)替換為真實(shí)接口返回內(nèi)容返回?cái)?shù)據(jù)如下部分 分享籃球即時比分api接口調(diào)用的示例代碼,可查看在線調(diào)用文檔,需注冊下https://www.feijing88.com/bas... package com.huaying.demo.basketball;...

    harriszh 評論0 收藏0
  • 設(shè)計(jì)模式——工廠模式

    摘要:簡單工廠模式創(chuàng)建單一的對象示例描述工廠模式主要是為了創(chuàng)建對象實(shí)例或者類簇抽象工廠關(guān)心的是最終產(chǎn)出創(chuàng)建的對象而不關(guān)心創(chuàng)建的過程在出現(xiàn)多個類的時候每次創(chuàng)建需要找到對應(yīng)的類往往比較麻煩這時候通常使用一個函數(shù)進(jìn)行封裝來創(chuàng)建所需要的對象這樣就無需關(guān)注 簡單工廠模式(創(chuàng)建單一的對象) 示例1 描述 工廠模式主要是為了創(chuàng)建對象實(shí)例或者類簇(抽象工廠), 關(guān)心的是最終產(chǎn)出(創(chuàng)建)的對象, 而不關(guān)心創(chuàng)建...

    Moxmi 評論0 收藏0

發(fā)表評論

0條評論

閱讀需要支付1元查看
<