langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Messages.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2016, 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 |
41 * strings obtained from the resource files. |
41 * strings obtained from the resource files. |
42 * |
42 * |
43 * Messages are reported to the doclet's {@link Reporter reporter}. |
43 * Messages are reported to the doclet's {@link Reporter reporter}. |
44 */ |
44 */ |
45 public class Messages { |
45 public class Messages { |
46 private final Configuration configuration; |
46 private final BaseConfiguration configuration; |
47 private final Resources resources; |
47 private final Resources resources; |
48 private Reporter reporter; |
48 private Reporter reporter; |
49 |
49 |
50 /** |
50 /** |
51 * Creates a {@code Messages} object to provide standardized access to |
51 * Creates a {@code Messages} object to provide standardized access to |
53 * |
53 * |
54 * @param configuration the doclet's configuration, used to access |
54 * @param configuration the doclet's configuration, used to access |
55 * the doclet's resources, reporter, and additional methods and state |
55 * the doclet's resources, reporter, and additional methods and state |
56 * used to filter out messages, if any, which should be suppressed. |
56 * used to filter out messages, if any, which should be suppressed. |
57 */ |
57 */ |
58 public Messages(Configuration configuration) { |
58 public Messages(BaseConfiguration configuration) { |
59 this.configuration = configuration; |
59 this.configuration = configuration; |
60 resources = configuration.getResources(); |
60 resources = configuration.getResources(); |
61 } |
61 } |
62 |
62 |
63 // ***** Errors ***** |
63 // ***** Errors ***** |
153 initReporter(); |
153 initReporter(); |
154 reporter.print(k, e, msg); |
154 reporter.print(k, e, msg); |
155 } |
155 } |
156 |
156 |
157 // Lazy init the reporter for now, until we can fix/improve |
157 // Lazy init the reporter for now, until we can fix/improve |
158 // the init of ConfigurationImpl in HtmlDoclet (and similar.) |
158 // the init of HtmlConfiguration in HtmlDoclet (and similar.) |
159 private void initReporter() { |
159 private void initReporter() { |
160 if (reporter == null) { |
160 if (reporter == null) { |
161 reporter = configuration.reporter; |
161 reporter = configuration.reporter; |
162 } |
162 } |
163 } |
163 } |