// When a new document is created, it can be validated without its
// structure having been set.
fatal(DocumentMessages.getString("TextDocumentValidator.NoStructure"));
return;
}
TextValidatorFactory validatorFactory = new TextValidatorFactory();
if (structure instanceof SimpleTextStructure) {
validateFields((SimpleTextStructure) structure, validatorFactory);
} else {
validateComplexStructure((ComplexTextStructure) structure, validatorFactory);
}