Lets you control all printer related settings.
Controls the handling of curly braces (the Java block delimeters).
Controls how the enclosing block delimeters - left and right curly
brace - are printed. You can either choose from a predefined set of common
styles or build one on your own.
Controls which brace style will be used to lay out blocks.
C style
Selects the C brace style. This style is sometimes called "Allman style" or "BSD style".
Example 4.1. C style
if (!isDone)
{
doSomething();
}
else
{
System.err.println("Finished");
}
|
Sun style
Selects the Sun brace style. Sometimes called "K&R style".
Example 4.2. Sun style
if (!isDone) {
doSomething();
} else {
System.err.println("Finished");
}
|
GNU style
Selects the GNU brace style.
Example 4.3. GNU style
if (!isDone)
{
doSomething();
}
else
{
System.err.println("Finished");
}
|
Custom style
Selecting this option will enable you to freely choose between the different brace
style options discussed below.
Controls the brace wrapping options.
Newline before left brace
If enabled, always prints a newline before the left curly brace.
Newline after right brace
If enabled, prints a newline after the left curly brace (when possible).
Treat class/method blocks different
It is common in the Java developer community to have the opening brace
at the end of the line of the keyword for all types of blocks (Sun brace style).
One may find the C++ convention of treating class/interface and method/constructor
blocks different from other blocks useful. With this switch you can achieve
exactly that: if enabled, class/interface and method/constructor blocks are
then always printed in C brace style (newline before left brace).
Treat class/method blocks different if wrapped
With this switch enabled, the opening brace for class/interface or
method/constructor blocks will always be printed on a new line (C style), if
either the parameter list spawns several lines and a throws
clause follows, or one of the possible clauses (extends,
implements, throws) was wrapped.
Controls the indentation whitespace for the left and right curly brace.
Before left brace
Number of spaces to print before the left curly brace.
After left brace
Number of spaces to print after the left curly brace.
After right brace
Number of spaces to print after the right curly brace.
Controls miscellaneous brace options.
Per definition braces are superfluous on single statements, but it is
a common recommendation that braces should be always used in such cases.
With this option, you can specify whether missing braces for single
statements should be inserted for the control statements if,
for, while and do-while.
Enabling this option for while statements would render
Example 4.4. Brace insertion
while (!isDone)
doSomething();
|
into
while (!isDone)
{
doSomething();
}
|
It is permittable to remove braces in case they are superfluous. This not only
applies to the control statements if, for,
while and do-while, but also to every
block in general (remember a block is just a sequence of statements,
local class declarations and local variable declaration statements within
braces).
Example 4.5. Brace removal
for (int i = 0; i < 100; i++)
{
sum += value[i];
}
|
would become
for (int i = 0; i < 100; i++)
sum += value[i];
|
Controls how empty braces should be handled. If no option is selected,
they are left untouched.
Example 4.6. Empty braces
if (in != null)
{
try
{
in.close();
}
catch (IOException ignored)
{
}
}
|
All options don't apply to class/interface and method/constructor bodies but
are only used for control statements and blocks.
|