Jalopy is a source code formatter for Java. It automates and enforces all aspects of source code layout—to meet a certain coding style without putting any burden on individual developers.
General
Supports all flavors of Java up to Java SE 6.0. The compliance level is configurable Graphical configuration dialog to customize the settings with live-preview and online help. Jalopy provides more than 500 options to let you exactly achieve the style you like
Settings profiles which support automatic switching between different configuration in IDE's
Nested profiles to easily create similar conventions that share common elements and automatically adapt
Distributed settings support. It is easily possible to share code conventions across multiple developers/teams
Configurable logging output that might be written to disk (Plain Text, XML and HTML)
Several IDE Plug-ins that provide seamless integration with popular Java applications (current set includes Ant, Eclipse and derived products like the IBM Rational product line, IntelliJ IDEA, JBuilder, JDeveloper, jEdit, Maven and NetBeans/Sun ONE Studio)
Apply formatting automatically whenever a dirty file is saved
Limit formatting to Javadoc comments only
Command-line interface that can used to run the formatter standalone or for integration into other software
Integrated history to avoid unnecessary formatting—decrease execution time and limit spurious check-ins
Multi-processor support to speed up processing on capable systems
Code Sorting
Sort declarations. Sorting may be limited to the different declaration types only or happen within all elements of a type as well. The sorting criteria is fully configurable
Sort modifiers in your preferred order
Insert separation comments between code sections upon sorting. Their style is configurable to match your preference
Header/Footer
Ensure headers and/or footers are present in every source file. Headers and footers may get inserted on each run, but existing SCM tags can still be kept to ensure that files are not unnecessarily modified during formatting
Braces
Brace styles. Jalopy provides several pre-configured brace styles (C, Sun, GNU), but the handling of braces is fully user-configurable
Auto-insertion of braces. Missing braces might be inserted for if/else, for, while, do/while and switch statements
Auto-removal of braces. Obsolete braces might be removed for if/else, for, while, do/while statements and arbitrary blocks
Compact braces to use less vertical space when possible. Configurable for different brace statements
Special empty braces handling
Comment insertion after closing braces to identify matching braces. Configurable for the different brace statements and with line threshold
Javadoc
Unique Javadoc formatting capabilities. Formatting provides configurable wrapping behavior, tag sorting, tag aligning, tag grouping. XDoclet tags are fully supported. HTML tags can be indented and valid HTML optionally enforced
Auto-generation of missing Javadoc comments. Insertion is selectively configurable for the different declaration types and access levels. Templates are provided to configure generation output (with variable interpolation). Getter/Setter methods may be treated specially
Auto-correction to ensure validity. Insertion of missing tags, removal of invalid/obsolete tags. Correction of misspelled tag names
Imports
Sort import declarations. The order is fully configurable. Additionally, imports may be grouped together and static imports may be grouped separately
Optimize imports. Remove obsolete or duplicate imports and expand on-demand imports or collapse single-type imports
Miscellaneous
Special pragma comments to control formatting on the source level (e.g. to prohibit formatting for certain pieces of code)
Auto-insertion of parentheses around expressions to make operator precedence obvious
Auto-insertion of a missing @Override annotations
Auto-insertion of a serial version UID for serializable classes
Removal of redundant modifiers to enforce concise
Numbered backups for the paranoid
Line Wrapping
Automatic line wrapping with configurable line length
Configurable placement of operators
Keep existing line breaks for list parameters, call arguments, operators and array elements
Force wrapping for certain elements to ensure a certain style under all conditions
Indicate your wrapping preference for elements that exceed the maximal line length
Avoid wrapping for certain elements under all conditions
White Space
Extremely configurable white space behavior for all code elements like operators, parentheses, braces and brackets
Indentation
Several indentation strategies. Whether you prefer a dense layout or favor the more excessive use of white space to enhance readability—Jalopy has you covered
Powerful alignment capabilities to nicely lay out variables and identifiers, method calls, parentheses and comments
Continuation indentation for expressions within blocks or all operators to increase the indentation level upon wrapping in order to let the element stand out
Control what elements should be indented
Configurable tab handling. Use tabs for all indentation or only up to the current brace level
Blank Lines
Control the number of blank lines before and after code elements
Keep blank lines up to a given limit or ignore them altogether
Configurable chunk handling to control what statements should be treated as code sections
Comments
Format comments to ensure a specific style
Wrap comments to keep between in between the maximal line length limit. Wrapping may be performed for individual lines only or on the comment as a whole
Remove comments matching certain criteria—either a specific type or regular expression
Code Inspector
Perform code checking either during formatting or standalone to find certain code weaknesses and ensure good coding practise
Ensure custom naming conventions configurable via regular expressions
Hardware
Jalopy will run on any Pentium-class machine with a minimum of 256 MB RAM. You may succeed with less, but it's not really recommended for a good user experience.
Depending on your options, you need between 10-20 MB free disk space for the installation files. During runtime, additional space is required for settings, caches and backup, typically between 5-50 MB, but this again depends on your project size and setup.
Operating System
The supported operating systems are: Linux, Mac OS X (x86 only), Solaris, Unix, Windows XP or later.
Jalopy should run on all platforms that provide a suitable Java VM. If you can get Jalopy running on an unsupported operating system, we will still try to help in case of problems, but may ultimately ask you to move to a supported platform in order to be able to provide extensive support.
Java
Jalopy requires a properly configured, compliant Java JDK version 1.4 or later on your system. We recommend to use a version 5.0 or later JDK
Jalopy has been deployed and is known to work with all major VM implementations from vendors like Oracle, IBM and Apple