IllegalArgumentException will be thrown if validation fails
StringTokenizer tokenizer = new StringTokenizer(stValue);
int count = tokenizer.countTokens();
entities = new Entity[count];
for(int i=0;i<count;i++){
entities[i] = new Entity(tokenizer.nextToken());
}