Problem with V2 validation framework. [message #227126] |
Thu, 22 January 2009 22:32 |
Alexandros Salazar Messages: 15 Registered: July 2009 |
Junior Member |
|
|
Hi,
I'm trying use the V2 validation framework in order to make use of its
dependency handling abilities. I _think_ I have found a bug in how markers
are created, but I want to double check to see if maybe I misunderstood.
As allowed by the API, I use org.eclipse.wst.validation.ValidatorMessage
in the ValidationResult to let the framework handle the creation and
destruction of markers for me. I specify a marker ID in the extension
point as follows:
<extension
id="my.company.validation.module.dependency"
name="Dependency Carrying Module Validator"
point="org.eclipse.wst.validation.validatorV2">
<validator
build="true"
class="my.company.validation.ModuleDependencyCarryingValidator "
manual="true"
markerId="my.company.marker.module.dependency">
</validator>
</extension>
Now, when the time comes to create the message that I will return in my
implementation of AbstractValidator#validate, I use the following code:
ValidationResult result = new ValidationResult();
ValidatorMessage message = ValidatorMessage.create("Detected error.",
errorFile);
message.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
result.setDependsOn(dependsOnResources.toArray(new
IResource[resources.size()]));
result.add(message);
return result;
This behaves as follows: upon clean build, the error is properly detected.
If I modify the files that the validator depends so as to remove the
error, the validator is duly called. However, the marker from the previous
validation is never removed.
I tracked down the reason for this to the fact that the type of the marker
is always the same, and markers are searched for according to their type
by Eclipse, not their ID, which is what the extension point provides.
Does anyone know if I misunderstood the purpose of the marker ID, or if I
should file a bug with bugzilla? Thanks!
|
|
|
Re: Problem with V2 validation framework. [message #229576 is a reply to message #227126] |
Wed, 25 March 2009 17:50 |
|
Alexandros Salazar wrote:
> Does anyone know if I misunderstood the purpose of the marker ID, or if
> I should file a bug with bugzilla? Thanks!
Does the extension declaring your validator also mention which
marker type it should be using? It does sound like it's worth
opening a bug report, though.
--
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
Powered by
FUDForum. Page generated in 0.23678 seconds