use of org.eclipse.wst.xml.core.internal.validation.eclipse.Validator in project webtools.sourceediting by eclipse.
the class JSPContentValidator method validate.
private void validate(IFile file, int kind, ValidationState state, IProgressMonitor monitor, IDOMModel model, IReporter reporter) {
IDOMDocument document = model.getDocument();
if (document == null)
// error
return;
boolean isXMLJSP = isXMLJSP(document);
boolean hasHTMLFeature = hasHTMLFeature(document);
if (hasHTMLFeature && !isXMLJSP) {
INodeAdapterFactory factory = HTMLValidationAdapterFactory.getInstance();
ValidationAdapter adapter = (ValidationAdapter) factory.adapt(document);
if (adapter != null) {
HTMLValidationReporter rep = getReporter(reporter, file, model);
rep.clear();
adapter.setReporter(rep);
adapter.validate(document);
}
}
if (!hasHTMLFeature && isXMLJSP) {
Validator xmlValidator = new Validator();
xmlValidator.validate(file, kind, state, monitor);
}
}
Aggregations