I don't like the code convention XDoclet uses for generating code. How can I change it?

Ara Abrahamian

XDoclet does not have any mechanism to apply a specified code convention, built-in. It's really out of the scope of this tool. All templates use a single coding convention, which might not be what you like. You can pipe the generated code to another tool for code beautification. Such a code beautifier which is sued in XDoclet's own development is PrettyPrinter module of jRefactory. It has an Ant task which smartly checks file timestamps and even has CVS modification check in it, and beautifies the files if the have been modified since last run. Here is an example of its use:

<target name="beautify" depends="prepare">

   <taskdef name="pretty" classname="org.acm.seguin.ant.Pretty" classpath="${basedir}/../lib/prettyprinter.jar"/>

   <pretty settingsDir="${basedir}/../config" cvs="true" compileDir="${build.dir}/classes">
      <fileset dir="${src.dir}">
         <include name="**/*.java" />
      </fileset>
   </pretty>

</target>
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact