| <html> |
| <body> |
| <h1>Validation Framework</h1> |
| <h3>Dependency Support</h3> |
| <p>Sometimes resources depend on other resources, to determine whether they are |
| valid or not. An example would be that an XML resource could depend on a DTD. If at some |
| point in the future the DTD changes, then the dependent XML resource should be |
| revalidated to ensure that it still meets the requirements of the changed DTD |
| file. In order to do this efficiently, there needs to be an association between |
| the DTD and all the resources that depend on it.<p>To be as efficient as possible, the validation framework allows |
| this dependency information to be returned as part of a |
| <a href="AbstractValidator.html#validate(org.eclipse.core.resources.IResource, int, ValidationState, org.eclipse.core.runtime.IProgressMonitor)"> |
| validate operation</a>. Since the validator needed to figure this out anyways, |
| why not pass this information back to the framework, so that it can be saved. |
| This saves the cost of having to parse the file at some later point in time |
| (when the file is probably sitting cold on disk). The fewer times that we need |
| to open, read and/or parse the same file, will improve the performance of the |
| product. |
| <p>In particular when the validate method returns, a |
| <a href="ValidationResult.html">ValidationResult</a> must be returned, inside of |
| this result, all your dependencies need to be specified with the |
| <a href="ValidationResult.html#setDependsOn(org.eclipse.core.resources.IResource[])"> |
| setDependsOn</a> method.<p>In addition to keeping the dependency information |
| up-to-date through the normal course of validation, direct access is also |
| provided to the dependency support through the |
| <a href="ValidationFramework.html#getDependencyIndex()">getDependencyIndex</a> |
| method. The <a href="IDependencyIndex.html">IDependencyIndex</a> allows you to |
| directly manipulate the dependency information for a validator. |
| </body> |
| </html> |