Groovy Documentation

org.jdesktop.swingx.ws.yahoo.search.websearch
[Java] Class YahooContextSearch

java.lang.Object
  org.jdesktop.beans.AbstractBean
      org.jdesktop.swingx.ws.yahoo.search.YahooSearch
          org.jdesktop.swingx.ws.yahoo.search.websearch.YahooWebSearchService
              org.jdesktop.swingx.ws.yahoo.search.websearch.YahooContextSearch

public final class YahooContextSearch
extends YahooWebSearchService

Non visual JavaBean for calling Yahoo! context search and retrieving the search results. To use, simply specify a query, a context, and your appId. (AppId is a value you get from Yahoo -- each application must have an id).

This bean is related to the Yahoo! Web Search web service.

Authors:
rbair


Nested Class Summary
private class YahooContextSearch.Parser

static class YahooContextSearch.Result

The Result of performing a search.

 
Field Summary
private boolean adultOk

private String appId

private String context

private Country country

private Format format

private Language language

private License license

private String query

private boolean similarOk

private Set sites

 
Fields inherited from class YahooSearch
URL_PREFIX
 
Constructor Summary
YahooContextSearch()

 
Method Summary
String getAppId()

Returns:
the Yahoo!

String getContext()

@return the search context to use

Country getCountry()

@return the country code

Format getFormat()

@return the format code

Language getLanguage()

@return the language code

License getLicense()

@return the license code

protected String getMethod()

@inheritDoc

protected Map getParameters()

@inheritDoc

String getQuery()

@return the search query to use

boolean isAdultOk()

@return true if adult content is ok

boolean isSimilarOk()

@return true if similar search results are ok

protected ResultsList readResults(InputStream in)

@inheritDoc

void setAdultOk(boolean adultOk)

Sets the adult ok boolean.

void setAppId(String appId)

Sets the Yahoo app id to use with this component.

void setContext(String context)

Sets the search context to use.

void setCountry(Country country)

Sets the country code.

void setFormat(Format format)

Sets the format code.

void setLanguage(Language language)

Sets the language code.

void setLicense(License license)

Sets the license code.

void setQuery(String query)

Sets the search query to use.

void setSimilarOk(boolean similarOk)

Sets the similar ok flag.

 
Methods inherited from class YahooWebSearchService
getServiceName, getVersionNumber
 
Methods inherited from class YahooSearch
constructUrl, getDefaultResultCount, getMethod, getParameters, getServiceName, getVersionNumber, readResults, search, search
 
Methods inherited from class org.jdesktop.beans.AbstractBean
org.jdesktop.beans.AbstractBean#clone(), org.jdesktop.beans.AbstractBean#addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener), org.jdesktop.beans.AbstractBean#addPropertyChangeListener(java.beans.PropertyChangeListener), org.jdesktop.beans.AbstractBean#removePropertyChangeListener(java.beans.PropertyChangeListener), org.jdesktop.beans.AbstractBean#removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener), org.jdesktop.beans.AbstractBean#getPropertyChangeListeners(java.lang.String), org.jdesktop.beans.AbstractBean#getPropertyChangeListeners(), org.jdesktop.beans.AbstractBean#addVetoableChangeListener(java.lang.String, java.beans.VetoableChangeListener), org.jdesktop.beans.AbstractBean#addVetoableChangeListener(java.beans.VetoableChangeListener), org.jdesktop.beans.AbstractBean#removeVetoableChangeListener(java.lang.String, java.beans.VetoableChangeListener), org.jdesktop.beans.AbstractBean#removeVetoableChangeListener(java.beans.VetoableChangeListener), org.jdesktop.beans.AbstractBean#getVetoableChangeListeners(java.lang.String), org.jdesktop.beans.AbstractBean#getVetoableChangeListeners(), org.jdesktop.beans.AbstractBean#wait(), org.jdesktop.beans.AbstractBean#wait(long), org.jdesktop.beans.AbstractBean#wait(long, int), org.jdesktop.beans.AbstractBean#equals(java.lang.Object), org.jdesktop.beans.AbstractBean#toString(), org.jdesktop.beans.AbstractBean#hashCode(), org.jdesktop.beans.AbstractBean#getClass(), org.jdesktop.beans.AbstractBean#notify(), org.jdesktop.beans.AbstractBean#notifyAll()
 

Field Detail

adultOk

private boolean adultOk


appId

private String appId


context

private String context


country

private Country country


format

private Format format


language

private Language language


license

private License license


query

private String query


similarOk

private boolean similarOk


sites

private Set sites


 
Constructor Detail

YahooContextSearch

public YahooContextSearch()


 
Method Detail

getAppId

public String getAppId()
Returns:
the Yahoo! app id in use for this component


getContext

public String getContext()
Returns:
the search context to use


getCountry

public Country getCountry()
Returns:
the country code


getFormat

public Format getFormat()
Returns:
the format code


getLanguage

public Language getLanguage()
Returns:
the language code


getLicense

public License getLicense()
Returns:
the license code


getMethod

protected final String getMethod()
inheritDoc:


getParameters

protected final Map getParameters()
inheritDoc:


getQuery

public String getQuery()
Returns:
the search query to use


isAdultOk

public boolean isAdultOk()
Returns:
true if adult content is ok


isSimilarOk

public boolean isSimilarOk()
Returns:
true if similar search results are ok


readResults

protected ResultsList readResults(InputStream in)
inheritDoc:


setAdultOk

public void setAdultOk(boolean adultOk)
Sets the adult ok boolean. See Yahoo! for more info


setAppId

public void setAppId(String appId)
Sets the Yahoo app id to use with this component. Without an app id, no searches can be executed. You must get an app id from yahoo. See the Yahoo docs for more info.
Parameters:
appId


setContext

public void setContext(String context)
Sets the search context to use.


setCountry

public void setCountry(Country country)
Sets the country code. See Yahoo! for more info


setFormat

public void setFormat(Format format)
Sets the format code. See Yahoo! for more info


setLanguage

public void setLanguage(Language language)
Sets the language code. See Yahoo! for more info


setLicense

public void setLicense(License license)
Sets the license code. See Yahoo! for more info


setQuery

public void setQuery(String query)
Sets the search query to use. This follows all the same conventions as the web based Yahoo! search engine


setSimilarOk

public void setSimilarOk(boolean similarOk)
Sets the similar ok flag. See Yahoo! for more info


 

Groovy Documentation