3 Replies Latest reply on Sep 6, 2004 10:04 AM by chiba

    Creating interfaces

      Hi all. Actually I have two questions :
      1) How do I create interfaces ?
      I can call pool.makeInterface("SomeInterface");
      but I can't add method on it. Javassist seems to required a method body.

      2) How do I make Javassist use a defined class loader to create my class/interface when I call CtClass.toClass() ??

        • 1. Re: Creating interfaces
          chiba

           


          1) How do I create interfaces ?
          I can call pool.makeInterface("SomeInterface");
          but I can't add method on it. Javassist seems to required a method body.


          You can use a constructor of CtMethod or CtNewMethod#abstractMethod()
          for creating an interface method.


          2) How do I make Javassist use a defined class loader to create my class/interface when I call CtClass.toClass() ??


          Use CtClass#toClass(ClassLoader), which receives a class loader as
          a parameter.

          • 2. Re: Creating interfaces

            I guess this is onlu on cvs right ?
            I'm using javassist-3.0beta2.
            ok. I'll co javassist from cvs. thanks !

            • 3. Re: Creating interfaces
              chiba

              Ah, yes. I must release RC1 very soon...