This is a just sample for Google Spread Sheet, but it can create new spreadsheet and worksheet, rename the title of worksheet entry, and put cells on your worksheet with OAuth1.0a.
First, you need to invest in writing a custom data model for the Google API. Please read the JavaDoc for the new XML data model in google-api-java-client.
http://www.example.com/feed/1234.1/posts/full2005-09-16T00:42:06ZBooks and Romance with Jo and LizElizabeth Bennetliz@gmail.comExample Generator Engine20http://www.example.com/feed/1234.1/posts/full/45216140250094811512005-01-09T08:00:00Z2005-01-09T08:00:00ZThis is the title of entry 1009
This is the entry body of entry 1009
Elizabeth Bennetliz@gmail.comhttp://www.example.com/feed/1234.1/posts/full/30675450046489315692005-01-07T08:00:00Z2005-01-07T08:02:00ZThis is the title of entry 1007
The optional value parameter of this @Key annotation specifies the XPath name to use to represent the field. For example, an XML attribute a has an XPath name of @a, an XML element <a> has an XPath name of a, and an XML text content has an XPath name of text().
とありますように,@Key("text()") と指定して,テキストコンテンツの内容を表します。
public class Title {
/* for
* This is the title of entry 1007
*/
@Key("@type")
public String type;
@Key("text()")
public String context;
}
import com.google.api.client.util.Key;
public class Category {
/*
*
*/
@Key("@scheme")
public String scheme;
@Key("@term")
public String term;
}
public class Content {
/*
*
*
This is the entry body of entry 1007
*
*/
@Key("@type")
public String type;
@Key("text()")
public String content;
}
public class Link {
/*
*
*/
@Key("@rel")
public String rel;
@Key("@type")
public String type;
@Key("@href")
public String href;
}
public class Author {
/* for
*
* Elizabeth Bennet
* liz@gmail.com
*
*/
@Key
public String name;
@Key
public String email;
}
public class Title {
/* for
* This is the title of entry 1007
*/
@Key("@type")
public String type;
@Key("text()")
public String context;
}
public class GoogleDocEntry {
@Key
public string id;
@Key
public string published;
@Key
public string updated;
@Key
public Category category;
@Key
public Title title;
@Key
public Content content;
@Key("link")
public List links;
@Key
public Author author;
}
public class GoogleDocFeed {
@Key("gd:etag")
public string gd_etag;
@Key
public string id; // for http://www.example.com/feed/1234.1/posts/full
@Key
public string updated; // for 2005-09-16T00:42:06Z
@Key("link")
public List links;
@Key
public Author author;
@Key
public Generator generator;
@Key("openSearch:totalResults")
public int totalResults;
@Key("openSearch:startIndex")
public int startIndex;
@Key("entry")
public List entries;
}