}
public ValidationResult validate(final IResource resource, int kind, ValidationState state, IProgressMonitor monitor) {
if (resource.getType() != IResource.FILE)
return null;
final ValidationResult result = new ValidationResult();
final IReporter reporter = result.getReporter(monitor);
if(result.getDependsOn() != null) {
fDependsOn = new HashSet(Arrays.asList(result.getDependsOn()));
}
else {
fDependsOn = new HashSet();
}
// add web.xml as a dependency
addDependsOn(DeploymentDescriptorPropertyCache.getInstance().getWebXML(resource.getFullPath()));
// List relevant JSP 2.0 preludes/codas as dependencies
IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
PropertyGroup[] propertyGroups = DeploymentDescriptorPropertyCache.getInstance().getPropertyGroups(resource.getFullPath());
for (int j = 0; j < propertyGroups.length; j++) {
IPath[] preludes = propertyGroups[j].getIncludePrelude();
for (int i = 0; i < preludes.length; i++) {
addDependsOn(workspaceRoot.getFile(preludes[i]));
}
IPath[] codas = propertyGroups[j].getIncludeCoda();
for (int i = 0; i < codas.length; i++) {
addDependsOn(workspaceRoot.getFile(codas[i]));
}
}
IWorkspaceRunnable validationRunnable = new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
if (fragmentCheck((IFile) resource)) {
validateFile((IFile) resource, reporter);
}
IResource[] resources = (IResource[]) fDependsOn.toArray(new IResource[fDependsOn.size()]);
result.setDependsOn(resources);
fDependsOn.clear();
}
};
Job currentJob = Job.getJobManager().currentJob();
ISchedulingRule rule = null;