srinannapa
srinannapa

Reputation: 3207

Java files code formatting Standards

What are the available tools or eclipse plugins to format my .java source / .XML / .XSL / .properties. I would like to know the difference between each of these tools, it helps me to identify the best tool/plugin.

Moreover , How to find the best standards for formatting java code ?

Upvotes: 1

Views: 854

Answers (3)

Edwin Buck
Edwin Buck

Reputation: 70959

You can always use checkstyle.

Checkstyle is configurable, and it will verify that your Java source code fits with a number of configurable style choices.

As far as .properties files, there's really only one style. If it is not in that style, it's not a parsable .properties file.

For XML, the standard allows for several styles. By styles, I mean indenting, etc. XML is very structured (as determined by the corresponding XSL file) so there's little that can change except the amount of ignorable whitespace between tags and elements. As far as I know, there's not a XML "style checker", because there's so few options to select form with XML.

The same goes for XSL, which is a XML file (purposed for templeting XML files).

Upvotes: 0

Alain Pannetier
Alain Pannetier

Reputation: 9514

Most editors have a standard auto formatting capability usually accessible through CTRL+SHIFT+F. In addition a large number of them have styles which you can tailor to your own taste in the applicable preferences section.

Upvotes: 0

Jim Garrison
Jim Garrison

Reputation: 86774

Eclipse comes with a powerful builtin code formatter that can be customized in great detail. Look in the Preferences menu.

Upvotes: 6

Related Questions