50 import javax.tools.JavaFileObject.Kind; |
50 import javax.tools.JavaFileObject.Kind; |
51 |
51 |
52 import com.sun.tools.javac.code.Lint; |
52 import com.sun.tools.javac.code.Lint; |
53 import com.sun.tools.javac.code.Source; |
53 import com.sun.tools.javac.code.Source; |
54 import com.sun.tools.javac.file.FSInfo; |
54 import com.sun.tools.javac.file.FSInfo; |
55 import com.sun.tools.javac.file.Paths; |
55 import com.sun.tools.javac.file.Locations; |
56 import com.sun.tools.javac.main.JavacOption; |
56 import com.sun.tools.javac.main.JavacOption; |
57 import com.sun.tools.javac.main.OptionName; |
57 import com.sun.tools.javac.main.OptionName; |
58 import com.sun.tools.javac.main.RecognizedOptions; |
58 import com.sun.tools.javac.main.RecognizedOptions; |
59 import com.sun.tools.javac.util.JCDiagnostic.SimpleDiagnosticPosition; |
59 import com.sun.tools.javac.util.JCDiagnostic.SimpleDiagnosticPosition; |
60 |
60 |
65 */ |
65 */ |
66 public abstract class BaseFileManager { |
66 public abstract class BaseFileManager { |
67 protected BaseFileManager(Charset charset) { |
67 protected BaseFileManager(Charset charset) { |
68 this.charset = charset; |
68 this.charset = charset; |
69 byteBufferCache = new ByteBufferCache(); |
69 byteBufferCache = new ByteBufferCache(); |
70 searchPaths = createPaths(); |
70 locations = createLocations(); |
71 } |
71 } |
72 |
72 |
73 /** |
73 /** |
74 * Set the context for JavacPathFileManager. |
74 * Set the context for JavacPathFileManager. |
75 */ |
75 */ |
76 public void setContext(Context context) { |
76 public void setContext(Context context) { |
77 log = Log.instance(context); |
77 log = Log.instance(context); |
78 options = Options.instance(context); |
78 options = Options.instance(context); |
79 classLoaderClass = options.get("procloader"); |
79 classLoaderClass = options.get("procloader"); |
80 searchPaths.update(log, options, Lint.instance(context), FSInfo.instance(context)); |
80 locations.update(log, options, Lint.instance(context), FSInfo.instance(context)); |
81 } |
81 } |
82 |
82 |
83 protected Paths createPaths() { |
83 protected Locations createLocations() { |
84 return new Paths(); |
84 return new Locations(); |
85 } |
85 } |
86 |
86 |
87 /** |
87 /** |
88 * The log to be used for error reporting. |
88 * The log to be used for error reporting. |
89 */ |
89 */ |
96 |
96 |
97 protected Options options; |
97 protected Options options; |
98 |
98 |
99 protected String classLoaderClass; |
99 protected String classLoaderClass; |
100 |
100 |
101 protected Paths searchPaths; |
101 protected Locations locations; |
102 |
102 |
103 protected Source getSource() { |
103 protected Source getSource() { |
104 String sourceName = options.get(OptionName.SOURCE); |
104 String sourceName = options.get(OptionName.SOURCE); |
105 Source source = null; |
105 Source source = null; |
106 if (sourceName != null) |
106 if (sourceName != null) |