summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDebajit Ghosh <debajit@google.com>2009-08-18 21:38:15 -0700
committerDebajit Ghosh <debajit@google.com>2009-08-18 21:38:15 -0700
commit2b1eeffed0eed39aca594481033e01c0bf669c2a (patch)
tree328d804794290ce5d5af2edb79288d28e09a1ff7
parent4f574f3b50cea6d1ab9b8f7966ac12c63f8c9f1f (diff)
downloadgdata-2b1eeffed0eed39aca594481033e01c0bf669c2a.tar.gz
save space on device, delete unused gdata spreadsheets code. this feed is deprecated, and a new one will be autogenerated in gdata2.
-rwxr-xr-xsrc/com/google/wireless/gdata/spreadsheets/client/SpreadsheetsClient.java236
-rw-r--r--src/com/google/wireless/gdata/spreadsheets/client/package.html5
-rwxr-xr-xsrc/com/google/wireless/gdata/spreadsheets/data/CellEntry.java134
-rwxr-xr-xsrc/com/google/wireless/gdata/spreadsheets/data/CellFeed.java35
-rwxr-xr-xsrc/com/google/wireless/gdata/spreadsheets/data/ListEntry.java77
-rwxr-xr-xsrc/com/google/wireless/gdata/spreadsheets/data/ListFeed.java35
-rwxr-xr-xsrc/com/google/wireless/gdata/spreadsheets/data/SpreadsheetEntry.java38
-rwxr-xr-xsrc/com/google/wireless/gdata/spreadsheets/data/SpreadsheetFeed.java14
-rw-r--r--src/com/google/wireless/gdata/spreadsheets/data/WorksheetEntry.java105
-rwxr-xr-xsrc/com/google/wireless/gdata/spreadsheets/data/WorksheetFeed.java14
-rw-r--r--src/com/google/wireless/gdata/spreadsheets/data/package.html5
-rw-r--r--src/com/google/wireless/gdata/spreadsheets/package.html5
-rw-r--r--src/com/google/wireless/gdata/spreadsheets/parser/package.html5
-rwxr-xr-xsrc/com/google/wireless/gdata/spreadsheets/parser/xml/XmlCellsGDataParser.java126
-rwxr-xr-xsrc/com/google/wireless/gdata/spreadsheets/parser/xml/XmlListGDataParser.java109
-rwxr-xr-xsrc/com/google/wireless/gdata/spreadsheets/parser/xml/XmlSpreadsheetsGDataParser.java68
-rw-r--r--src/com/google/wireless/gdata/spreadsheets/parser/xml/XmlSpreadsheetsGDataParserFactory.java99
-rwxr-xr-xsrc/com/google/wireless/gdata/spreadsheets/parser/xml/XmlWorksheetsGDataParser.java98
-rw-r--r--src/com/google/wireless/gdata/spreadsheets/parser/xml/package.html5
-rw-r--r--src/com/google/wireless/gdata/spreadsheets/serializer/package.html5
-rwxr-xr-xsrc/com/google/wireless/gdata/spreadsheets/serializer/xml/XmlCellEntryGDataSerializer.java83
-rwxr-xr-xsrc/com/google/wireless/gdata/spreadsheets/serializer/xml/XmlListEntryGDataSerializer.java67
-rw-r--r--src/com/google/wireless/gdata/spreadsheets/serializer/xml/package.html5
23 files changed, 0 insertions, 1373 deletions
diff --git a/src/com/google/wireless/gdata/spreadsheets/client/SpreadsheetsClient.java b/src/com/google/wireless/gdata/spreadsheets/client/SpreadsheetsClient.java
deleted file mode 100755
index 388856d..0000000
--- a/src/com/google/wireless/gdata/spreadsheets/client/SpreadsheetsClient.java
+++ /dev/null
@@ -1,236 +0,0 @@
-// Copyright 2007 The Android Open Source Project
-package com.google.wireless.gdata.spreadsheets.client;
-
-import com.google.wireless.gdata.client.GDataClient;
-import com.google.wireless.gdata.client.GDataParserFactory;
-import com.google.wireless.gdata.client.GDataServiceClient;
-import com.google.wireless.gdata.client.HttpException;
-import com.google.wireless.gdata.data.Entry;
-import com.google.wireless.gdata.data.StringUtils;
-import com.google.wireless.gdata.parser.GDataParser;
-import com.google.wireless.gdata.parser.ParseException;
-import com.google.wireless.gdata.serializer.GDataSerializer;
-import com.google.wireless.gdata.spreadsheets.data.CellEntry;
-import com.google.wireless.gdata.spreadsheets.data.ListEntry;
-import com.google.wireless.gdata.spreadsheets.data.SpreadsheetEntry;
-import com.google.wireless.gdata.spreadsheets.data.WorksheetEntry;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * GDataServiceClient for accessing Google Spreadsheets. This client can
- * access and parse all of the Spreadsheets feed types: Spreadsheets feed,
- * Worksheets feed, List feed, and Cells feed. Read operations are supported
- * on all feed types, but only the List and Cells feeds support write
- * operations. (This is a limitation of the protocol, not this API. Such write
- * access may be added to the protocol in the future, requiring changes to
- * this implementation.)
- *
- * Only 'private' visibility and 'full' projections are currently supported.
- */
-public class SpreadsheetsClient extends GDataServiceClient {
- /** The name of the service, dictated to be 'wise' by the protocol. */
- private static final String SERVICE = "wise";
-
- /** Standard base feed url for spreadsheets. */
- public static final String SPREADSHEETS_BASE_FEED_URL =
- "http://spreadsheets.google.com/feeds/spreadsheets/private/full";
-
- /** Base feed url for spreadsheets. */
- private final String baseFeedUrl;
-
- /**
- * Create a new SpreadsheetsClient.
- *
- * @param client The GDataClient that should be used to authenticate
- * requests, retrieve feeds, etc.
- * @param spreadsheetFactory The GDataParserFactory that should be used to obtain GDataParsers
- * used by this client.
- * @param baseFeedUrl The base URL for spreadsheets feeds.
- */
- public SpreadsheetsClient(GDataClient client,
- GDataParserFactory spreadsheetFactory,
- String baseFeedUrl) {
- super(client, spreadsheetFactory);
- this.baseFeedUrl = baseFeedUrl;
- }
-
- /**
- * Create a new SpreadsheetsClient. Uses the standard base URL for spreadsheets feeds.
- *
- * @param client The GDataClient that should be used to authenticate
- * requests, retrieve feeds, etc.
- */
- public SpreadsheetsClient(GDataClient client,
- GDataParserFactory spreadsheetFactory) {
- this(client, spreadsheetFactory, SPREADSHEETS_BASE_FEED_URL);
- }
-
- /* (non-Javadoc)
- * @see GDataServiceClient#getServiceName
- */
- public String getServiceName() {
- return SERVICE;
- }
-
- /**
- * Returns a parser for the specified feed type.
- *
- * @param feedEntryClass the Class of entry type that will be parsed. This lets this
- * method figure out which parser to create.
- * @param feedUri the URI of the feed to be fetched and parsed
- * @param authToken the current authToken to use for the request @return a parser for the indicated feed
- * @throws HttpException if an http error is encountered
- * @throws ParseException if the response from the server could not be
- * parsed
- */
- private GDataParser getParserForTypedFeed(Class feedEntryClass, String feedUri,
- String authToken) throws ParseException, IOException, HttpException {
- GDataClient gDataClient = getGDataClient();
- GDataParserFactory gDataParserFactory = getGDataParserFactory();
-
- InputStream is = gDataClient.getFeedAsStream(feedUri, authToken);
- return gDataParserFactory.createParser(feedEntryClass, is);
- }
-
- /* (non-javadoc)
- * @see GDataServiceClient#createEntry
- */
- public Entry createEntry(String feedUri, String authToken, Entry entry)
- throws ParseException, IOException, HttpException {
-
- GDataParserFactory factory = getGDataParserFactory();
- GDataSerializer serializer = factory.createSerializer(entry);
-
- InputStream is = getGDataClient().createEntry(feedUri, authToken, serializer);
- GDataParser parser = factory.createParser(entry.getClass(), is);
- try {
- return parser.parseStandaloneEntry();
- } finally {
- parser.close();
- }
- }
-
- /**
- * Returns a parser for a Cells-based feed.
- *
- * @param feedUri the URI of the feed to be fetched and parsed
- * @param authToken the current authToken to use for the request
- * @return a parser for the indicated feed
- * @throws HttpException if an http error is encountered
- * @throws ParseException if the response from the server could not be
- * parsed
- */
- public GDataParser getParserForCellsFeed(String feedUri, String authToken)
- throws ParseException, IOException, HttpException {
- return getParserForTypedFeed(CellEntry.class, feedUri, authToken);
- }
-
- /**
- * Fetches a GDataParser for the indicated feed. The parser can be used to
- * access the contents of URI. WARNING: because we cannot reliably infer
- * the feed type from the URI alone, this method assumes the default feed
- * type! This is probably NOT what you want. Please use the
- * getParserFor[Type]Feed methods.
- *
- * @param feedEntryClass
- * @param feedUri the URI of the feed to be fetched and parsed
- * @param authToken the current authToken to use for the request
- * @return a parser for the indicated feed
- * @throws HttpException if an http error is encountered
- * @throws ParseException if the response from the server could not be
- * parsed
- */
- public GDataParser getParserForFeed(Class feedEntryClass, String feedUri, String authToken)
- throws ParseException, IOException, HttpException {
- GDataClient gDataClient = getGDataClient();
- GDataParserFactory gDataParserFactory = getGDataParserFactory();
- InputStream is = gDataClient.getFeedAsStream(feedUri, authToken);
- return gDataParserFactory.createParser(feedEntryClass, is);
- }
-
- /**
- * Returns a parser for a List (row-based) feed.
- *
- * @param feedUri the URI of the feed to be fetched and parsed
- * @param authToken the current authToken to use for the request
- * @return a parser for the indicated feed
- * @throws HttpException if an http error is encountered
- * @throws ParseException if the response from the server could not be
- * parsed
- */
- public GDataParser getParserForListFeed(String feedUri, String authToken)
- throws ParseException, IOException, HttpException {
- return getParserForTypedFeed(ListEntry.class, feedUri, authToken);
- }
-
- /**
- * Returns a parser for a Spreadsheets meta-feed.
- *
- * @param feedUri the URI of the feed to be fetched and parsed
- * @param authToken the current authToken to use for the request
- * @return a parser for the indicated feed
- * @throws HttpException if an http error is encountered
- * @throws ParseException if the response from the server could not be
- * parsed
- */
- public GDataParser getParserForSpreadsheetsFeed(String feedUri, String authToken)
- throws ParseException, IOException, HttpException {
- return getParserForTypedFeed(SpreadsheetEntry.class, feedUri, authToken);
- }
-
- /**
- * Returns a parser for a Worksheets meta-feed.
- *
- * @param feedUri the URI of the feed to be fetched and parsed
- * @param authToken the current authToken to use for the request
- * @return a parser for the indicated feed
- * @throws HttpException if an http error is encountered
- * @throws ParseException if the response from the server could not be
- * parsed
- */
- public GDataParser getParserForWorksheetsFeed(String feedUri, String authToken)
- throws ParseException, IOException, HttpException {
- return getParserForTypedFeed(WorksheetEntry.class, feedUri, authToken);
- }
-
- /**
- * Updates an entry. The URI to be updated is taken from
- * <code>entry</code>. Note that only entries in List and Cells feeds
- * can be updated, so <code>entry</code> must be of the corresponding
- * type; other types will result in an exception.
- *
- * @param entry the entry to be updated; must include its URI
- * @param authToken the current authToken to be used for the operation
- * @return An Entry containing the re-parsed version of the entry returned
- * by the server in response to the update.
- * @throws HttpException if an http error is encountered
- * @throws ParseException if the server returned an error, if the server's
- * response was unparseable (unlikely), or if <code>entry</code>
- * is of a read-only type
- * @throws IOException on network error
- */
- public Entry updateEntry(Entry entry, String authToken)
- throws ParseException, IOException, HttpException {
- GDataParserFactory factory = getGDataParserFactory();
- GDataSerializer serializer = factory.createSerializer(entry);
-
- String editUri = entry.getEditUri();
- if (StringUtils.isEmpty(editUri)) {
- throw new ParseException("No edit URI -- cannot update.");
- }
-
- InputStream is = getGDataClient().updateEntry(editUri, authToken, serializer);
- GDataParser parser = factory.createParser(entry.getClass(), is);
- try {
- return parser.parseStandaloneEntry();
- } finally {
- parser.close();
- }
- }
-
- public String getBaseFeedUrl() {
- return baseFeedUrl;
- }
-}
diff --git a/src/com/google/wireless/gdata/spreadsheets/client/package.html b/src/com/google/wireless/gdata/spreadsheets/client/package.html
deleted file mode 100644
index 1c9bf9d..0000000
--- a/src/com/google/wireless/gdata/spreadsheets/client/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<body>
- {@hide}
-</body>
-</html>
diff --git a/src/com/google/wireless/gdata/spreadsheets/data/CellEntry.java b/src/com/google/wireless/gdata/spreadsheets/data/CellEntry.java
deleted file mode 100755
index 88fb6b6..0000000
--- a/src/com/google/wireless/gdata/spreadsheets/data/CellEntry.java
+++ /dev/null
@@ -1,134 +0,0 @@
-// Copyright 2007 The Android Open Source Project
-package com.google.wireless.gdata.spreadsheets.data;
-
-import com.google.wireless.gdata.data.Entry;
-
-/**
- * Represents an entry in a GData Spreadsheets Cell-based feed.
- */
-public class CellEntry extends Entry {
- /** The spreadsheet column of the cell. */
- private int col = -1;
-
- /** The cell entry's inputValue attribute */
- private String inputValue = null;
-
- /** The cell entry's numericValue attribute */
- private String numericValue = null;
-
- /** The spreadsheet row of the cell */
- private int row = -1;
-
- /** The cell entry's text sub-element */
- private String value = null;
-
- /** Default constructor. */
- public CellEntry() {
- super();
- }
-
- /**
- * Fetches the cell's spreadsheet column.
- *
- * @return the cell's spreadsheet column
- */
- public int getCol() {
- return col;
- }
-
- /**
- * Fetches the cell's inputValue attribute, which is the actual user input
- * rather (such as a formula) than computed value of the cell.
- *
- * @return the cell's inputValue
- */
- public String getInputValue() {
- return inputValue;
- }
-
- /**
- * Fetches the cell's numericValue attribute, which is a decimal
- * representation.
- *
- * @return the cell's numericValue
- */
- public String getNumericValue() {
- return numericValue;
- }
-
- /**
- * Fetches the cell's spreadsheet row.
- *
- * @return the cell's spreadsheet row
- */
- public int getRow() {
- return row;
- }
-
- /**
- * Fetches the cell's contents, after any computation. For example, if the
- * cell actually contains a formula, this will return the formula's computed
- * value.
- *
- * @return the computed value of the cell
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Indicates whether the cell's contents are numeric.
- *
- * @return true if the contents are numeric, or false if not
- */
- public boolean hasNumericValue() {
- return numericValue != null;
- }
-
- /**
- * Sets the cell's spreadsheet column.
- *
- * @param col the new spreadsheet column of the cell
- */
- public void setCol(int col) {
- this.col = col;
- }
-
- /**
- * Sets the cell's actual contents (such as a formula, or a raw value.)
- *
- * @param inputValue the new inputValue of the cell
- */
- public void setInputValue(String inputValue) {
- this.inputValue = inputValue;
- }
-
- /**
- * Sets the cell's numeric value. This can be different from the actual
- * value; for instance, the actual value may be a thousands-delimited pretty
- * string, while the numeric value could be the raw decimal.
- *
- * @param numericValue the cell's new numericValue
- */
- public void setNumericValue(String numericValue) {
- this.numericValue = numericValue;
- }
-
- /**
- * Sets the cell's spreadsheet row.
- *
- * @param row the new spreadsheet row of the cell
- */
- public void setRow(int row) {
- this.row = row;
- }
-
- /**
- * Sets the cell's computed value.
- *
- * @param value the new value of the cell
- */
- public void setValue(String value) {
- this.value = value;
- }
-}
diff --git a/src/com/google/wireless/gdata/spreadsheets/data/CellFeed.java b/src/com/google/wireless/gdata/spreadsheets/data/CellFeed.java
deleted file mode 100755
index 9281e09..0000000
--- a/src/com/google/wireless/gdata/spreadsheets/data/CellFeed.java
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2007 The Android Open Source Project
-package com.google.wireless.gdata.spreadsheets.data;
-
-import com.google.wireless.gdata.data.Feed;
-
-/**
- * A feed handler for GData Spreadsheets cell-based feeds.
- */
-public class CellFeed extends Feed {
- private String editUri;
-
- /** Default constructor. */
- public CellFeed() {
- super();
- }
-
- /**
- * Fetches the URI to which edits (such as cell content updates) should
- * go.
- *
- * @return the edit URI for this feed
- */
- public String getEditUri() {
- return editUri;
- }
-
- /**
- * Sets the URI to which edits (such as cell content updates) should go.
- *
- * @param editUri the new edit URI for this feed
- */
- public void setEditUri(String editUri) {
- this.editUri = editUri;
- }
-}
diff --git a/src/com/google/wireless/gdata/spreadsheets/data/ListEntry.java b/src/com/google/wireless/gdata/spreadsheets/data/ListEntry.java
deleted file mode 100755
index c3e169f..0000000
--- a/src/com/google/wireless/gdata/spreadsheets/data/ListEntry.java
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright 2007 The Android Open Source Project
-package com.google.wireless.gdata.spreadsheets.data;
-
-import com.google.wireless.gdata.data.Entry;
-import com.google.wireless.gdata.data.StringUtils;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
-
-/**
- * Represents an entry in a GData Spreadsheets List feed.
- */
-public class ListEntry extends Entry {
- /** Map containing the values in the row. */
- private Hashtable values = new Hashtable();
-
- /** Caches the list of names, so they don't need to be recomputed. */
- private Vector names = null;
-
- /**
- * Retrieves the column names present in this row.
- *
- * @return a Set of Strings, one per column where data exists
- */
- public Vector getNames() {
- if (names != null) {
- return names;
- }
- names = new Vector();
- Enumeration e = values.keys();
- while (e.hasMoreElements()) {
- names.add(e.nextElement());
- }
- return names;
- }
-
- /**
- * Fetches the value for a column. Equivalent to
- * <code>getValue(name, null)</code>.
- *
- * @param name the name of the column whose row is to be fetched
- * @return the value of the column, or null if the column is not present
- */
- public String getValue(String name) {
- return getValue(name, null);
- }
-
- /**
- * Fetches the value for a column.
- *
- * @param name the name of the column whose row is to be fetched
- * @param defaultValue the value to return if the row has no value for the
- * requested column; may be null
- * @return the value of the column, or null if the column is not present
- */
- public String getValue(String name, String defaultValue) {
- if (StringUtils.isEmpty(name)) {
- return defaultValue;
- }
- String val = (String) values.get(name);
- if (val == null) {
- return defaultValue;
- }
- return val;
- }
-
- /**
- * Sets the value of a column.
- *
- * @param name the name of the column
- * @param value the value for the column
- */
- public void setValue(String name, String value) {
- values.put(name, value == null ? "" : value);
- }
-}
diff --git a/src/com/google/wireless/gdata/spreadsheets/data/ListFeed.java b/src/com/google/wireless/gdata/spreadsheets/data/ListFeed.java
deleted file mode 100755
index d18bfa8..0000000
--- a/src/com/google/wireless/gdata/spreadsheets/data/ListFeed.java
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2007 The Android Open Source Project
-package com.google.wireless.gdata.spreadsheets.data;
-
-import com.google.wireless.gdata.data.Feed;
-
-/**
- * A feed handler for GData Spreadsheets List-based feeds.
- */
-public class ListFeed extends Feed {
- private String editUri;
-
- /** Default constructor. */
- public ListFeed() {
- super();
- }
-
- /**
- * Fetches the URI to which edits (such as cell content updates) should
- * go.
- *
- * @return the edit URI for this feed
- */
- public String getEditUri() {
- return editUri;
- }
-
- /**
- * Sets the URI to which edits (such as cell content updates) should go.
- *
- * @param editUri the new edit URI for this feed
- */
- public void setEditUri(String editUri) {
- this.editUri = editUri;
- }
-}
diff --git a/src/com/google/wireless/gdata/spreadsheets/data/SpreadsheetEntry.java b/src/com/google/wireless/gdata/spreadsheets/data/SpreadsheetEntry.java
deleted file mode 100755
index a10837b..0000000
--- a/src/com/google/wireless/gdata/spreadsheets/data/SpreadsheetEntry.java
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2007 The Android Open Source Project
-package com.google.wireless.gdata.spreadsheets.data;
-
-import com.google.wireless.gdata.GDataException;
-import com.google.wireless.gdata.data.Entry;
-import com.google.wireless.gdata.data.StringUtils;
-
-/**
- * Represents an entry in a GData Spreadsheets meta-feed.
- */
-public class SpreadsheetEntry extends Entry {
- /** The URI of the worksheets meta-feed for this spreadsheet */
- private String worksheetsUri = null;
-
- /**
- * Fetches the URI of the worksheets meta-feed (that is, list of worksheets)
- * for this spreadsheet.
- *
- * @return the worksheets meta-feed URI
- * @throws GDataException if the unique key is not set
- */
- public String getWorksheetFeedUri() throws GDataException {
- if (StringUtils.isEmpty(worksheetsUri)) {
- throw new GDataException("worksheet URI is not set");
- }
- return worksheetsUri;
- }
-
- /**
- * Sets the URI of the worksheet meta-feed corresponding to this
- * spreadsheet.
- *
- * @param href
- */
- public void setWorksheetFeedUri(String href) {
- worksheetsUri = href;
- }
-}
diff --git a/src/com/google/wireless/gdata/spreadsheets/data/SpreadsheetFeed.java b/src/com/google/wireless/gdata/spreadsheets/data/SpreadsheetFeed.java
deleted file mode 100755
index bfab289..0000000
--- a/src/com/google/wireless/gdata/spreadsheets/data/SpreadsheetFeed.java
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2007 The Android Open Source Project
-package com.google.wireless.gdata.spreadsheets.data;
-
-import com.google.wireless.gdata.data.Feed;
-
-/**
- * Feed handler for a GData Spreadsheets meta-feed.
- */
-public class SpreadsheetFeed extends Feed {
- /** Default constructor. */
- public SpreadsheetFeed() {
- super();
- }
-}
diff --git a/src/com/google/wireless/gdata/spreadsheets/data/WorksheetEntry.java b/src/com/google/wireless/gdata/spreadsheets/data/WorksheetEntry.java
deleted file mode 100644
index 2c00d66..0000000
--- a/src/com/google/wireless/gdata/spreadsheets/data/WorksheetEntry.java
+++ /dev/null
@@ -1,105 +0,0 @@
-// Copyright 2007 The Android Open Source Project
-package com.google.wireless.gdata.spreadsheets.data;
-
-import com.google.wireless.gdata.GDataException;
-import com.google.wireless.gdata.data.Entry;
-import com.google.wireless.gdata.data.StringUtils;
-
-/**
- * Represents an entry in a GData Worksheets meta-feed.
- */
-public class WorksheetEntry extends Entry {
- /** The URI to this entry's cells feed. */
- private String cellsUri = null;
-
- /** The number of columns in the worksheet. */
- private int colCount = -1;
-
- /** The URI to this entry's list feed. */
- private String listUri = null;
-
- /** The number of rows in the worksheet. */
- private int rowCount = -1;
-
- /**
- * Fetches the URI of this entry's Cells feed.
- *
- * @return The URI of the entry's Cells feed.
- */
- public String getCellFeedUri() {
- return cellsUri;
- }
-
- /**
- * Fetches the number of columns in the worksheet.
- *
- * @return The number of columns.
- */
- public int getColCount() {
- return colCount;
- }
-
- /**
- * Fetches the URI of this entry's List feed.
- *
- * @return The URI of the entry's List feed.
- * @throws GDataException If the URI is not set or is invalid.
- */
- public String getListFeedUri() {
- return listUri;
- }
-
- /**
- * Fetches the number of rows in the worksheet.
- *
- * @return The number of rows.
- */
- public int getRowCount() {
- return rowCount;
- }
-
- /**
- * Sets the URI of this entry's Cells feed.
- *
- * @param href The HREF attribute that should be the Cells feed URI.
- */
- public void setCellFeedUri(String href) {
- cellsUri = href;
- }
-
- /**
- * Sets the number of columns in the worksheet.
- *
- * @param colCount The new number of columns.
- */
- public void setColCount(int colCount) {
- this.colCount = colCount;
- }
-
- /**
- * Sets this entry's Atom ID.
- *
- * @param id The new ID value.
- */
- public void setId(String id) {
- super.setId(id);
- }
-
- /**
- * Sets the URI of this entry's List feed.
- *
- * @param href The HREF attribute that should be the List feed URI.
- */
- public void setListFeedUri(String href) {
- listUri = href;
- }
-
- /**
- * Sets the number of rows in the worksheet.
- *
- * @param rowCount The new number of rows.
- */
- public void setRowCount(int rowCount) {
- this.rowCount = rowCount;
- }
-}
diff --git a/src/com/google/wireless/gdata/spreadsheets/data/WorksheetFeed.java b/src/com/google/wireless/gdata/spreadsheets/data/WorksheetFeed.java
deleted file mode 100755
index d8c469d..0000000
--- a/src/com/google/wireless/gdata/spreadsheets/data/WorksheetFeed.java
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2007 The Android Open Source Project
-package com.google.wireless.gdata.spreadsheets.data;
-
-import com.google.wireless.gdata.data.Feed;
-
-/**
- * Feed handler for GData Spreadsheets Worksheet meta-feed.
- */
-public class WorksheetFeed extends Feed {
- /** Default constructor. */
- public WorksheetFeed() {
- super();
- }
-}
diff --git a/src/com/google/wireless/gdata/spreadsheets/data/package.html b/src/com/google/wireless/gdata/spreadsheets/data/package.html
deleted file mode 100644
index 1c9bf9d..0000000
--- a/src/com/google/wireless/gdata/spreadsheets/data/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<body>
- {@hide}
-</body>
-</html>
diff --git a/src/com/google/wireless/gdata/spreadsheets/package.html b/src/com/google/wireless/gdata/spreadsheets/package.html
deleted file mode 100644
index 1c9bf9d..0000000
--- a/src/com/google/wireless/gdata/spreadsheets/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<body>
- {@hide}
-</body>
-</html>
diff --git a/src/com/google/wireless/gdata/spreadsheets/parser/package.html b/src/com/google/wireless/gdata/spreadsheets/parser/package.html
deleted file mode 100644
index 1c9bf9d..0000000
--- a/src/com/google/wireless/gdata/spreadsheets/parser/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<body>
- {@hide}
-</body>
-</html>
diff --git a/src/com/google/wireless/gdata/spreadsheets/parser/xml/XmlCellsGDataParser.java b/src/com/google/wireless/gdata/spreadsheets/parser/xml/XmlCellsGDataParser.java
deleted file mode 100755
index b64f76a..0000000
--- a/src/com/google/wireless/gdata/spreadsheets/parser/xml/XmlCellsGDataParser.java
+++ /dev/null
@@ -1,126 +0,0 @@
-// Copyright 2007 The Android Open Source Project
-package com.google.wireless.gdata.spreadsheets.parser.xml;
-
-import com.google.wireless.gdata.data.Entry;
-import com.google.wireless.gdata.data.Feed;
-import com.google.wireless.gdata.data.StringUtils;
-import com.google.wireless.gdata.data.XmlUtils;
-import com.google.wireless.gdata.parser.ParseException;
-import com.google.wireless.gdata.parser.xml.XmlGDataParser;
-import com.google.wireless.gdata.spreadsheets.data.CellEntry;
-import com.google.wireless.gdata.spreadsheets.data.CellFeed;
-
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * Parser for non-Atom data in a GData Spreadsheets Cell-based feed.
- */
-public class XmlCellsGDataParser extends XmlGDataParser {
- /**
- * The rel ID used by the server to identify the URLs for Cell POSTs
- * (updates)
- */
- private static final String CELL_FEED_POST_REL =
- "http://schemas.google.com/g/2005#post";
-
- /**
- * Creates a new XmlCellsGDataParser.
- *
- * @param is the stream from which to read the data
- * @param xmlParser the XMLPullParser to use for parsing the raw XML
- * @throws ParseException if the super-class throws one
- */
- public XmlCellsGDataParser(InputStream is, XmlPullParser xmlParser)
- throws ParseException {
- super(is, xmlParser);
- }
-
- /* (non-JavaDoc)
- * Creates a new Entry that can handle the data parsed by this class.
- */
- protected Entry createEntry() {
- return new CellEntry();
- }
-
- /* (non-JavaDoc)
- * Creates a new Feed that can handle the data parsed by this class.
- */
- protected Feed createFeed() {
- return new CellFeed();
- }
-
- /* (non-JavaDoc)
- * Callback to handle non-Atom data present in an Atom entry tag.
- */
- protected void handleExtraElementInEntry(Entry entry)
- throws XmlPullParserException, IOException {
- XmlPullParser parser = getParser();
- if (!(entry instanceof CellEntry)) {
- throw new IllegalArgumentException("Expected CellEntry!");
- }
- CellEntry row = (CellEntry) entry;
-
- String name = parser.getName();
- // cells can only have row, col, inputValue, & numericValue attrs
- if ("cell".equals(name)) {
- int count = parser.getAttributeCount();
- String attrName = null;
- for (int i = 0; i < count; ++i) {
- attrName = parser.getAttributeName(i);
- if ("row".equals(attrName)) {
- row.setRow(StringUtils.parseInt(parser
- .getAttributeValue(i), 0));
- } else if ("col".equals(attrName)) {
- row.setCol(StringUtils.parseInt(parser
- .getAttributeValue(i), 0));
- } else if ("numericValue".equals(attrName)) {
- row.setNumericValue(parser.getAttributeValue(i));
- } else if ("inputValue".equals(attrName)) {
- row.setInputValue(parser.getAttributeValue(i));
- }
- }
-
- // also need the data stored in the child text node
- row.setValue(XmlUtils.extractChildText(parser));
- }
- }
-
- /* (non-JavaDoc)
- * Callback to handle non-Atom data in the feed.
- */
- protected void handleExtraElementInFeed(Feed feed)
- throws XmlPullParserException, IOException {
- XmlPullParser parser = getParser();
- if (!(feed instanceof CellFeed)) {
- throw new IllegalArgumentException("Expected CellFeed!");
- }
- CellFeed cellFeed = (CellFeed) feed;
-
- String name = parser.getName();
- if (!"link".equals(name)) {
- return;
- }
-
- int numAttrs = parser.getAttributeCount();
- String rel = null;
- String href = null;
- String attrName = null;
- for (int i = 0; i < numAttrs; ++i) {
- attrName = parser.getAttributeName(i);
- if ("rel".equals(attrName)) {
- rel = parser.getAttributeValue(i);
- } else if ("href".equals(attrName)) {
- href = parser.getAttributeValue(i);
- }
- }
- if (!(StringUtils.isEmpty(rel) || StringUtils.isEmpty(href))) {
- if (CELL_FEED_POST_REL.equals(rel)) {
- cellFeed.setEditUri(href);
- }
- }
- }
-}
diff --git a/src/com/google/wireless/gdata/spreadsheets/parser/xml/XmlListGDataParser.java b/src/com/google/wireless/gdata/spreadsheets/parser/xml/XmlListGDataParser.java
deleted file mode 100755
index b582ad9..0000000
--- a/src/com/google/wireless/gdata/spreadsheets/parser/xml/XmlListGDataParser.java
+++ /dev/null
@@ -1,109 +0,0 @@
-// Copyright 2007 The Android Open Source Project
-package com.google.wireless.gdata.spreadsheets.parser.xml;
-
-import com.google.wireless.gdata.data.Entry;
-import com.google.wireless.gdata.data.Feed;
-import com.google.wireless.gdata.data.StringUtils;
-import com.google.wireless.gdata.data.XmlUtils;
-import com.google.wireless.gdata.parser.ParseException;
-import com.google.wireless.gdata.parser.xml.XmlGDataParser;
-import com.google.wireless.gdata.spreadsheets.data.ListEntry;
-import com.google.wireless.gdata.spreadsheets.data.ListFeed;
-
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * Parser for non-Atom data in a GData Spreadsheets List-based feed.
- */
-public class XmlListGDataParser extends XmlGDataParser {
- /**
- * The rel ID used by the server to identify the URLs for List POSTs
- * (updates)
- */
- private static final String LIST_FEED_POST_REL =
- "http://schemas.google.com/g/2005#post";
-
- /**
- * Creates a new XmlListGDataParser.
- *
- * @param is the stream from which to read the data
- * @param xmlParser the XmlPullParser to use to parse the raw XML
- * @throws ParseException if the super-class throws one
- */
- public XmlListGDataParser(InputStream is, XmlPullParser xmlParser)
- throws ParseException {
- super(is, xmlParser);
- }
-
- /* (non-JavaDoc)
- * Creates a new Entry that can handle the data parsed by this class.
- */
- protected Entry createEntry() {
- return new ListEntry();
- }
-
- /* (non-JavaDoc)
- * Creates a new Feed that can handle the data parsed by this class.
- */
- protected Feed createFeed() {
- return new ListFeed();
- }
-
- /* (non-JavaDoc)
- * Callback to handle non-Atom data present in an Atom entry tag.
- */
- protected void handleExtraElementInEntry(Entry entry)
- throws XmlPullParserException, IOException {
- XmlPullParser parser = getParser();
- if (!(entry instanceof ListEntry)) {
- throw new IllegalArgumentException("Expected ListEntry!");
- }
- ListEntry row = (ListEntry) entry;
-
- String name = parser.getName();
- row.setValue(name, XmlUtils.extractChildText(parser));
- }
-
- /* (non-JavaDoc)
- * Callback to handle non-Atom data in the feed.
- */
- protected void handleExtraElementInFeed(Feed feed)
- throws XmlPullParserException, IOException {
- XmlPullParser parser = getParser();
- if (!(feed instanceof ListFeed)) {
- throw new IllegalArgumentException("Expected ListFeed!");
- }
- ListFeed listFeed = (ListFeed) feed;
-
- String name = parser.getName();
- if (!"link".equals(name)) {
- return;
- }
-
- // lists store column data in the gsx namespace:
- // <gsx:columnheader>data</gsx:columnheader>
- // The columnheader tag names are the scrubbed values of the first row.
- // We extract them all and store them as keys in a Map.
- int numAttrs = parser.getAttributeCount();
- String rel = null;
- String href = null;
- String attrName = null;
- for (int i = 0; i < numAttrs; ++i) {
- attrName = parser.getAttributeName(i);
- if ("rel".equals(attrName)) {
- rel = parser.getAttributeValue(i);
- } else if ("href".equals(attrName)) {
- href = parser.getAttributeValue(i);
- }
- }
- if (!(StringUtils.isEmpty(rel) || StringUtils.isEmpty(href))) {
- if (LIST_FEED_POST_REL.equals(rel)) {
- listFeed.setEditUri(href);
- }
- }
- }
-}
diff --git a/src/com/google/wireless/gdata/spreadsheets/parser/xml/XmlSpreadsheetsGDataParser.java b/src/com/google/wireless/gdata/spreadsheets/parser/xml/XmlSpreadsheetsGDataParser.java
deleted file mode 100755
index cb1094d..0000000
--- a/src/com/google/wireless/gdata/spreadsheets/parser/xml/XmlSpreadsheetsGDataParser.java
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2007 The Android Open Source Project
-package com.google.wireless.gdata.spreadsheets.parser.xml;
-
-import com.google.wireless.gdata.data.Entry;
-import com.google.wireless.gdata.data.Feed;
-import com.google.wireless.gdata.parser.ParseException;
-import com.google.wireless.gdata.parser.xml.XmlGDataParser;
-import com.google.wireless.gdata.spreadsheets.data.SpreadsheetEntry;
-import com.google.wireless.gdata.spreadsheets.data.SpreadsheetFeed;
-
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * Parser helper for non-Atom data in a GData Spreadsheets meta-feed.
- */
-public class XmlSpreadsheetsGDataParser extends XmlGDataParser {
- /**
- * The rel ID used by the server to identify the URLs for the worksheets
- * feed
- */
- protected static final String WORKSHEET_FEED_REL =
- "http://schemas.google.com/spreadsheets/2006#worksheetsfeed";
-
- /**
- * Creates a new XmlSpreadsheetsGDataParser.
- *
- * @param is the stream from which to read the data
- * @param xmlParser the XmlPullParser to use to parse the raw XML
- * @throws ParseException if the super-class throws one
- */
- public XmlSpreadsheetsGDataParser(InputStream is, XmlPullParser xmlParser)
- throws ParseException {
- super(is, xmlParser);
- }
-
- /* (non-JavaDoc)
- * Creates a new Entry that can handle the data parsed by this class.
- */
- protected Entry createEntry() {
- return new SpreadsheetEntry();
- }
-
- /* (non-JavaDoc)
- * Creates a new Feed that can handle the data parsed by this class.
- */
- protected Feed createFeed() {
- return new SpreadsheetFeed();
- }
-
- /* (non-JavaDoc)
- * Callback to handle link elements that are not recognized as Atom links.
- * Used to pick out the link tag in a Spreadsheet's entry that corresponds
- * to that spreadsheet's worksheets meta-feed.
- */
- protected void handleExtraLinkInEntry(String rel, String type, String href,
- Entry entry) throws XmlPullParserException, IOException {
- super.handleExtraLinkInEntry(rel, type, href, entry);
- if (WORKSHEET_FEED_REL.equals(rel)
- && "application/atom+xml".equals(type)) {
- SpreadsheetEntry sheet = (SpreadsheetEntry) entry;
- sheet.setWorksheetFeedUri(href);
- }
- }
-}
diff --git a/src/com/google/wireless/gdata/spreadsheets/parser/xml/XmlSpreadsheetsGDataParserFactory.java b/src/com/google/wireless/gdata/spreadsheets/parser/xml/XmlSpreadsheetsGDataParserFactory.java
deleted file mode 100644
index 4feed62..0000000
--- a/src/com/google/wireless/gdata/spreadsheets/parser/xml/XmlSpreadsheetsGDataParserFactory.java
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright 2007 The Android Open Source Project
-package com.google.wireless.gdata.spreadsheets.parser.xml;
-
-import com.google.wireless.gdata.client.GDataParserFactory;
-import com.google.wireless.gdata.data.Entry;
-import com.google.wireless.gdata.parser.GDataParser;
-import com.google.wireless.gdata.parser.ParseException;
-import com.google.wireless.gdata.parser.xml.XmlParserFactory;
-import com.google.wireless.gdata.serializer.GDataSerializer;
-import com.google.wireless.gdata.spreadsheets.data.CellEntry;
-import com.google.wireless.gdata.spreadsheets.data.ListEntry;
-import com.google.wireless.gdata.spreadsheets.data.SpreadsheetEntry;
-import com.google.wireless.gdata.spreadsheets.data.WorksheetEntry;
-import com.google.wireless.gdata.spreadsheets.serializer.xml.XmlCellEntryGDataSerializer;
-import com.google.wireless.gdata.spreadsheets.serializer.xml.XmlListEntryGDataSerializer;
-
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-import java.io.InputStream;
-
-/**
- * A GDataParserFactory capable of handling Spreadsheets.
- */
-public class XmlSpreadsheetsGDataParserFactory implements GDataParserFactory {
- /*
- * @see GDataParserFactory
- */
- public XmlSpreadsheetsGDataParserFactory(XmlParserFactory xmlFactory) {
- this.xmlFactory = xmlFactory;
- }
-
- /** Intentionally private. */
- private XmlSpreadsheetsGDataParserFactory() {
- }
-
- /*
- * Creates a parser for the indicated feed, assuming the default feed type.
- * The default type is specified on {@link SpreadsheetsClient#DEFAULT_FEED}.
- *
- * @param is The stream containing the feed to be parsed.
- * @return A GDataParser capable of parsing the feed as the default type.
- * @throws ParseException if the feed could not be parsed for any reason
- */
- public GDataParser createParser(InputStream is) throws ParseException {
- // attempt a default
- return createParser(SpreadsheetEntry.class, is);
- }
-
- /*
- * Creates a parser of the indicated type for the indicated feed.
- *
- * @param feedType The type of the feed; must be one of the constants on
- * {@link SpreadsheetsClient}.
- * @return A parser capable of parsing the feed as the indicated type.
- * @throws ParseException if the feed could not be parsed for any reason
- */
- public GDataParser createParser(Class entryClass, InputStream is)
- throws ParseException {
- try {
- XmlPullParser xmlParser = xmlFactory.createParser();
- if (entryClass == SpreadsheetEntry.class) {
- return new XmlSpreadsheetsGDataParser(is, xmlParser);
- } else if (entryClass == WorksheetEntry.class) {
- return new XmlWorksheetsGDataParser(is, xmlParser);
- } else if (entryClass == CellEntry.class) {
- return new XmlCellsGDataParser(is, xmlParser);
- } else if (entryClass == ListEntry.class) {
- return new XmlListGDataParser(is, xmlParser);
- } else {
- throw new ParseException("Unrecognized feed requested.");
- }
- } catch (XmlPullParserException e) {
- throw new ParseException("Failed to create parser", e);
- }
- }
-
- /*
- * Creates a serializer capable of handling the indicated entry.
- *
- * @param The Entry to be serialized to an XML string.
- * @return A GDataSerializer capable of handling the indicated entry.
- * @throws IllegalArgumentException if Entry is not a supported type (which
- * currently includes only {@link ListEntry} and {@link CellEntry}.)
- */
- public GDataSerializer createSerializer(Entry entry) {
- if (entry instanceof ListEntry) {
- return new XmlListEntryGDataSerializer(xmlFactory, entry);
- } else if (entry instanceof CellEntry) {
- return new XmlCellEntryGDataSerializer(xmlFactory, entry);
- } else {
- throw new IllegalArgumentException(
- "Expected a ListEntry or CellEntry");
- }
- }
-
- /** The XmlParserFactory to use to actually process XML streams. */
- private XmlParserFactory xmlFactory;
-}
diff --git a/src/com/google/wireless/gdata/spreadsheets/parser/xml/XmlWorksheetsGDataParser.java b/src/com/google/wireless/gdata/spreadsheets/parser/xml/XmlWorksheetsGDataParser.java
deleted file mode 100755
index e9ceee5..0000000
--- a/src/com/google/wireless/gdata/spreadsheets/parser/xml/XmlWorksheetsGDataParser.java
+++ /dev/null
@@ -1,98 +0,0 @@
-// Copyright 2007 The Android Open Source Project
-package com.google.wireless.gdata.spreadsheets.parser.xml;
-
-import com.google.wireless.gdata.data.Entry;
-import com.google.wireless.gdata.data.Feed;
-import com.google.wireless.gdata.data.StringUtils;
-import com.google.wireless.gdata.data.XmlUtils;
-import com.google.wireless.gdata.parser.ParseException;
-import com.google.wireless.gdata.parser.xml.XmlGDataParser;
-import com.google.wireless.gdata.spreadsheets.data.WorksheetEntry;
-import com.google.wireless.gdata.spreadsheets.data.WorksheetFeed;
-
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * Parser helper for non-Atom data in a GData Spreadsheets Worksheets meta-feed.
- */
-public class XmlWorksheetsGDataParser extends XmlGDataParser {
- /**
- * The rel ID used by the server to identify the cells feed for a worksheet
- */
- protected static final String CELLS_FEED_REL =
- "http://schemas.google.com/spreadsheets/2006#cellsfeed";
-
- /**
- * The rel ID used by the server to identify the list feed for a worksheet
- */
- protected static final String LIST_FEED_REL =
- "http://schemas.google.com/spreadsheets/2006#listfeed";
-
- /**
- * Creates a new XmlWorksheetsGDataParser.
- *
- * @param is the stream from which to read the data
- * @param xmlParser the XmlPullParser to use to parse the raw XML
- * @throws ParseException if the super-class throws one
- */
- public XmlWorksheetsGDataParser(InputStream is, XmlPullParser xmlParser)
- throws ParseException {
- super(is, xmlParser);
- }
-
- /* (non-JavaDoc)
- * Creates a new Entry that can handle the data parsed by this class.
- */
- protected Entry createEntry() {
- return new WorksheetEntry();
- }
-
- /* (non-JavaDoc)
- * Creates a new Feed that can handle the data parsed by this class.
- */
- protected Feed createFeed() {
- return new WorksheetFeed();
- }
-
- /* (non-JavaDoc)
- * Callback to handle non-Atom data present in an Atom entry tag.
- */
- protected void handleExtraElementInEntry(Entry entry)
- throws XmlPullParserException, IOException {
- XmlPullParser parser = getParser();
- if (!(entry instanceof WorksheetEntry)) {
- throw new IllegalArgumentException("Expected WorksheetEntry!");
- }
- WorksheetEntry worksheet = (WorksheetEntry) entry;
-
- // the only custom elements are rowCount and colCount
- String name = parser.getName();
- if ("rowCount".equals(name)) {
- worksheet.setRowCount(StringUtils.parseInt(XmlUtils
- .extractChildText(parser), 0));
- } else if ("colCount".equals(name)) {
- worksheet.setColCount(StringUtils.parseInt(XmlUtils
- .extractChildText(parser), 0));
- }
- }
-
- /* (non-JavaDoc)
- * Callback to handle non-Atom links present in an Atom entry tag. Used to
- * pick out a worksheet's cells and list feeds.
- */
- protected void handleExtraLinkInEntry(String rel, String type, String href,
- Entry entry) throws XmlPullParserException, IOException {
- if (LIST_FEED_REL.equals(rel) && "application/atom+xml".equals(type)) {
- WorksheetEntry sheet = (WorksheetEntry) entry;
- sheet.setListFeedUri(href);
- } else if (CELLS_FEED_REL.equals(rel)
- && "application/atom+xml".equals(type)) {
- WorksheetEntry sheet = (WorksheetEntry) entry;
- sheet.setCellFeedUri(href);
- }
- }
-}
diff --git a/src/com/google/wireless/gdata/spreadsheets/parser/xml/package.html b/src/com/google/wireless/gdata/spreadsheets/parser/xml/package.html
deleted file mode 100644
index 1c9bf9d..0000000
--- a/src/com/google/wireless/gdata/spreadsheets/parser/xml/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<body>
- {@hide}
-</body>
-</html>
diff --git a/src/com/google/wireless/gdata/spreadsheets/serializer/package.html b/src/com/google/wireless/gdata/spreadsheets/serializer/package.html
deleted file mode 100644
index 1c9bf9d..0000000
--- a/src/com/google/wireless/gdata/spreadsheets/serializer/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<body>
- {@hide}
-</body>
-</html>
diff --git a/src/com/google/wireless/gdata/spreadsheets/serializer/xml/XmlCellEntryGDataSerializer.java b/src/com/google/wireless/gdata/spreadsheets/serializer/xml/XmlCellEntryGDataSerializer.java
deleted file mode 100755
index 995af2c..0000000
--- a/src/com/google/wireless/gdata/spreadsheets/serializer/xml/XmlCellEntryGDataSerializer.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package com.google.wireless.gdata.spreadsheets.serializer.xml;
-
-import com.google.wireless.gdata.data.Entry;
-import com.google.wireless.gdata.data.StringUtils;
-import com.google.wireless.gdata.parser.ParseException;
-import com.google.wireless.gdata.parser.xml.XmlParserFactory;
-import com.google.wireless.gdata.serializer.xml.XmlEntryGDataSerializer;
-import com.google.wireless.gdata.spreadsheets.data.CellEntry;
-
-import org.xmlpull.v1.XmlSerializer;
-
-import java.io.IOException;
-
-/**
- * A serializer for handling GData Spreadsheets Cell entries.
- */
-public class XmlCellEntryGDataSerializer extends XmlEntryGDataSerializer {
- /** The namespace to use for the GData Cell attributes */
- public static final String NAMESPACE_GS = "gs";
-
- /** The URI of the GData Cell namespace */
- public static final String NAMESPACE_GS_URI =
- "http://schemas.google.com/spreadsheets/2006";
-
- /**
- * Creates a new XmlCellEntryGDataSerializer.
- *
- * @param entry the entry to be serialized
- */
- public XmlCellEntryGDataSerializer(XmlParserFactory xmlFactory,
- Entry entry) {
- super(xmlFactory, entry);
- }
-
- /**
- * Sets up the GData Cell namespace.
- *
- * @param serializer the serializer to use
- */
- protected void declareExtraEntryNamespaces(XmlSerializer serializer)
- throws IOException {
- serializer.setPrefix(NAMESPACE_GS, NAMESPACE_GS_URI);
- }
-
- /*
- * Handles the non-Atom data belonging to the GData Spreadsheets Cell
- * namespace.
- *
- * @param serializer the XML serializer to use
- * @param format unused
- * @throws ParseException if the data could not be serialized
- * @throws IOException on network error
- */
- protected void serializeExtraEntryContents(XmlSerializer serializer,
- int format) throws ParseException, IOException {
- CellEntry entry = (CellEntry) getEntry();
- int row = entry.getRow();
- int col = entry.getCol();
- String value = entry.getValue();
- String inputValue = entry.getInputValue();
- if (row < 0 || col < 0) {
- throw new ParseException("Negative row or column value");
- }
-
- // cells require row & col attrs, and allow inputValue and
- // numericValue
- serializer.startTag(NAMESPACE_GS_URI, "cell");
- serializer.attribute(null /* ns */, "row", "" + row);
- serializer.attribute(null /* ns */, "col", "" + col);
- if (inputValue != null) {
- serializer.attribute(null /* ns */, "inputValue", inputValue);
- }
- if (entry.hasNumericValue()) {
- serializer.attribute(null /* ns */, "numericValue", entry
- .getNumericValue());
- }
-
- // set the child text...
- value = StringUtils.isEmpty(value) ? "" : value;
- serializer.text(value);
- serializer.endTag(NAMESPACE_GS_URI, "cell");
- }
-}
diff --git a/src/com/google/wireless/gdata/spreadsheets/serializer/xml/XmlListEntryGDataSerializer.java b/src/com/google/wireless/gdata/spreadsheets/serializer/xml/XmlListEntryGDataSerializer.java
deleted file mode 100755
index 55cc59c..0000000
--- a/src/com/google/wireless/gdata/spreadsheets/serializer/xml/XmlListEntryGDataSerializer.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package com.google.wireless.gdata.spreadsheets.serializer.xml;
-
-import com.google.wireless.gdata.data.Entry;
-import com.google.wireless.gdata.parser.ParseException;
-import com.google.wireless.gdata.parser.xml.XmlParserFactory;
-import com.google.wireless.gdata.serializer.xml.XmlEntryGDataSerializer;
-import com.google.wireless.gdata.spreadsheets.data.ListEntry;
-
-import org.xmlpull.v1.XmlSerializer;
-
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.Vector;
-
-/**
- * A serializer for handling GData Spreadsheets List entries.
- */
-public class XmlListEntryGDataSerializer extends XmlEntryGDataSerializer {
- /** The prefix to use for the GData Spreadsheets list namespace */
- public static final String NAMESPACE_GSX = "gsx";
-
- /** The URI of the GData Spreadsheets list namespace */
- public static final String NAMESPACE_GSX_URI =
- "http://schemas.google.com/spreadsheets/2006/extended";
-
- /**
- * Creates a new XmlListEntryGDataSerializer.
- *
- * @param entry the entry to be serialized
- */
- public XmlListEntryGDataSerializer(XmlParserFactory xmlFactory, Entry entry) {
- super(xmlFactory, entry);
- }
-
- /**
- * Sets up the GData Spreadsheets list namespace.
- *
- * @param serializer the XML serializer to use
- * @throws IOException on stream errors.
- */
- protected void declareExtraEntryNamespaces(XmlSerializer serializer)
- throws IOException {
- serializer.setPrefix(NAMESPACE_GSX, NAMESPACE_GSX_URI);
- }
-
- /* (non-JavaDoc)
- * Handles the non-Atom data belonging to the GData Spreadsheets Cell
- * namespace.
- */
- protected void serializeExtraEntryContents(XmlSerializer serializer,
- int format) throws ParseException, IOException {
- ListEntry entry = (ListEntry) getEntry();
- Vector names = entry.getNames();
- String name = null;
- String value = null;
- Iterator it = names.iterator();
- while (it.hasNext()) {
- name = (String) it.next();
- value = entry.getValue(name);
- if (value != null) {
- serializer.startTag(NAMESPACE_GSX_URI, name);
- serializer.text(value);
- serializer.endTag(NAMESPACE_GSX_URI, name);
- }
- }
- }
-}
diff --git a/src/com/google/wireless/gdata/spreadsheets/serializer/xml/package.html b/src/com/google/wireless/gdata/spreadsheets/serializer/xml/package.html
deleted file mode 100644
index 1c9bf9d..0000000
--- a/src/com/google/wireless/gdata/spreadsheets/serializer/xml/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<body>
- {@hide}
-</body>
-</html>