From: Ross G. <rgr...@sp...> - 2002-11-13 16:36:47
|
Thanks for checking out Arch4J. There is a start to the documentation effort on the Arch4J home page, http://arch4j.sourceforge.net <http://arch4j.sourceforge.net> and a component guide for the generator at http://arch4j.sourceforge.net/components/generator/index.html <http://arch4j.sourceforge.net/components/generator/index.html> Take a look at the method named testJavaSourceFile() in the GeneratorTest JUnit class. It is an example of how to paste together the various pieces, programmatically, of a Java file. The intention of the class is for developers to create their own template classes which define the structure of a destination Java class, defining the template with a JavaSourceFile and all of the other generator components. The specifics of generating an instance of a class through your template is then up to you. Your template could be a class with a main method, which takes specific arguments from the command line, such as the class name, etc. then use that to generate the class. We are currently working to improve the documentation and to come up with some better examples to show this "template" style of development. Stay tuned! A default constructor was intentionally left out of the definition of the JavaSourceFile class. This forces consumers to specify the sourcePath and the object definition when creating an instance of a JavaSourceFile. You can easily extend the class, as long as you declare a constructor that has the same signature. You are then free to add any other constructors you wish. If you make improvements to the code that others could benefit from, let me know and I'll work on integrating them in to the main source tree. Thanks, Ross Greinke -----Original Message----- From: kiran malla Hi, I am new to arc4j.. we intend to use code generator component.The component is good but there is no proper documentation availabe to implement the functionality except Java Apis . we have one doubt. some of the methods have been delcared as protected in JavaSourceFile class. this class is without a default constructor. Hence we are unable to extend it in our code. kindly suggest how we can use the methods.. we are mainly interested in the gatherimports method. Regards, Kiran Malla. |