batch code formatters for Java files

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

batch code formatters for Java files

Leon Torres-2
Hi folks,

I tried using astyle (http://astyle.sf.net) to clean up a Java contribution
recently and it doesn't seem to be comprehensive enough to be used in general.

Does anyone know of a good code formatter or if an official ofbiz Java style
already exists for some program?  I'd like to avoid using Eclipse, unless it can
batch format, save the originals, and show you the diff easily.

The goals are relatively simple, we want the code to conform to an "ofbiz"
style.  Briefly,

public static void method() {
     if (something) {
        doSomething;
     } else {
        doSomethingElse;
     }
}

Where there are 4 spaces per indentation level (no tabs).  Since ofbiz Java can
be quite verbose, we don't want to force a standard column width such as 80.
Control over padding of parentheses is also good, but the above should be
sufficient.

- Leon
Reply | Threaded
Open this post in threaded view
|

Re: batch code formatters for Java files

Fred Forester-2


I have used this one a few times.

http://www.javaregex.com/download.html

jbeautfull.jar

Fred


Leon Torres wrote:

> Hi folks,
>
> I tried using astyle (http://astyle.sf.net) to clean up a Java
> contribution recently and it doesn't seem to be comprehensive enough to
> be used in general.
>
> Does anyone know of a good code formatter or if an official ofbiz Java
> style already exists for some program?  I'd like to avoid using Eclipse,
> unless it can batch format, save the originals, and show you the diff
> easily.
>
> The goals are relatively simple, we want the code to conform to an
> "ofbiz" style.  Briefly,
>
> public static void method() {
>     if (something) {
>        doSomething;
>     } else {
>        doSomethingElse;
>     }
> }
>
> Where there are 4 spaces per indentation level (no tabs).  Since ofbiz
> Java can be quite verbose, we don't want to force a standard column
> width such as 80. Control over padding of parentheses is also good, but
> the above should be sufficient.
>
> - Leon
>
>