title: MapStruct : enrich mapping annotation to define custom mapper
body: <p>Here is my context: I am using byteBuddy to dynamically generate a class that transform an object into another one based on a external configuration. I encountered some issues and I wanted to find an alternative that's how I discovered MapStruct.</p>
  
  <p>So I tried to build simple mapper and I wanted to know if there is the possibility to customize the annotation to add transformation functions. For instance I would like to have:</p>
  
  <pre><code>@Mapping(
      source = "mySourceField", 
      sourceType = "String",
      target = "myTargetField",
      targetType = "Integer",
      transformation = {"toInteger", "toSquare"}
  ),
  </code></pre>
  
  <p>And on the mapper implementation  I would have something like :</p>
  
  <pre><code> public TypeDest toSiteCatTag(TypeSrc obj) {
  
      if ( obj == null ) {
  
          return null;
      }
  
      TypeDest objDest = new TypeDest();
  
      objDest.myTargetField = Formatter.toSquare(
          Formatter.toInteger(obj.mySourceField));
  
      return objDest;
  }
  </code></pre>
  
  <p>If someone can help me to achieve that I would be grateful and it would save me a lot of time.</p>
  
  <p>Thanks in advance.</p>