com.jgoodies.bookfinder.request.query
Class KeywordQuery

java.lang.Object
  extended by com.jgoodies.bookfinder.request.query.KeywordQuery
All Implemented Interfaces:
XMLQuery

public final class KeywordQuery
extends Object

An implementation of XMLQuery that performs a keyword search using the Amazon.com web services.

Version:
$Revision: 1.6 $
Author:
Karsten Lentzsch

Constructor Summary
KeywordQuery(WebService webService, String searchData)
          Constructs a keyword query using the specified web service and search data.
 
Method Summary
 SearchResult executeQuery()
          Executes this XML query and returns the SearchResult object generated by the query.
protected  SearchResult executeQuery(int pageNo)
          Executes this XML query using the specified page number and returns the SearchResult object generated by the query.
protected  String getOperation()
          Returns the query's search code, as used in the query URL, for example: 'KeywordSearch'.
protected  URL getQueryURL(int pageNo)
          Computes and returns the URL used to execute this query for the specified page no.
protected  String getResponseGroup()
           
 String getSearchData()
          Returns the query's search data, for example: 'gui', or 'arno schmidt'.
protected  String getSearchIndex()
           
 String getSearchType()
          Returns the query's search type, for example: 'author', 'key', or ISBN.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeywordQuery

public KeywordQuery(WebService webService,
                    String searchData)
Constructs a keyword query using the specified web service and search data.

Method Detail

getSearchType

public String getSearchType()
Returns the query's search type, for example: 'author', 'key', or ISBN.

Specified by:
getSearchType in interface XMLQuery
Returns:
this query's search type

getOperation

protected String getOperation()
Returns the query's search code, as used in the query URL, for example: 'KeywordSearch'.

Returns:
this query's search code

executeQuery

public SearchResult executeQuery()
                          throws IOException,
                                 org.jdom.JDOMException
Executes this XML query and returns the SearchResult object generated by the query.

Specified by:
executeQuery in interface XMLQuery
Throws:
IOException
org.jdom.JDOMException

getSearchData

public String getSearchData()
Returns the query's search data, for example: 'gui', or 'arno schmidt'.

Specified by:
getSearchData in interface XMLQuery
Returns:
this query's search data

executeQuery

protected SearchResult executeQuery(int pageNo)
                             throws IOException,
                                    org.jdom.JDOMException
Executes this XML query using the specified page number and returns the SearchResult object generated by the query.

Throws:
IOException
org.jdom.JDOMException

getQueryURL

protected URL getQueryURL(int pageNo)
Computes and returns the URL used to execute this query for the specified page no.

Returns:
the URL used to execute this query

getResponseGroup

protected String getResponseGroup()

getSearchIndex

protected String getSearchIndex()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002-2008 JGoodies Karsten Lentzsch. All Rights Reserved.