blob: 91bf709ea5fd74ef28d8619b08d267b1c650852d [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Validator V2</title>
<style type="text/css">@import url("../../book.css");</style>
<style type="text/css">@import url("../../schema.css");</style>
</HEAD>
<BODY>
<H1 style="text-align:center">Validator V2</H1>
<p></p>
<h6 class="CaptionFigColumn SchemaHeader">Identifier: </h6>org.eclipse.wst.validation.validator-v2<p></p>
<h6 class="CaptionFigColumn SchemaHeader">Since: </h6>WebTools 3.4.
<p></p>
<h6 class="CaptionFigColumn SchemaHeader">Description: </h6>This is used to register a validator to the validation framework (version 2). In addition to specifying the validator to invoke, it registers a set of default filter rules, to control which resources are passsed to the validator.<p></p>
<h6 class="CaptionFigColumn SchemaHeader">Configuration Markup:</h6>
<p></p>
<p class="code SchemaDtd">&lt;!ELEMENT <a name="e.extension">extension</a> (<a href="#e.validator">validator</a>)&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST extension</p>
<p class="code SchemaDtdAttlist">point&nbsp;CDATA #REQUIRED<p class="code SchemaDtdAttlist">id&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED<p class="code SchemaDtdAttlist">name&nbsp;&nbsp;CDATA #REQUIRED&gt;</p>
<p></p>
<ul class="ConfigMarkupAttlistDesc">
<li><b>id</b> - A short id that is unique within the plug-in, so that this validator can be identified.</li>
<li><b>name</b> - The short user friendly name of the validator.</li>
</ul>
<br><p class="code SchemaDtd">&lt;!ELEMENT <a name="e.validator">validator</a> (<a href="#e.include">include</a>* , <a href="#e.exclude">exclude</a>? , <a href="#e.messageCategory">messageCategory</a>* , <a href="#e.group">group</a>*)&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST validator</p>
<p class="code SchemaDtdAttlist">class&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED<p class="code SchemaDtdAttlist">build&nbsp;&nbsp;&nbsp;&nbsp;(true | false) <p class="code SchemaDtdAttlist">manual&nbsp;&nbsp;&nbsp;(true | false) <p class="code SchemaDtdAttlist">version&nbsp;&nbsp;CDATA #IMPLIED<p class="code SchemaDtdAttlist">sourceid&nbsp;CDATA #IMPLIED<p class="code SchemaDtdAttlist">markerId&nbsp;CDATA #IMPLIED&gt;</p>
<p></p>
<p class="ConfigMarkupElementDesc">
Defines a validator to the validation framework.</p>
<br>
<ul class="ConfigMarkupAttlistDesc">
<li><b>class</b> - The class that implements the validator.</li>
<li><b>build</b> - Is this validator enabled by default for build based validations? The default is true.</li>
<li><b>manual</b> - Is this validator enabled by default for manual based validations? The default is true.</li>
<li><b>version</b> - The version of the definition. It is a simple integer. If not specified the version is assumed to be 1.</li>
<li><b>sourceid</b> - If this validator also serves as an as-you-type validator (also know as an ISourceValidator) then it's source id is specified here, so that the two validators can be associated with one another.
By source id, we mean the id that is used in the org.eclipse.wst.sse.ui.sourceValidation extension point</li>
<li><b>markerId</b> - If your validator wishes to use it's own marker, it can do so by supplying that marker id here.</li>
</ul>
<br><p class="code SchemaDtd">&lt;!ELEMENT <a name="e.include">include</a> (<a href="#e.rules">rules</a>)&gt;</p>
<p></p>
<p class="ConfigMarkupElementDesc">
This contains a set of inclusion rules, which are used in filtering which resources get validated. At least one of these rules must be satisfied in order for the validator to be called on the particular resource.</p>
<br><br>
<p class="code SchemaDtd">&lt;!ELEMENT <a name="e.exclude">exclude</a> (<a href="#e.rules">rules</a>)&gt;</p>
<p></p>
<p class="ConfigMarkupElementDesc">
This contains a set of exclusion rules, used in filtering which resources get validated. If any of these rules are matched, then the validator is not called on this resource.</p>
<br><br>
<p class="code SchemaDtd">&lt;!ELEMENT <a name="e.fileext">fileext</a> EMPTY&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST fileext</p>
<p class="code SchemaDtdAttlist">ext&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED<p class="code SchemaDtdAttlist">caseSensitive&nbsp;(true | false) &gt;</p>
<p></p>
<p class="ConfigMarkupElementDesc">
A file extension, for example html.</p>
<br>
<ul class="ConfigMarkupAttlistDesc">
<li><b>ext</b> - The file extension, for example html.</li>
<li><b>caseSensitive</b> - If the file extension is case sensitive, then this needs to be set to true.</li>
</ul>
<br><p class="code SchemaDtd">&lt;!ELEMENT <a name="e.projectNature">projectNature</a> EMPTY&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST projectNature</p>
<p class="code SchemaDtdAttlist">id&nbsp;CDATA #REQUIRED&gt;</p>
<p></p>
<p class="ConfigMarkupElementDesc">
Used to filter on project natures.</p>
<br>
<ul class="ConfigMarkupAttlistDesc">
<li><b>id</b> - The fully qualified project nature id, for example "org.eclipse.jdt.core.javanature".</li>
</ul>
<br><p class="code SchemaDtd">&lt;!ELEMENT <a name="e.file">file</a> EMPTY&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST file</p>
<p class="code SchemaDtdAttlist">name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED<p class="code SchemaDtdAttlist">caseSensitive&nbsp;(true | false) <p class="code SchemaDtdAttlist">type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(folder|file|full) &gt;</p>
<p></p>
<ul class="ConfigMarkupAttlistDesc">
<li><b>name</b> - The file or folder name. The file name can be fully qualified, that is it starts with a leading slash ("/"), or it can be a relative name. Folder names are separated with the forward slash ("/") character.</li>
<li><b>caseSensitive</b> - If the file name is not case senstitive, then this needs to be set to false.</li>
<li><b>type</b> - Type of name, there are three choices. <ul><li>folder - specifies a project relative folder name.</li><li>file - a simple file name (i.e. no path information).</li><li>full - a fully qualified (project relative) file name.</li></ul></li>
</ul>
<br><p class="code SchemaDtd">&lt;!ELEMENT <a name="e.rules">rules</a> (<a href="#e.fileext">fileext</a>* , <a href="#e.file">file</a>* , <a href="#e.projectNature">projectNature</a>* , <a href="#e.facet">facet</a>* , <a href="#e.contentType">contentType</a>*)&gt;</p>
<p></p>
<p class="ConfigMarkupElementDesc">
A set of rules for determining if a resource is passed to this validator or not. The rules are OR'ed together.</p>
<br><br>
<p class="code SchemaDtd">&lt;!ELEMENT <a name="e.facet">facet</a> EMPTY&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST facet</p>
<p class="code SchemaDtdAttlist">id&nbsp;CDATA #REQUIRED&gt;</p>
<p></p>
<ul class="ConfigMarkupAttlistDesc">
<li><b>id</b> - The facet id.</li>
</ul>
<br><p class="code SchemaDtd">&lt;!ELEMENT <a name="e.group">group</a> EMPTY&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST group</p>
<p class="code SchemaDtdAttlist">id&nbsp;IDREF #REQUIRED&gt;</p>
<p></p>
<p class="ConfigMarkupElementDesc">
Declares that this validator belongs to this validation group.</p>
<br>
<ul class="ConfigMarkupAttlistDesc">
<li><b>id</b> - The fully qualified ID of the validation group to which this validator belongs.</li>
</ul>
<br><p class="code SchemaDtd">&lt;!ELEMENT <a name="e.contentType">contentType</a> EMPTY&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST contentType</p>
<p class="code SchemaDtdAttlist">id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED<p class="code SchemaDtdAttlist">exactMatch&nbsp;(true | false) &gt;</p>
<p></p>
<p class="ConfigMarkupElementDesc">
Used to filter based on content types.</p>
<br>
<ul class="ConfigMarkupAttlistDesc">
<li><b>id</b> - The content type id.</li>
<li><b>exactMatch</b> - Set to true if the content type needs to match exactly. Set to false if sub types are considered matches as well.</li>
</ul>
<br><p class="code SchemaDtd">&lt;!ELEMENT <a name="e.messageCategory">messageCategory</a> EMPTY&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST messageCategory</p>
<p class="code SchemaDtdAttlist">id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED<p class="code SchemaDtdAttlist">label&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED<p class="code SchemaDtdAttlist">severity&nbsp;(error|warning|ignore) &gt;</p>
<p></p>
<p class="ConfigMarkupElementDesc">
Used to group together a set of messages, where the user can change the message severity of all the messages in the group. This is similar to the support in the JDT, where for example a user can specify whether used methods should be errors, warnings or ignored.</p>
<br>
<ul class="ConfigMarkupAttlistDesc">
<li><b>id</b> - A simple id that is unique within the scope of this validator.</li>
<li><b>label</b> - A short, one line label that is displayed to the end user, that describes the message category.</li>
<li><b>severity</b> - The default severity for this category.</li>
</ul>
<br><h6 class="CaptionFigColumn SchemaHeader">Examples: </h6>An example of a validator that will be called on resources that have html or htm file extensions.
<pre class="Example"><span class="code SchemaTag">
&lt;extension
point=</span><span class="code SchemaCstring">&quot;org.eclipse.wst.validation.validator&quot;</span><span class="code SchemaTag">
id=</span><span class="code SchemaCstring">&quot;Test&quot;</span><span class="code SchemaTag"> name=</span><span class="code SchemaCstring">&quot;%Validator.Name&quot;</span><span class="code SchemaTag">&gt;
&lt;validator class=</span><span class="code SchemaCstring">&quot;org.eclipse.wst.validation.test.TestValidator&quot;</span><span class="code SchemaTag">&gt;
&lt;include&gt;
&lt;rules&gt;
&lt;fileext ext=</span><span class="code SchemaCstring">&quot;html&quot;</span><span class="code SchemaTag">/&gt;
&lt;fileext ext=</span><span class="code SchemaCstring">&quot;htm&quot;</span><span class="code SchemaTag">/&gt;
&lt;/rules&gt;
&lt;/include&gt;
&lt;/validator&gt;
&lt;/extension&gt;
</span></pre>
<p></p>
<br>
<p class="note SchemaCopyright">
Copyright (c) 2007,2008 IBM Corporation and others.<br>
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 <a
href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
</p>
</BODY>
</HTML>