blob: 1e09976ca94433e18c8aa4c388b9aff1fa47fb82 [file] [log] [blame]
paveryb0763c02005-10-17 15:55:28 +00001package org.eclipse.wst.sse.ui.internal.reconcile.validator;
2
3import org.eclipse.jface.text.IDocument;
4import org.eclipse.jface.text.IRegion;
5import org.eclipse.wst.validation.internal.provisional.core.IReporter;
6import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
7
8/**
9 * Interface to allow for "partial document" as you type validation.
10 *
11 */
12public interface ISourceValidator {
13
14 /**
15 * As you type validation is getting "hooked up" to this IDocument.
16 * This is the instance of IDocument that the validator should
17 * operate on for each validate call.
18 *
19 * @param document
20 */
21 void connect(IDocument document);
22
23 /**
24 * The same IDocument passed in from the connect() method.
25 * This indicates that as you type validation is "shutting down"
26 * for this IDocument.
27 *
28 * @param document
29 */
30 void disconnect(IDocument document);
31
32 /**
33 * Like IValidator#validate(IValidationContext helper, IReporter reporter)
34 * except passes the dirty region, so document validation can be better
35 * optimized.
36 *
37 * @param dirtyRegion
38 * @param helper
39 * @param reporter
40 */
41 void validate(IRegion dirtyRegion, IValidationContext helper, IReporter reporter);
42}