function FoodListConverter(separator) {
  this.separator = separator;
}

FoodListConverter.prototype = new TrConverter();

FoodListConverter.prototype.getAsString = function (value, label) {
	console.log('FoodListConverter.getAsString("' + value + '", "' + label + '")');
	return value.toString();
}

FoodListConverter.prototype.getAsObject = function (value, label) {
	console.log('FoodListConverter.getAsObject("' + value + '", "' + label + '")');
	return new FoodList(value, this.separator);
}

function FoodList(value, separator) {
	console.log('new FoodsList("' + value + '", "' + separator + '")');
	this.separator = separator;
	console.log('separator = "' + separator + '"');
	this.foodlist = value.split(separator);
}

FoodList.prototype.toString = function() {
	var result = "";
	for (food in this.foodlist) {
		result += this.separator + food;
	}
    return result.substring(this.separator.length);
}