3 Replies Latest reply on Apr 27, 2015 3:35 PM by George Gastaldi

    Creating a static nested class using Roaster API

    Neil Stevens Newbie



      I'm using Roaster API to generate some Java source files.  I would like my Java source files to contain a nested static class like:


      class A {

           static class B {}



      But I can't figure out how to get Roaster to generate this.  I can do the following to generate a non-static nested class:


      JavaClassSource aClass = Roaster.create(JavaClassSource.class);


      JavaClassSource bClass = Roaster.create(JavaClassSource.class);




      When adding a method to a class I can chain ".setStatic(true)" onto the addMethod method like:





      But I can't chain "setStatic(true)" this with a nested class.  Does any any one know how to do this or if it is possible with Roaster API?