Jindent - Java Source Code Formatter http://www.jindent.com
 



title
5.6.1.10 Alignments

title
5.6.1.10.1 Variable/Field Declarations

Align variable/field declarations

Align variable/field declarations

Controls whether variable/field declarations are aligned within one source code chunk or not.


Align declarations:

private int    field1 = 10;             
private int    field2 = 0x0100010101;   
private String message = "some text here...";


Do not align declarations:

private int field1 = 10;                
private int field2 = 0x0100010101;      
private String message = "some text here...";

See also... See also: Jindent - Settings - Formatter - Java / SQLJ - Alignments - Chunks




Align declarations exceeding max. line length

Align declarations exceeding max. line length

Controls whether variable/field delcarations which exceed maximal line length are aligned with other declarations or not.


Align exceeding declarations:

private int     field1 = 10;                                          |
private int     field2 = 0x0100010101;                                |
private String  message = "some text here...";                        |
private MyClass myObject = new MyObject(parameterOne, parameterTwo,   |
                                        
paremeterThree);              |

Even if declaration of field myObject exceeds the specified maximal line length it will be aligned.


Do not align exceeding assignments:

private int    field1 = 10;                                           |
private int    field2 = 0x0100010101;                                 |
private String message = "some text here...";                         |
private MyClass myObject = new MyObject(parameterOne, parameterTwo,   |
                                        
paremeterThree);              |

Declaration of field myObject exceeds the specified maximal line length. Therefore it will be not aligned.



Indent variable/field declarations by tab stops

Indent variable/field declarations by tab stops

Controls whether variable/field declaration are indented by spaces or tabulator stops.


Indent declarations by tabulator stops:

private int>--->field1 = 10;            
private int>--->field2 = 0x0100010101;  
private String->message = "some text here...";


Do not indent declarations by tabulator stops, rather use white spaces:

private·int····field1·=·10;             
private·int····field2·=·0x0100010101;   
private·String·message·=·"some·text·here...";