JALOPY | Java Source Code Formatter Beautifier Pretty Printer
Overview • Download • Documentation • Plug-ins • Links • Contact
Features | History | Manual | FAQ | Javadoc
This page generated: June 8 2004
4.3.10. Header
Prev | 4.3. Printer | Next
### 4.3.10. Header Controls the printing of headers. It is always a good idea (and often a recommendation) to include a copyright notice at the top of every source file for a given project. Example 4.148. Typical header template
    /*
     *                 Sun Public License Notice
     *
     * The contents of this file are subject to the Sun Public License
     * Version 1.0 (the "License"). You may not use this file except in
     * compliance with the License. A copy of the License is available at
     * http://www.sun.com/
     *
     * The Original Code is NetBeans. The Initial Developer of the Original
     * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
     * Microsystems, Inc. All Rights Reserved.
     */
### Headers and Javadoc comments Be aware that Jalopy currently does not treat the header comments any special. If you're going to use a Javadoc comment (see Section 4.3.9, “Javadoc”) for your header and have the Javadoc parsing enabled, you will see your header reformatted. Therefore, you should only use multi-line comments (like in the example above). #### 4.3.10.1. Options Lets you control the different header options. ##### 4.3.10.1.1. General Use Header Enables or disables the insertion of a header template at the top of every processed source file. Smart Mode Lets you specify the number of single-line comments before the first node (either a package/import statement or a class/interface declaration) that should be recognized as part of a header and therefore removed. A size equal to zero, means Smart Mode will be disabled. ##### 4.3.10.1.2. Delete Headers To avoid header duplication, you have to specify at least one identify key that can be used to uniquely recognize your header template. That way an existing header can be removed before a new one is inserted. A good key for the template mentioned above would be Sun Public License Notice. Most typically this will be your company's name. You can specify several keys to make it easy to switch between headers. Specify both a key for the old header that is to be removed and for your new header that should be inserted. This way, you are sure that even new additions that happens to contain the old header (maybe checked out from some SCM) are treated correctly. Add... Adds a new identify key to the list of keys. Remove Removes the currently selected key from the list. ##### 4.3.10.1.3. Blank lines To separate the header from the rest of the source code, you may want to specify the blank lines before and after the header. Before Number of blank lines to insert before the header template. After Number of blank lines to insert after the header template. #### 4.3.10.2. Text Insert your header template here. You can use variable expressions throughout the header text. Read Section 4.3.8, “Environment” for more information about this feature.
Prev | Up | Next
4.3.9. Javadoc | Home | 4.3.11. Footer
to top