// get the component attributes.
List<ServiceParameter> parameters = new ArrayList<ServiceParameter>();
TwitterSearchService twitterSearchService = TwitterServicesFactory.getTwitterSearchService();
parameters.add(new ServiceParameter(TwitterSearchServiceParameters.QUERY, twitterSearchList.getSearchQuery()));
parameters.add(new ServiceParameter(TwitterSearchServiceParameters.PAGE, twitterSearchList.getPageNumber().toString()));
parameters.add(new ServiceParameter(TwitterSearchServiceParameters.TWEETS_PER_PAGE, twitterSearchList.getResultSetSize().toString()));
parameters.add(new ServiceParameter(TwitterSearchServiceParameters.SHOW_USER, twitterSearchList.getShowUser()));
if (twitterSearchList.getResultType() != null) {
parameters.add(new ServiceParameter(TwitterSearchServiceParameters.RESULT_TYPE, twitterSearchList.getResultType()));
}
if (twitterSearchList.getSinceDate() != null) {
parameters.add(new ServiceParameter(TwitterSearchServiceParameters.SINCE_DATE, twitterSearchList.getSinceDate()));
}
if (twitterSearchList.getBeforeDate() != null) {
parameters.add(new ServiceParameter(TwitterSearchServiceParameters.BEFORE_DATE, twitterSearchList.getBeforeDate()));
}
if (twitterSearchList.getSinceID() != null) {
parameters.add(new ServiceParameter(TwitterSearchServiceParameters.SINCE_ID, twitterSearchList.getSinceID()));
}
if (twitterSearchList.getMaxID() != null) {
parameters.add(new ServiceParameter(TwitterSearchServiceParameters.MAX_ID, twitterSearchList.getMaxID()));
}
if (twitterSearchList.getGeocode() != null) {
parameters.add(new ServiceParameter(TwitterSearchServiceParameters.GEOCODE, twitterSearchList.getGeocode()));
}
if (twitterSearchList.getLocale() != null) {
parameters.add(new ServiceParameter(TwitterSearchServiceParameters.LOCALE, twitterSearchList.getLocale()));
}
if (twitterSearchList.getLanguage() != null) {
parameters.add(new ServiceParameter(TwitterSearchServiceParameters.LANGUAGE, twitterSearchList.getLanguage()));
}
// perform the actual tweets search on twitter.
List<TwitterSearchResultItem> twitterSearchResults = twitterSearchService.getSearchList(parameters);