【问题标题】:Implementing SpreadSheet client using google-api-java-client使用 google-api-java-client 实现电子表格客户端
【发布时间】:2012-02-01 01:56:35
【问题描述】:

我一直在尝试基于日历示例实现一个电子表格客户端。 我设法利用解析器和@Key 属性获取电子表格、工作表提要和条目。 (explanation here) 但是,当我收到 ListFeed 响应时,数据存储在元素中,因此无法使用 @Key 功能 有没有办法自动解析这个?

【问题讨论】:

    标签: google-api-java-client google-spreadsheet-api


    【解决方案1】:

    如果你想解析,例如:

    <author>
      <name>John Smith</name>
      <email>john.smith.example@gmail.com</email>
    </author>
    

    你需要创建一个作者类

    public class Author {
    
     @Key("name")
     public String name;
    
     @Key("email")
     public String email
    
    }
    

    在您的提要类中,您添加:

      @Key("Author")
     Author author
    

    这应该可以解决问题。

    【讨论】:

      猜你喜欢
      • 2011-10-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多