org.eclipse.wst.validation.internal.provisional.core.IValidator
)
for as-you-type (source) validation.<!ELEMENT extension (validator)>
<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
name CDATA #IMPLIED>
<!ELEMENT validator (contentTypeIdentifier+)>
<!ATTLIST validator
id CDATA #IMPLIED
class CDATA #IMPLIED
scope CDATA #IMPLIED>
<!ELEMENT partitionType EMPTY>
<!ATTLIST partitionType
id CDATA #IMPLIED>
<!ELEMENT contentTypeIdentifier (partitionType*)>
<!ATTLIST contentTypeIdentifier
id CDATA #IMPLIED>
<extension point=
"org.eclipse.wst.sse.ui.extensions.sourcevalidation"
>
<validator scope=
"total"
class=
"org.eclipse.wst.validation.html.HTMLValidator"
id=
"org.eclipse.wst.validation.htmlsourcevalidator"
>
<contentTypeIdentifier id=
"org.eclipse.wst.html.core.htmlsource"
>
<partitionType id=
"org.eclipse.wst.html.HTML_DEFAULT"
/>
</contentTypeIdentifier>
<contentTypeIdentifier id=
"org.eclipse.jst.jsp.core.jspsource"
>
<partitionType id=
"org.eclipse.wst.html.HTML_DEFAULT"
/>
</contentTypeIdentifier>
</validator>
</extension>
Using ISourceValidator
If your validator can handle "partial document" validation, it should implement ISourceValidator.
The validate call on ISourceValidator gets passed an IRegion of the document which represents just the part that's dirty. This should be much more efficient than validating the entire file each time someone types.
ISourceValidator has its "connect(IDocument doc)" method called when it's hooked up to the document (when the editor is opened), and "disconnect(IDocument doc)" called when the editor is closed, where any "unhooking" should take place.
Copyright (c) 2005 IBM Corporation and others.
All rights reserved. This program and the accompanying materials are made
available under the terms of the Eclipse Public License v1.0 which accompanies
this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html