01 
02 /*
03  *  JavaDoq 1.0 - DOCUment JAVA In Source
04  *  Copyright (C) 2008-2011  J.J.Liu<jianjunliu@126.com> <http://www.javadoq.com>
05  *  
06  *  This program is free software: you can redistribute it and/or modify
07  *  it under the terms of the GNU Affero General Public License as published by
08  *  the Free Software Foundation, either version 3 of the License, or
09  *  (at your option) any later version.
10  *  
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU Affero General Public License for more details.
15  *  
16  *  You should have received a copy of the GNU Affero General Public License
17  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 package com.javadoq.html;
21 
22 import com.javadoq.JavaDoq;
23 
24 /**
25  * <p>An abstract base class of transformers that create target HTML files with bodies.</p>
26  * 
27  * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.javadoq.com" target="_blank">http://www.javadoq.com</a>
28  */
29 public abstract class DoqHTMLBody extends DoqHTMLFile
30 {
31     /**
32      * <p>Constructs a {@link DoqHTMLBody} transformer without style sheet.</p>
33      * <p>This constructor invokes its super constructor to create and open the target file
34      * and HTML body.</p>
35      * @param jdoq The {@link JavaDoq} environment for the transformer.
36      * @param fileName The absolute path of the source file to transform.
37      * @param title The title for the target HTML file.
38      * @since 1.0
39      */
40     protected DoqHTMLBody(JavaDoq jdoq, String fileName, String title) {
41         super(jdoq, fileName, title);
42     }
43 
44     /**
45      * <p>Constructs a {@link DoqHTMLBody} transformer with a given style sheet.</p>
46      * <p>This constructor invokes its super constructor to create and open the target file
47      * and HTML body.</p>
48      * @param jdoq The {@link JavaDoq} environment for the transformer.
49      * @param fileName The absolute path of the source file to transform.
50      * @param title The title for the target HTML file.
51      * @param css The name of the cascade style sheet file.
52      * @since 1.0
53      */
54     protected DoqHTMLBody(JavaDoq jdoq, String fileName, String title, String css) {
55         super(jdoq, fileName, title, css);
56         writeLine("<body>");
57     }
58 
59     /**
60      * <p>Closes the target HTML body.</p>
61      * <p>This method closes HTML body and invokes its super method to close HTML 
62      * and the file.</p>
63      * @since 1.0
64      */
65     @Override
66     public void close() {
67         writeLine("</body>");
68         super.close();
69     }
70 }