title: Is there a possibility to hide the "@type" entry when marshalling subclasses to JSON using EclipseLink MOXy (JAXB)?
body: <p>I'm about to develop a JAX-RS based RESTful web service and I use MOXy (JAXB) in order to automatically generate my web service's JSON responses.</p>
  
  <p>Everything is cool, but due to the fact that the web service will be the back-end of a JavaScript-based web application and therefore publicly accessible I don't want to expose certain details like class names, etc.</p>
  
  <p>But, I've realized that under certain conditions MOXy embeds a "@type" entry into the marshalled string and this entry is followed by the class name of the object that has just been marshalled.</p>
  
  <p>In particular, I've realized that MOXy behaves in this way when marshalling instances of extended classes.</p>
  
  <p>Assume the following super class "MyBasicResponse"</p>
  
  <pre><code>@XmlRootElement(name="res")
  
  public class MyBasicResponse {
  
  @XmlElement
  private String msg;
  
  public MyBasicResponse() {
      // Just for conformity
  }
  
  public String getMsg() {
      return msg;
  }
  
  public void setMsg(String msg) {
      this.msg = msg;
  }
  }
  </code></pre>
  
  <p>And this specialized (extended) class "MySpecialResponse"</p>
  
  <pre><code>@XmlRootElement(name="res")
  
  public class MySpecialResponse extends MyBasicResponse {
  
  @XmlElement
  private String moreInfo;
  
  public MySpecialResponse() {
      // Just for conformity
  }
  
  public String getMoreInfo() {
      return moreInfo;
  }
  
  public void setMoreInfo(String moreInfo) {
      this.moreInfo = moreInfo;
  }
  }
  </code></pre>
  
  <p>So, the MyBasicResponse object's marshalled string is</p>
  
  <pre><code>{"msg":"A Message."}
  </code></pre>
  
  <p>(That's okay!)</p>
  
  <p>But, the MySpecialResponse object's marshalled string is like</p>
  
  <pre><code>{"@type":"MySpecialResponse","msg":"A Message.","moreInfo":"More Information."}
  </code></pre>
  
  <p>Is there a way to strip the</p>
  
  <pre><code>"@type":"MySpecialResponse"
  </code></pre>
  
  <p>out of my response?</p>