I found several similar questions here, but the incomplete answers did not help and did not cause more confusion than clarifying anything, so here I will try to give a more structured question and get reliable answers that will help more users.
My simplified example : I have a Java class with two different constructors
public class ObjectOfInterest {
public ObjectOfInterest(String string, Integer int) { ... }
public ObjectOfInterest(String string1, String string2) { ... }
...
}
I need some compilation checking time when calling these constructors. The parameter string2should be laconic, and I want to mark calls as a warning depending on the content (i.e. give a warning if it is not a literal or when the literal has the wrong format).
Unfortunately, the documentation for validation in Java with Eclipse is not so easy to understand, sometimes outdated, most often it seems incomplete, and it seems that there is no working example short enough for use in the tutorial.
My goal : First step: I would like to have a validator that marks calls to this version of the parameters with a warning - just to start somewhere and understand the basics.
What I have found so far : A few examples that I have seen are public class MyValidator implements IValidator, ISourceValidatorwhere IValidatorit is necessary to implement the method public void validate(IValidationContext arg0, IReporter arg1) throws ValidationExceptionand, it seems, from the old version of the verification framework (sometimes I found only an empty method with comment useless) and ISourceValidatorit is necessary to implement the method public void validate(IRegion arg0, IValidationContext arg1, IReporter arg2)- this, by Apparently a more modern version.
plugin.xml ( , plugin.xml).
: , IRegion, IValidationContext IReporter - , , ? ?
, . Outlook, String- - , , , .