Validator

org.eclipse.wst.validation.validator

This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

This extension point give the ability to create a new validator that can validate resources in a Java Project. The validator needs to registered for a given nature of the project for it to run on that project. The user can specifiy file filters to filter out files that need to be validated. The new validator registered by the project nature on the project can be run manually or incrementally if Auto Build is turned on, during incremental builds the changed delta of files are only validated if those files are part of the validation filters specified.

<!ELEMENT extension (validator)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #REQUIRED

name  CDATA #REQUIRED>


<!ELEMENT validator (projectNature* , filter* , enablement* , helper , dependentValidator? , run , markerId? , facet* , contentTypeBinding*)>

<!ATTLIST validator

to   CDATA #IMPLIED

from CDATA #IMPLIED>


<!ELEMENT projectNature EMPTY>

<!ATTLIST projectNature

id      CDATA #REQUIRED

include (true | false) >


<!ELEMENT contentTypeBinding EMPTY>

<!ATTLIST contentTypeBinding

contentTypeId CDATA #REQUIRED>

Associates a particular content type with the current validator, and enables the validator to be run on resources of the specified content type.



<!ELEMENT filter EMPTY>

<!ATTLIST filter

objectClass   CDATA #REQUIRED

nameFilter    CDATA #REQUIRED

caseSensitive (true | false)

action        CDATA #IMPLIED>


<!ELEMENT helper EMPTY>

<!ATTLIST helper

class CDATA #REQUIRED>


<!ELEMENT dependentValidator EMPTY>

<!ATTLIST dependentValidator

depValValue (true | false) >


<!ELEMENT run EMPTY>

<!ATTLIST run

class       CDATA #REQUIRED

incremental (true | false)

enabled     (true | false)

fullBuild   (true | false)

async       (true | false) >


<!ELEMENT markerId EMPTY>

<!ATTLIST markerId

markerIdValue CDATA #IMPLIED>

The markerId element is is used to get a custom problem marker for the custom validator implemented using this extension point This markerId element also needs a corresponding problemMarker extension to be defined bythis validator with the same Id as the makerIdValue for the validator to have its own marker type. Here is an example of the a problemMarker extension defined for a markerIdValue "FooMarker" Without a problemMarker extension defined, the customer validator will use the base Validation Message problemMarker type.



The facet element is deprecated

<!ELEMENT facet EMPTY>

<!ATTLIST facet

facetId CDATA #IMPLIED>

This element is deprecated and enablement is the new recommended approach to filter validators based on facets.