23 * have any questions. |
23 * have any questions. |
24 */ |
24 */ |
25 |
25 |
26 package com.sun.tools.javadoc; |
26 package com.sun.tools.javadoc; |
27 |
27 |
28 import com.sun.javadoc.*; |
|
29 |
|
30 import java.io.InputStream; |
28 import java.io.InputStream; |
31 import java.io.IOException; |
29 import java.io.IOException; |
32 import java.text.CollationKey; |
30 import java.text.CollationKey; |
|
31 import javax.tools.FileObject; |
|
32 |
|
33 import com.sun.javadoc.*; |
|
34 |
33 import com.sun.tools.javac.util.Position; |
35 import com.sun.tools.javac.util.Position; |
34 |
36 |
35 /** |
37 /** |
36 * abstract base class of all Doc classes. Doc item's are representations |
38 * abstract base class of all Doc classes. Doc item's are representations |
37 * of java language constructs (class, package, method,...) which have |
39 * of java language constructs (class, package, method,...) which have |
41 * @since 1.2 |
43 * @since 1.2 |
42 * @author Robert Field |
44 * @author Robert Field |
43 * @author Atul M Dambalkar |
45 * @author Atul M Dambalkar |
44 * @author Neal Gafter (rewrite) |
46 * @author Neal Gafter (rewrite) |
45 */ |
47 */ |
46 abstract class DocImpl implements Doc, Comparable<Object> { |
48 public abstract class DocImpl implements Doc, Comparable<Object> { |
47 |
49 |
48 /** |
50 /** |
49 * Doc environment |
51 * Doc environment |
50 */ |
52 */ |
51 protected final DocEnv env; //### Rename this everywhere to 'docenv' ? |
53 protected final DocEnv env; //### Rename this everywhere to 'docenv' ? |
161 } |
163 } |
162 |
164 |
163 /** |
165 /** |
164 * Utility for subclasses which read HTML documentation files. |
166 * Utility for subclasses which read HTML documentation files. |
165 */ |
167 */ |
166 String readHTMLDocumentation(InputStream input, String filename) throws IOException { |
168 String readHTMLDocumentation(InputStream input, FileObject filename) throws IOException { |
167 int filesize = input.available(); |
169 int filesize = input.available(); |
168 byte[] filecontents = new byte[filesize]; |
170 byte[] filecontents = new byte[filesize]; |
169 input.read(filecontents, 0, filesize); |
171 input.read(filecontents, 0, filesize); |
170 input.close(); |
172 input.close(); |
171 String encoding = env.getEncoding(); |
173 String encoding = env.getEncoding(); |