use of org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext in project sling by apache.
the class IgnoreMissingGrammarXmlValidator method validate.
/** Perform the validation using version 2 of the validation framework. Copied from {@link AbstractNestedValidator#validate(IResource,
* int, ValidationState, IProgressMonitor). Cannot use original one as that skips resources starting with "." */
@Override
public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor) {
ValidationResult result = new ValidationResult();
IFile file = null;
if (resource instanceof IFile)
file = (IFile) resource;
if (file != null && shouldValidate(file)) {
IReporter reporter = result.getReporter(monitor);
NestedValidatorContext nestedcontext = getNestedContext(state, false);
boolean teardownRequired = false;
if (nestedcontext == null) {
// validationstart was not called, so manually setup and tear down
nestedcontext = getNestedContext(state, true);
nestedcontext.setProject(file.getProject());
setupValidation(nestedcontext);
teardownRequired = true;
} else {
nestedcontext.setProject(file.getProject());
}
doValidate(file, null, result, reporter, nestedcontext);
if (teardownRequired)
teardownValidation(nestedcontext);
}
return result;
}
Aggregations