title: Adding behaviour to JAXB generated class
body: <p>I have to add little bussiness logic in my jaxb generated classes. For example, I have following XMLs:</p>
  
  <pre><code>&lt;vehicle&gt;
   &lt;car id="20" make="ABC"/&gt;
  &lt;/vehicle&gt;
  
  &lt;vehicle&gt;
   &lt;motorcycle id="05" make="XYZ"/&gt;
  &lt;vehicle&gt;
  
  &lt;vehicle&gt;
   &lt;truck id="34"  make="UVW"/&gt;
  &lt;/vehicle&gt;
  </code></pre>
  
  <p>And I generate XSD for these.</p>
  
  <p>Now what I have to achieve is during unmarshalling of any XML of these type (that is whenever setters of car, motorcycle or truck is envoked, it should also set the vehicle type which I don't want to add as an attribute in the XML).</p>
  
  <p>Or after unmarshalling (any way by which I can know the QName of sub element).
  I have tried <a href="https://stackoverflow.com/questions/780567/how-can-i-extend-java-code-generated-by-jaxb-cxf-or-hibernate-tools">How can I extend Java code generated by JAXP-cxf or Hibernate tools?</a>, but the overriden setters were never called.</p>