title: Compile time validation of method arguments
body: <p>I've found some similar questions here, but the incomplete answers didn't help and produced more confusion than clarifying anything, so here's my try to give a more structured question and get hopefully answers that will help more users.</p>
  
  <p><strong>My simplified example</strong>: I have a Java class with two different constructors</p>
  
  <pre><code>public class ObjectOfInterest {
    public ObjectOfInterest(String string, Integer int) { ... }
    public ObjectOfInterest(String string1, String string2) { ... }
    ...
  }
  </code></pre>
  
  <p>I need some compile time validation on the calls of these constructors. The parameter <code>string2</code> has to be some literal, and I want to mark the calls as warning depending on the content (i.e. give a warning, when it's no literal or when the literal has not the correct format).</p>
  
  <p>Unfortunately documentation for validation in Java with Eclipse isn't easy to understand, sometimes outdated, most often it seems to me incomplete, and it seems that there's no working example out there that's short enough to be used in a tutorial.</p>
  
  <p><strong>My goal</strong>:
  First step: I'd like to have a validator that marks calls of that two parameter version with a warning - just to get started somewhere and get to understand the basics.</p>
  
  <p><strong>What I've found so far</strong>:
  The few examples I've seen make a <code>public class MyValidator implements IValidator, ISourceValidator</code> where <code>IValidator</code> needs to implement a method <code>public void validate(IValidationContext arg0, IReporter arg1) throws ValidationException</code> and seem to be from an old version of the validation framework (sometimes I found just empty method with comment <em>useless</em>), and <code>ISourceValidator</code> needs to implement a method <code>public void validate(IRegion arg0, IValidationContext arg1, IReporter arg2)</code> - this seems to be the more up to date version.</p>
  
  <p>Then you have to add some extension points to some <code>plugin.xml</code> (I'm not totally clear where this plugin.xml is).</p>
  
  <p><strong>Where I stab in the dark</strong>: it's totally unclear how to work with <code>IRegion</code>, <code>IValidationContext</code>, and <code>IReporter</code> - maybe I'm on the totally wrong way, but what do I get here? How to find calls of that constructor within validation?</p>
  
  <p>I'd extend this question after the first steps get more clear. Outlook, I'll want to add the possibility of quick fixes to the two String version of the constructor and manipulate the code this way - but that's at least two steps ahead, details coming later.</p>