1

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 ?

1
  • am working on eclipse and when i writed a method with while and if else My team leader reviewed it and commented saying this is c++ or c style and did not explain further i read sourceformat.com/coding-standard-java.htm and i cant see the problem although i used ctrl+alt+f in eclipse can some one guide me thanks !? Commented Mar 29, 2015 at 10:24

3 Answers 3

6

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

Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

0

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).

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.