src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java

changeset 3315
6f0746b6de9f
parent 3258
fd9b6417c521
child 3446
e468915bad3a
equal deleted inserted replaced
3314:7b6c1bfeeb03 3315:6f0746b6de9f
1 /* 1 /*
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this 7 * published by the Free Software Foundation. Oracle designates this
162 162
163 public final Content descfrmClassLabel; 163 public final Content descfrmClassLabel;
164 164
165 public final Content descfrmInterfaceLabel; 165 public final Content descfrmInterfaceLabel;
166 166
167 private final Writer writer; 167 private final DocFile file;
168
169 private Writer writer;
168 170
169 private Content script; 171 private Content script;
170 172
171 /** 173 /**
172 * Constructor. 174 * Constructor.
178 * @exception UnsupportedEncodingException Exception raised by the 180 * @exception UnsupportedEncodingException Exception raised by the
179 * OutputStreamWriter is passed on to next level. 181 * OutputStreamWriter is passed on to next level.
180 */ 182 */
181 public HtmlWriter(Configuration configuration, DocPath path) 183 public HtmlWriter(Configuration configuration, DocPath path)
182 throws IOException, UnsupportedEncodingException { 184 throws IOException, UnsupportedEncodingException {
183 writer = DocFile.createFileForOutput(configuration, path).openWriter(); 185 file = DocFile.createFileForOutput(configuration, path);
184 this.configuration = configuration; 186 this.configuration = configuration;
185 this.memberDetailsListPrinted = false; 187 this.memberDetailsListPrinted = false;
186 profileTableHeader = new String[] { 188 profileTableHeader = new String[] {
187 configuration.getText("doclet.Profile"), 189 configuration.getText("doclet.Profile"),
188 configuration.getText("doclet.Description") 190 configuration.getText("doclet.Description")
237 descfrmClassLabel = getResource("doclet.Description_From_Class"); 239 descfrmClassLabel = getResource("doclet.Description_From_Class");
238 descfrmInterfaceLabel = getResource("doclet.Description_From_Interface"); 240 descfrmInterfaceLabel = getResource("doclet.Description_From_Interface");
239 } 241 }
240 242
241 public void write(Content c) throws IOException { 243 public void write(Content c) throws IOException {
244 writer = file.openWriter();
242 c.write(writer, true); 245 c.write(writer, true);
243 } 246 }
244 247
245 public void close() throws IOException { 248 public void close() throws IOException {
246 writer.close(); 249 writer.close();

mercurial