Validator V2

Identifier:
org.eclipse.wst.validation.validator-v2

Since:
WebTools 3.0.

Description:
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.

Configuration Markup:

<!ELEMENT extension (validator)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #REQUIRED

name  CDATA #REQUIRED>


<!ELEMENT validator (include* , exclude? , messageCategory* , group*)>

<!ATTLIST validator

class    CDATA #REQUIRED

build    (true | false)

manual   (true | false)

version  CDATA #IMPLIED

sourceid CDATA #IMPLIED

markerId CDATA #IMPLIED>

Defines a validator to the validation framework.



<!ELEMENT include (rules)>

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.



<!ELEMENT exclude (rules)>

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.



<!ELEMENT fileext EMPTY>

<!ATTLIST fileext

ext           CDATA #REQUIRED

caseSensitive (true | false) >

A file extension, for example html.



<!ELEMENT projectNature EMPTY>

<!ATTLIST projectNature

id CDATA #REQUIRED>

Used to filter on project natures.



<!ELEMENT file EMPTY>

<!ATTLIST file

name          CDATA #REQUIRED

caseSensitive (true | false)

type          (folder|file|full) >


<!ELEMENT rules (fileext* , file* , projectNature* , facet* , contentType* , pattern*)>

A set of rules for determining if a resource is passed to this validator or not. The rules are OR'ed together.



<!ELEMENT facet EMPTY>

<!ATTLIST facet

id      CDATA #REQUIRED

version CDATA #IMPLIED>


<!ELEMENT group EMPTY>

<!ATTLIST group

id IDREF #REQUIRED>

Declares that this validator belongs to this validation group.



<!ELEMENT contentType EMPTY>

<!ATTLIST contentType

id         CDATA #REQUIRED

exactMatch (true | false) >

Used to filter based on content types.



<!ELEMENT messageCategory EMPTY>

<!ATTLIST messageCategory

id       CDATA #REQUIRED

label    CDATA #REQUIRED

severity (error|warning|ignore) >

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.



<!ELEMENT pattern EMPTY>

<!ATTLIST pattern

regex         CDATA #REQUIRED

caseSensitive (true | false) >

Holds a regualr expression, that matches the resource's project relative name.



Examples:
An example of a validator that will be called on resources that have html or htm file extensions.

   <extension
         point="org.eclipse.wst.validation.validator"
         id="Test" name="%Validator.Name">
      <validator class="org.eclipse.wst.validation.test.TestValidator">
         <include>
            <rules>
               <fileext ext="html"/>
               <fileext ext="htm"/>
            </rules>
         </include>
      </validator>
   </extension>


Copyright (c) 2007,2008 IBM Corporation and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 which accompanies this distribution, and is available at https://www.eclipse.org/legal/epl-2.0/