title: How to implement one interface contains generics through javassist
body: <p>I want to generate a dynamic class to do something, such as:</p>
  
  <pre class="lang-java prettyprint-override"><code>/**
   * Type Converter.
   *
   * @author sunhao(sunhao.java@gmail.com)
   * @version V1.0
   * @createTime 2015-2-9 22:07
   */
  public interface StringParse&lt;V&gt; {
      /**
       * Convert
       *
       * @param str data to Convert
       * @return
       */
      public V parse(String str);
  }
  </code></pre>
  
  <p>Now I want to generate a dynamic bean. As we all see, this interface need a generics, like the following code:</p>
  
  <pre class="lang-java prettyprint-override"><code>CtClass ctClass = cp.makeClass("message.utils.StringParse$" + System.currentTimeMillis());
  //create a interface that contain a generics like given type *dest*
  CtClass ctInterface = cp.makeInterface("message.utils.StringParse&lt;" + dest.getName() + "&gt;");
  ctClass.addInterface(ctInterface);
  </code></pre>
  
  <p>But when executed, the above code gave an exception:</p>
  
  <pre class="lang-java prettyprint-override"><code>javassist.CannotCompileException: by java.lang.NoClassDefFoundError: message/utils/StringParse&lt;java/lang/Integer&gt;
  </code></pre>
  
  <p>I think that javassist may not support generating generics. Am I right, or can someone give me some suggestions?</p>