throws PropertyException {
final PropertyCollection collection = new PropertyCollection();
final PropertyValue pv = checkKeywords(this.getValidKeywords(), value);
if (pv != null) {
collection.addItem(new PdCountry(pv));
collection.addItem(new PdLanguage(pv));
return collection;
}
// There are 2 properties which can be explicitly set
final byte maxTokens = 2;
// Tokenize the input & put the tokens into an ArrayList
final StringTokenizer st = new StringTokenizer(value);
final List<String> tokenList = new ArrayList<String>(st.countTokens());
while (st.hasMoreTokens()) {
tokenList.add(st.nextToken());
}
if (tokenList.size() < 1 || tokenList.size() > maxTokens) {
throw unexpectedValue(value, fobj);
}
// Create an array indicating which property is in each position
final FoProperty[] positionArray = new FoProperty[tokenList.size()];
for (int i = 0; i < tokenList.size(); i++) {
final FoProperty contentType = getContentType(tokenList.get(i));
if (contentType == null) {
throw unexpectedValue(value, fobj);
}
positionArray[i] = contentType;
}
boolean countryFound = false;
boolean languageFound = false;
for (int i = 0; i < positionArray.length; i++) {
switch (positionArray[i]) {
case COUNTRY: {
if (countryFound) {
throw unexpectedValue(value, fobj);
}
collection.addItem(new PdCountry(fobj, propertyFullName,
tokenList.get(i)));
countryFound = true;
break;
}
case LANGUAGE: {
if (languageFound) {
throw unexpectedValue(value, fobj);
}
collection.addItem(new PdLanguage(fobj, propertyFullName,
tokenList.get(i)));
languageFound = true;
break;
}
}