Lets you control miscellaneous indentation settings.
Lets you control what elements should be visually aligned to each other.
If enabled, the identifiers of consecutive variable declarations are aligned. You can control what declarations are treated as consecutive with different chunk options. Refer to the section called "Chunks" for more information.
Example 2.589. Variable identifiers
String text = "text"; int a = -1; History.Entry entry = new History.Entry(text);
Example 2.590. Variable identifiers (aligned)
String text = "text"; int a = -1; History.Entry entry = new History.Entry(text);
If enabled, consecutive assignment expressions and the assignment parts of consecutive variable declarations are aligned. You can control what statements are treated as consecutive with different chunk options. Refer to the section called "Chunks" for more information.
Example 2.591. Variable assignments (aligned)
String text = "text"; int a = -1; History.Entry entry = new History.Entry(text);
If both variable alignment options are enabled, you can achieve a style like the following:
Example 2.592. Variable identifiers/assignments (both aligned)
String text = "text"; int a = -1; History.Entry entry = new History.Entry(text);
If enabled, aligns the parameters of method/constructor declarations. This only applies if all parameters will be wrapped; either because wrapping is forced or the max. line length is reached. To force aligning, you have to enable the wrapping for method parameters. See "Wrap declaration parameters" for more information.
Example 2.593. Method declaration parameters
public static File create(final File file, File directory, int backupLevel) { ... }
Example 2.594. Method declaration parameters (aligned)
public static File create(final File file, File directory, int backupLevel) { ... }
Forces alignment of the curly braces of array initializers with the declaration. This only applies when using either the standard indentation policy or mixed endline indentation policy, because here by default the braces are indented according to the current indentation level and therefore do not align.
Since 1.0.3
Example 2.595. Array initialization (standard indented)
private static String [] sFields = { "LOCATION.ID", "TRACKING_EVENT.CREATE_TIME", "TRACKING_EVENT.EVENT_TIME", "TRACKING_EVENT.ORIGIN_TIME_ZONE_OFFSET", "TRACKING_EVENT.EVENT_TYPE", };
Example 2.596. Array initialization (standard indented, but aligned)
private static String [] sFields = { "LOCATION.ID", "TRACKING_EVENT.CREATE_TIME", "TRACKING_EVENT.EVENT_TIME", "TRACKING_EVENT.ORIGIN_TIME_ZONE_OFFSET", "TRACKING_EVENT.EVENT_TYPE", };
Lets you align the parameter lists of enum constants. Please note that aligning only takes place if "Wrap after enum constants" has been enabled as well.
Since 1.8
Example 2.597. Enum constants
public enum Code { NOT_READY((byte) 0x09), ERROR((byte) 0x10), ILLEGAL((byte) 0x11); }
Example 2.598. Aligned enum constants
public enum Code { NOT_READY((byte) 0x09), ERROR ((byte) 0x10), ILLEGAL ((byte) 0x11); }
When disabled, indentation happens according to the current indentation level.
Example 2.599. Method call chain (standard indented)
Schluesselerzeugung.createService()
.getNeuerSchluesselService(
SchluesselService.SCHLUESSEL_KZ_INTERESSENT);
Otherwise indentation is performed relative to the column offset of the first chain link.
Example 2.600. Method call chain (aligned)
Schluesselerzeugung.createService()
.getNeuerSchluesselService(
SchluesselerzeugungService.SCHLUESSEL_KZ_INTERESSENT);
Please note that you can force line breaks for chained method call, see "Wrap chained method calls".
When disabled, indentation happens according to the current indentation level.
Since 1.6
Example 2.601. Method call chain (standard indented)
id = RefData.getSegmentId(RefData.getAccessor().getCutOff(fileInfo
.getCutoffId())
.getTheoreticalDate(),
fileInfo.getExternalSenderId(),
_fileType,
fileInfo.getCustomerFormat()
.getId());
Otherwise indentation is performed relative to the column offset of the first chain link.
Example 2.602. Method call chain (aligned)
id = RefData.getSegmentId(RefData.getAccessor()
.getCutOff(fileInfo.getCutoffId())
.getTheoreticalDate(),
fileInfo.getExternalSenderId(),
_fileType,
fileInfo.getCustomerFormat()
.getId());
Please note that you can force line breaks for nested chained method calls, see "Wrap nested chained method calls".
If disabled, ternary expressions are printed according to the current indentation policy. See the section called "Strategies" for more information.
Example 2.603. Ternary operators (standard indented)
alpha = (aLongBooleanExpression) ? beta | : gamma; |
Example 2.604. Ternary operators (endline indented)
alpha = (aLongBooleanExpression) ? beta |
: gamma; |
If enabled, the second operator will always be aligned relative to the first one.
Note that this option only takes effect, if indeed a line break was inserted before the second expression. You can enforce such line breaks. See "Wrap ternary expression colon" for more information.
If enabled, the second expression of assertion statements is aligned.
Example 2.606. Assertion expression (standard indented)
assert ((nBits & ~ALL_BITS) != 0) : "Invalid modifier bits: " + (nBits & ~ALL_BITS);
Example 2.607. Assertion expression (endline indented)
assert ((nBits & ~ALL_BITS) != 0) : "Invalid modifier bits: " + (nBits & ~ALL_BITS);
Example 2.608. Assertion expression (aligned)
assert ((nBits & ~ALL_BITS) != 0) : "Invalid modifier bits: " + (nBits & ~ALL_BITS);
Lets you force alignment of anonymous inner brace blocks according to the current indentation level. Only applies when standard indentation is used.
Since 1.6
Example 2.609. Anonymous inner class (standard indented)
Action action = new AbstractAction("action") { public void actionPerformed (ActionEvent ev) { } };
Example 2.610. Anonymous inner class (standard indented but aligned)
Action action = new AbstractAction("action") { public void actionPerformed (ActionEvent ev) { } };
Forces alignment of wrapped right parentheses with the declaration or call. This only applies when using standard indentation policy, because here by default the parentheses are indented according to the current indentation level.
Example 2.611. Method call (standard indented, 2 spaces indent)
myMethod(
getSomeValue(
param1
),
param2
);
Example 2.612. Method call (standard indented, but aligned)
myMethod(
getSomeValue(
param1
),
param2
);
Example 2.613. Method declaration (standard indented)
public MyCustomStringTemplate createTemplate( Map three, int one, // xxx String two // xxx ) { ... }
Example 2.614. Method declaration (standard indented, but aligned)
public MyCustomStringTemplate createTemplate( Map three, int one, // xxx String two // xxx ) { ... }
Since 1.2.1