Can't this be something like:

while(!this.isValueUnique(namespace, value, item){
	value = prefix + prefixCOunter[prefix].toString();
	prefixCounter[prefix]++;
}

return value;