| java.lang.Object | |
| ↳ | com.google.gdata.client.Query |
Known Direct Subclasses
|
Known Indirect Subclasses
|
The Query class is a helper class that aids in the construction of a GData query. It provides a simple API and object model that exposes query parameters. Once constructed, the query can be executed against a GData service.
The Query class also acts as a simple base class for GData services that support custom query parameters. These services can subclass the base Query class, add APIs to represent service query parameters, and participate in the Query URI generation process.
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Query.CategoryFilter | The CategoryFilter class is used to define sets of category conditions that must be met in order for an entry to match. | ||||||||||
| Query.CustomParameter | The CustomParameter class defines a base representation for custom query parameters. | ||||||||||
| Query.ResultFormat | Defines all query return formats. | ||||||||||
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| int | UNDEFINED | Magic value indicating that a numeric field is not set. | |||||||||
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| author | Author name or e-mail address for matched entries. | ||||||||||
| categoryFilters | The list of category filters associate with the query. | ||||||||||
| customParameters | The list of custom parameters associated with the query. | ||||||||||
| feedUrl | Base feed URL against which the query will be applied. | ||||||||||
| fields | Fields partial selection query parameter | ||||||||||
| maxResults | The maximum number of results to return for the query. | ||||||||||
| publishedMax | Maximum published timestamp for matched entries. | ||||||||||
| publishedMin | Minimum published timestamp for matched entries. | ||||||||||
| queryString | Full-text search query string. | ||||||||||
| resultFormat | The expected result format for the query. | ||||||||||
| startIndex | The start index for query results. | ||||||||||
| strict | The strictness of the query parameter parsing on the server. | ||||||||||
| updatedMax | Maximum updated timestamp for matched entries. | ||||||||||
| updatedMin | Minimum updated timestamp for matched entries. | ||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new Query object that targets a feed.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Adds a new CategoryFilter to the query.
| |||||||||||
Adds a new CustomParameter.
| |||||||||||
Returns the author name or email address used for the query.
| |||||||||||
Returns the current list of CategoryFilters associated with the query.
| |||||||||||
Returns the list of custom parameters.
| |||||||||||
Returns the list of custom parameters that match a specified name.
| |||||||||||
Returns the feed URL of this query.
| |||||||||||
Returns the fields query string that will be used for the query.
| |||||||||||
Returns the full text query string that will be used for the query.
| |||||||||||
Gets an existing Integer custom paramter, with null signifying that
the parameter is not specified or not an integer.
| |||||||||||
Returns the maximum number of results to return for the query,
or
UNDEFINED if max results has not been set. | |||||||||||
Returns the maximum published timestamp used for this query.
| |||||||||||
Returns the minimum published timestamp used for this query.
| |||||||||||
Returns the relative query URI that represents only the query
parameters without any components related to the target feed.
| |||||||||||
Returns the query result format.
| |||||||||||
Returns the current start index value for the query,
or
UNDEFINED if start index has not been set. | |||||||||||
Gets an existing String custom parameter, with null signifying that the
parameter is not specified.
| |||||||||||
Returns the maximum updated timestamp used for this query.
| |||||||||||
Returns the minimum updated timestamp used for this query.
| |||||||||||
Returns the Query URL that encapsulates the current state of this
query object.
| |||||||||||
Returns the strictness setting for query parameter parsing on the server.
| |||||||||||
Check if current query state is supported.
| |||||||||||
Sets the author name or email address used for the query.
| |||||||||||
Sets the "fields" partial selection query parameter.
| |||||||||||
Sets the full text query string that will be used for the query.
| |||||||||||
Sets an integer custom paramter, with null signifying to clear the
parameter.
| |||||||||||
Sets the maximum number of results to return for the query.
| |||||||||||
Sets the maximum published timestamp used for the query.
| |||||||||||
Sets the minimum published timestamp used for the query.
| |||||||||||
Sets the expected query result format.
| |||||||||||
Sets the start index for query results.
| |||||||||||
Sets the strictness of parameter parsing.
| |||||||||||
Sets a string custom parameter, with null signifying to clear the
parameter.
| |||||||||||
Sets the maximum updated timestamp used for the query.
| |||||||||||
Sets the minimum updated timestamp used for the query.
| |||||||||||
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Appends specified query (parameter, value) to provided query URL buffer.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Magic value indicating that a numeric field is not set.
Author name or e-mail address for matched entries.
The list of category filters associate with the query.
The list of custom parameters associated with the query.
Base feed URL against which the query will be applied.
Fields partial selection query parameter
The maximum number of results to return for the query. A value of
UNDEFINED indicates the server can determine the maximum size.
Full-text search query string.
The expected result format for the query. The default is
DEFAULT.
The start index for query results. A value of UNDEFINED
indicates that no start index has been set.
The strictness of the query parameter parsing on the server. If strict mode is enabled any unknown query parameters will be rejected. The default value is false.
Constructs a new Query object that targets a feed. The initial state of the query contains no parameters, meaning all entries in the feed would be returned if the query was executed immediately after construction.
| feedUrl | The URL of the feed against which queries will be executed. |
|---|
Adds a new CategoryFilter to the query. For an entry to match the query criteria, it must match against all CategoryFilters that have been associated with the query.
| categoryFilter |
|---|
Adds a new CustomParameter.
| customParameter | The new custom parameter to add. |
|---|
Returns the author name or email address used for the query. Only entries with an author whose name or email address match the specified value will be returned.
null means no author-based matching.
Returns the current list of CategoryFilters associated with the query.
Returns the list of custom parameters.
Returns the list of custom parameters that match a specified name.
| name | The name value to match for returned parameters. |
|---|
Returns the feed URL of this query.
Returns the fields query string that will be used for the query.
Returns the full text query string that will be used for the query.
Gets an existing Integer custom paramter, with null signifying that the parameter is not specified or not an integer.
| name | The name of the parameter |
|---|
Returns the maximum number of results to return for the query,
or UNDEFINED if max results has not been set.
Note: a GData server may choose to provide fewer results, but will never provide more than the requested maximum.
Returns the maximum published timestamp used for this query. Only entries with a published timestamp earlier than the specified timestamp will be returned.
null indicates no maximum timestamp.
Returns the minimum published timestamp used for this query. Only entries with a published time equal to or later than the specified timestamp will be returned.
null indicates no minimum timestamp.
Returns the relative query URI that represents only the query parameters without any components related to the target feed. Subclasses of the Query class may override this method to add additional URI path elements or HTTP query parameters to represent service-specific parameters.
Returns the query result format.
Returns the current start index value for the query,
or UNDEFINED if start index has not been set.
Gets an existing String custom parameter, with null signifying that the parameter is not specified.
| name | The name of the parameter |
|---|
Returns the maximum updated timestamp used for this query. Only entries with an updated timestamp earlier than the specified timestamp will be returned.
null indicates no maximum timestamp.
Returns the minimum updated timestamp used for this query. Only entries with an updated timestamp equal to or later than the specified timestamp will be returned.
null indicates no minimum timestamp.
Returns the Query URL that encapsulates the current state of this query object.
Returns the strictness setting for query parameter parsing on the server.
Check if current query state is supported.
true if supported.
Sets the author name or email address used for the query. Only entries with an author whose name or email address match the specified value will be returned.
| author | The name or email address for matched entries. A value of
null disables author-based matching.
|
|---|
Sets the "fields" partial selection query parameter.
| fields | Query value |
|---|
Sets the full text query string that will be used for the query.
| query | The full text search query string. A value of
null disables full text search for this Query.
|
|---|
Sets an integer custom paramter, with null signifying to clear the parameter.
| name | The parameter name |
|---|---|
| value | The value to set it to |
Sets the maximum number of results to return for the query. Note: a GData server may choose to provide fewer results, but will never provide more than the requested maximum.
| maxResults | The maximum number of results to return for the query. A value of zero indicates that the server is free to determine the maximum value. |
|---|
| IllegalArgumentException | if the provided value is less than zero. |
|---|
Sets the maximum published timestamp used for the query. Only entries with a published time earlier than the specified timestamp will be returned.
| publishedMax | Maximum published timestamp for matched entries. A
value of null disables maximum timestamp filtering.
|
|---|
Sets the minimum published timestamp used for the query. Only entries with a published time equal to or later than the specified timestamp will be returned.
| publishedMin | Minimum published timestamp for matched entries. A
value of null disables minimum timestamp filtering.
|
|---|
Sets the expected query result format.
| resultFormat | ResultFormat value indicating the desired format. |
|---|
Sets the start index for query results. This is a 1-based index.
| startIndex | The start index for query results. |
|---|
| IllegalArgumentException | if index is less than or equal to zero. |
|---|
Sets the strictness of parameter parsing.
| strict | True if strict parsing should be enabled for this query. |
|---|
Sets a string custom parameter, with null signifying to clear the parameter.
| name | The name of the parameter |
|---|---|
| value | The value to set it to |
Sets the maximum updated timestamp used for the query. Only entries with an updated timestamp earlier than the specified timestamp will be returned.
| updatedMax | Maximum updated timestamp for matched entries. A value
of null disables maximum timestamp filtering.
|
|---|
Sets the minimum updated timestamp used for the query. Only entries with an updated timestamp equal to or later than the specified timestamp will be returned.
| updatedMin | Minimum updated timestamp for matched entries. A value
of null disables minimum timestamp filtering.
|
|---|
Appends specified query (parameter, value) to provided query URL buffer.
| queryBuf | Base URI buffer to append to. |
|---|---|
| paramName | Query parameter name. |
| paramValue | Query parameter value. |
| UnsupportedEncodingException |
|---|