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



title
5.6.2.9.5 Qualifiers

List of annotation qualifiers to wrap

List of annotation qualifiers to wrap

Depending on your code convention you may want to put specific annotation qualifiers to a separated line. Qualifiers belong to libraries or packages you are using in your C/C++ project, for instance the PREfast driver annotation package from Microsoft.

You can now add, edit and delete your own customized libraries for the qualifiers you want to separate to a new line. You just describe the name of the package and a regular expression which matches to the qualifier names of your used C/C++ library.
For instance if you want qualifiers beginning with the prefix _drv_ to be placed to a separeted line, then you just click the add button to create a new package with the name my package and sets a regular expression like: \_\_drv\_[a-z|A-Z]+. That means that all qualifiers starting with the prefix __drv_ will be wrapped to a new line. All other qualifiers will be kept in the same line as the source code it belongs to.
Additionally you can separately enable or disable packages with the checkbox.


Sample of source code using PREfast qualifiers which will be wrapped to a new line:

    __checkReturn                                                               |
    
__drv_allocatesMem(Pool)                                                    |
    
PVOID ExAllocatePoolWithTag(__in POOL_TYPE PoolType,                        |
                                
__in SIZE_T    NumberOfBytes,                   |
                                
__in ULONG     Tag);                            |


Same source code with wrapping of qualifiers disabled:

    __checkReturn __drv_allocatesMem(Pool) PVOID ExAllocatePoolWithTag(__in POOL_TYPE PoolType,
                                                                       __in SIZE_T    NumberOfBytes,

                                                                       __in ULONG     Tag);




Always wrap annotation qualifiers with arguments

Always wrap annotation qualifiers with arguments

Since annotation qualifiers with arguments are not easy to read if they are tightly embedded in function signatures Jindent offers an alternative setting to the regular expression rules described above just to put qualifiers with arguments to a new line.

Wrap qualifiers with arguments:

    _allocatesMem(Pool)                                                         |
    
_irq(3)                                                                     |
    
PVOID ExAllocatePoolWithTag();                                              |


Do not wrap qualifiers with arguments:

    _allocatesMem(Pool) _irq(3) PVOID ExAllocatePoolWithTag();                  |