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



title
5.6.1.10.5 Annotations

Align default values of annotations

Align default values of annotations

Controls whether annotation defaults are aligned within one source code chunk or not.


Align annotation defaults:

public @interface RequestForEnhancement {
                                        
    
int id();                           
    
String synopsis()       default "[none]";
    
String nameOfEngineer() default "[unassigned]";
    
String date()           default "[unimplemented]";
}                                       


Do not align annotation defaults:

public @interface RequestForEnhancement {
                                        
    
int id();                           
    
String synopsis() default "[none]"
    
String nameOfEngineer() default "[unassigned]";
    
String date() default "[unimplemented]";
}                                       

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




Align default values exceeding max. line length

Align default values exceeding max. line length

Controls whether annotation defaults which exceed maximal line length are aligned with other annotation defaults or not.


Align exceeding annotation defaults:

public @interface RequestForEnhancement {                                  |
                                                                           |
    
int id();                                                              |
    
String synopsis()       default "[none]";                              |
    
String nameOfEngineer() default "[thisIsAVeryLongStringWhichMayExceedsLineLength]"";
    
String date()           default "[unassinged]";                        |
}                                                                          |

Even if default value of annotation member nameOfEngineer is exceeding maximal line length it will be aligned.


Do not align exceeding annotation defaults:

public @interface RequestForEnhancement {                                  |
                                                                           |
    
int id();                                                              |
    
String synopsis() default "[none]";                                    |
    
String nameOfEngineer() default "[thisIsAVeryLongStringWhichMayExceedsLineLength]"";
    
String date()     default "[unassinged]";                              |
}                                                                          |




Indent default values of annotations by tabs

Indent default values of annotations by tabs

Controls whether annotation defaults are indented by spaces or tabulator stops.


Indent annotation defaults by tabulator stops:

public @interface RequestForEnhancement {
                                        
--->int id();                           
--->String synopsis()-->--->--->default "[none]";
--->String nameOfEngineer()>--->default "[unassigned]";
--->String date()-->--->--->--->default "[unimplemented]";
}                                       


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

public·@interface·RequestForEnhancement·{
                                        
    
int·id();                           
    
String·synopsis()·······default·"[none]";
    
String·nameOfEngineer()·default·"[unassigned]";
    
String·date()···········default·"[unimplemented]";
}