}
public static void runExample(
AdWordsServices adWordsServices, AdWordsSession session) throws Exception {
// Get the CampaignService.
CampaignCriterionServiceInterface campaignCriterionService =
adWordsServices.get(session, CampaignCriterionServiceInterface.class);
int offset = 0;
// Create selector.
SelectorBuilder builder = new SelectorBuilder();
Selector selector = builder
.fields(
"CampaignId",
"Id",
"CriteriaType",
"PlatformName",
"LanguageName",
"LocationName",
"KeywordText")
.in("CriteriaType", "KEYWORD", "LANGUAGE", "LOCATION", "PLATFORM")
.offset(0)
.limit(PAGE_SIZE)
.build();
CampaignCriterionPage page = null;
do {
page = campaignCriterionService.get(selector);
if (page.getEntries() != null) {
// Display campaigns.
for (CampaignCriterion campaignCriterion : page.getEntries()) {
System.out.printf("Campaign criterion with campaign id '%s', criterion id '%s', "