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



title
5.6.1.7.10 Colons

Space before colons of assert statements

Space before colons of assert statements

Controls whether a white space is inserted before assert colons or not.


Insert a white space before:

assert·condition·:"Error"               


Do not insert a white space before:

assert·condition:"Error"                



Space after colons of assert statements

Space after colons of assert statements

Controls whether a white space is inserted after assert colons or not.


Insert a white space after:

assert·condition:·"Error"               


Do not insert a white space after:

assert·condition:"Error"                



Space before colons of for statements

Space before colons of for statements

Controls whether a white space is inserted before colons in for statements or not.


Insert a white space before:

for(String·s·:collection)·{             
    ...                                 
}                                       


Do not insert a white space before:

for(String·s:collection)·{              
    ...                                 
}                                       



Space after colons of for statements

Space after colons of for statements

Controls whether a white space is inserted after colons in for statements or not.


Insert a white space after:

for(String·s:·collection)·{             
    ...                                 
}                                       


Do not insert a white space after:

for(String·s:collection)·{              
    ...                                 
}                                       



Space before colons of ternary conditions

Space before colons of ternary conditions

Controls whether a white space is inserted before ternary colons or not.


Insert a white space before:

int·x·=·(a·==·0)·?·b·:·c;               


Do not insert a white space before:

int·x·=·(a·==·0)·?·b:·c;                



Space after colons of ternary conditions

Space after colons of ternary conditions

Controls whether a white space is inserted after ternary colons or not.


Insert a white space after:

int·x·=·(a·==·0)·?·b·:·c;               


Do not insert a white space after:

int·x·=·(a·==·0)·?·b·:c;                




See also... See also: Space before question marks of ternary conditions , Space after question marks of ternary conditions

Space before colons of labels

Space before colons of labels

Controls whether a white space is inserted before label colons or not.


Insert a white space before:

myLabel·:···while·(a·<·10)·{            
···············...                      
···············break·myLabel;           
···············...                      
············}                           


Do not insert a white space before:

myLabel:····while·(a·<·10)·{            
···············...                      
···············break·myLabel;           
···············...                      
············}                           



Space after colons of labels

Space after colons of labels

Controls whether a white space is inserted after label colons or not.


Insert a white space after:

myLabel:·while·(a·<·10)·{               
···...                                  
···break·myLabel;                       
···...                                  
}                                       


Do not insert a white space after:

myLabel:while·(a·<·10)·{                
···...                                  
···break·myLabel;                       
···...                                  
}                                       



White space before colons in switch-case blocks

White space before colons in switch-case blocks

Controls whether a white space is inserted before case colons or not.


Insert a white space before:

switch(a)·{                             
····case·1·:                            
········System.out.println("one");      
········break;                          
····case·2·:                            
········System.out.println("two");      
········break;                          
····case·3·:                            
········System.out.println("three");    
········break;                          
····default·:                           
}                                       


Do not insert a white space before:

switch(a)·{                             
····case·1:                             
········System.out.println("one");      
········break;                          
····case·2:                             
········System.out.println("two");      
········break;                          
····case·3:                             
········System.out.println("three");    
········break;                          
····default:                            
}                                       



White space before colons in method references

White space before colons in method references

Controls whether a white space is inserted before method reference colons or not.


Insert a white space before:

list.forEach(System.out·::println)      


Do not insert a white space before:

list.forEach(System.out::println)       



White space before colons in method references

White space before colons in method references

Controls whether a white space is inserted after method reference colons or not.


Insert a white space after:

list.forEach(System.out::·println)      


Do not insert a white space after:

list.forEach(System.out::println)