langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocFileFactory.java
changeset 40587 1c355ea550ed
parent 35426 374342e56a56
child 45417 f7479ee8de69
equal deleted inserted replaced
40519:e17429a7e843 40587:1c355ea550ed
    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.Configuration;
       
    34 import jdk.javadoc.internal.doclets.toolkit.DocletException;
    34 
    35 
    35 /**
    36 /**
    36  * Factory for DocFile objects.
    37  * Factory for DocFile objects.
    37  *
    38  *
    38  *  <p><b>This is NOT part of any supported API.
    39  *  <p><b>This is NOT part of any supported API.
    43  */
    44  */
    44 public abstract class DocFileFactory {
    45 public abstract class DocFileFactory {
    45     /**
    46     /**
    46      * Get the appropriate factory, based on the file manager given in the
    47      * Get the appropriate factory, based on the file manager given in the
    47      * configuration.
    48      * configuration.
       
    49      *
       
    50      * @param configuration the configuration for this doclet
       
    51      * @return the factory associated with this configuration
    48      */
    52      */
    49     static synchronized DocFileFactory getFactory(Configuration configuration) {
    53     public static synchronized DocFileFactory getFactory(Configuration configuration) {
    50         DocFileFactory f = configuration.docFileFactory;
    54         DocFileFactory f = configuration.docFileFactory;
    51         if (f == null) {
    55         if (f == null) {
    52             JavaFileManager fm = configuration.getFileManager();
    56             JavaFileManager fm = configuration.getFileManager();
    53             if (fm instanceof StandardJavaFileManager) {
    57             if (fm instanceof StandardJavaFileManager) {
    54                 f = new StandardDocFileFactory(configuration);
    58                 f = new StandardDocFileFactory(configuration);
    64 
    68 
    65     protected DocFileFactory(Configuration configuration) {
    69     protected DocFileFactory(Configuration configuration) {
    66         this.configuration = configuration;
    70         this.configuration = configuration;
    67     }
    71     }
    68 
    72 
       
    73     public abstract void setDestDir(String dir) throws DocletException;
       
    74 
    69     /** Create a DocFile for a directory. */
    75     /** Create a DocFile for a directory. */
    70     abstract DocFile createFileForDirectory(String file);
    76     abstract DocFile createFileForDirectory(String file);
    71 
    77 
    72     /** Create a DocFile for a file that will be opened for reading. */
    78     /** Create a DocFile for a file that will be opened for reading. */
    73     abstract DocFile createFileForInput(String file);
    79     abstract DocFile createFileForInput(String file);