langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocFileFactory.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1998, 2017, 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 |
28 import javax.tools.JavaFileManager; |
28 import javax.tools.JavaFileManager; |
29 import javax.tools.JavaFileManager.Location; |
29 import javax.tools.JavaFileManager.Location; |
30 import javax.tools.StandardJavaFileManager; |
30 import javax.tools.StandardJavaFileManager; |
31 import javax.tools.StandardLocation; |
31 import javax.tools.StandardLocation; |
32 |
32 |
33 import jdk.javadoc.internal.doclets.toolkit.Configuration; |
33 import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration; |
34 import jdk.javadoc.internal.doclets.toolkit.DocletException; |
34 import jdk.javadoc.internal.doclets.toolkit.DocletException; |
35 |
35 |
36 /** |
36 /** |
37 * Factory for DocFile objects. |
37 * Factory for DocFile objects. |
38 * |
38 * |
48 * configuration. |
48 * configuration. |
49 * |
49 * |
50 * @param configuration the configuration for this doclet |
50 * @param configuration the configuration for this doclet |
51 * @return the factory associated with this configuration |
51 * @return the factory associated with this configuration |
52 */ |
52 */ |
53 public static synchronized DocFileFactory getFactory(Configuration configuration) { |
53 public static synchronized DocFileFactory getFactory(BaseConfiguration configuration) { |
54 DocFileFactory f = configuration.docFileFactory; |
54 DocFileFactory f = configuration.docFileFactory; |
55 if (f == null) { |
55 if (f == null) { |
56 JavaFileManager fm = configuration.getFileManager(); |
56 JavaFileManager fm = configuration.getFileManager(); |
57 if (fm instanceof StandardJavaFileManager) { |
57 if (fm instanceof StandardJavaFileManager) { |
58 f = new StandardDocFileFactory(configuration); |
58 f = new StandardDocFileFactory(configuration); |
62 configuration.docFileFactory = f; |
62 configuration.docFileFactory = f; |
63 } |
63 } |
64 return f; |
64 return f; |
65 } |
65 } |
66 |
66 |
67 protected Configuration configuration; |
67 protected BaseConfiguration configuration; |
68 |
68 |
69 protected DocFileFactory(Configuration configuration) { |
69 protected DocFileFactory(BaseConfiguration configuration) { |
70 this.configuration = configuration; |
70 this.configuration = configuration; |
71 } |
71 } |
72 |
72 |
73 public abstract void setDestDir(String dir) throws DocletException; |
73 public abstract void setDestDir(String dir) throws DocletException; |
74 |
74 |