org.eclipse.wst.validation.doc-files.faq.html Maven / Gradle / Ivy
Validation Framework - Frequently Asked Questions
Validation Framework - Frequently Asked Questions
How do I create Problem Markers?
There are three different ways to create problem markers.
- Use the native support in the validation framework.
- Manage your own markers.
- Use the support in the previous version of the validation framework.
The first approach, is the recommended approach.
1. Use the native support in the validation framework
After you have finished performing your validation, and are returning control back to
the validation framework, add your messages into the
ValidationResult by using
the add(ValidatorMessage message) method.
2. Manage your own markers
Create and remove your own markers. So that summary information can still be displayed, set the counts of any newly
created markers in the ValidationResult by using the setSeverityXXX() methods.
For example, if this validation pass generated two error markers, you would call
setSeverityError(2).
3. Use the support in the previous version of the validation framework
If you are porting a validator that used the previous version of the validation framework, and you wish to continue to use an
IReporter to
report your markers, you can continue to do so.
For this approach, use the
getReporter(IProgressMonitor monitor) method,
and return your messages through the IReporter. If this method is called it is assumed by the framework,
that this IReporter will be used as the only way of passing messages back to the framework.