[Skip to content]

Feature Highlights

Jalopy is packed with features. It does not stop with mere code formatting, but Jalopy actively helps you maintain your Javadoc, comply with naming conventions, insert @Override annotations, serial Version UIDs, optimize import declarations... you name it.

And best of it all, it seamlessly integrates into all major Java IDE applications and build tools.

General

Supports all flavors of Java including J2SE 5.0. The compliance level is configurable

Graphical configuration dialog to customize the settings with live-preview and online help. Jalopy provides over 450 options to let you exactly achieve the style you like

Brace settings

Settings profiles which support automatic switching between different configuration in IDE's

Nested profiles to easily create similiar 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/WSAD/RAD, IDEA, JBuilder, JDeveloper, jEdit, Maven and NetBeans/Sun ONE Studio)

Apply formatting automatically whenever a dirty file is saved

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

Braces

Brace styles. Jalopy provides several pre-configured brace styles (C, Sun, GNU), but the handling of braces is fully user-configurable

Braces example

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

White Space

Extremely configurable white space behavior for all code elements like operators, parentheses, braces and brackets

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

Indentation

Several indentation strategies

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

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

Imports

Sort import declarations. The order is fully configurable. Additionally, declarations 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

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

Javadoc

Javadoc example

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

Limit formatting to Javadoc comments only

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

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

Misc

Special pragma comments to control formatting on the source level (e.g. to prohibit formatting for certain pieces of code)

Numbered backups

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

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