blob: 8096d0a337c6776ecb762d9ea58771da111c6dbe [file] [log] [blame]
<html>
<head>
<title>Validation Framework - Frequently Asked Questions</title>
</head>
<body>
<h1>Validation Framework - Frequently Asked Questions</h1>
<h3>How do I create Problem Markers?</h3>
<p>There are three different ways to create problem markers.</p>
<ol>
<li>Use the native support in the validation framework.</li>
<li>Manage your own markers.</li>
<li>Use the support in the previous version of the validation framework.</li>
</ol>
<p>The first approach, is the recommended approach.</p>
<h4>1. Use the native support in the validation framework</h4>
<p>After you have finished performing your validation, and are returning control back to
the validation framework, add your messages into the
<a href="../ValidationResult.html">ValidationResult</a> by using
the <a href="../ValidationResult.html#add(org.eclipse.wst.validation.ValidatorMessage)">add(ValidatorMessage message)</a> method.
<h4>2. Manage your own markers</h4>
<p>Create and remove your own markers. So that summary information can still be displayed, set the counts of any newly
created markers in the <a href="../ValidationResult.html">ValidationResult</a> by using the setSeverityXXX() methods.
For example, if this validation pass generated two error markers, you would call
<a href="../ValidationResult.html#setSeverityError(int)">setSeverityError(2)</a>.
</p>
<h4>3. Use the support in the previous version of the validation framework</h4>
<p>If you are porting a validator that used the previous version of the validation framework, and you wish to continue to use an
<A HREF="../../../../../org/eclipse/wst/validation/internal/provisional/core/IReporter.html">IReporter</a> to
report your markers, you can continue to do so.</p>
<p>For this approach, use the
<a href="../ValidationResult.html#getReporter(IProgressMonitor)">getReporter(IProgressMonitor&nbsp;monitor)</a> 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.
</body>
</html>