src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MessageRetriever.java

changeset 1490
fc4cb1577ad6
parent 1359
25e14ad23cef
child 2525
2eb010b6cb22
equal deleted inserted replaced
1486:7d2f628f04f1 1490:fc4cb1577ad6
1 /* 1 /*
2 * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1998, 2013, 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
58 * The lazily fetched resource.. 58 * The lazily fetched resource..
59 */ 59 */
60 private ResourceBundle messageRB; 60 private ResourceBundle messageRB;
61 61
62 /** 62 /**
63 * Initilize the ResourceBundle with the given resource. 63 * Initialize the ResourceBundle with the given resource.
64 * 64 *
65 * @param rb the esource bundle to read. 65 * @param rb the resource bundle to read.
66 */ 66 */
67 public MessageRetriever(ResourceBundle rb) { 67 public MessageRetriever(ResourceBundle rb) {
68 this.configuration = null; 68 this.configuration = null;
69 this.messageRB = rb; 69 this.messageRB = rb;
70 this.resourcelocation = null; 70 this.resourcelocation = null;
71 } 71 }
72 72
73 /** 73 /**
74 * Initilize the ResourceBundle with the given resource. 74 * Initialize the ResourceBundle with the given resource.
75 * 75 *
76 * @param configuration the configuration 76 * @param configuration the configuration
77 * @param resourcelocation Resource. 77 * @param resourcelocation Resource.
78 */ 78 */
79 public MessageRetriever(Configuration configuration, 79 public MessageRetriever(Configuration configuration,
187 * @param pos the position of the source 187 * @param pos the position of the source
188 * @param key selects message from resource 188 * @param key selects message from resource
189 * @param args arguments to be replaced in the message. 189 * @param args arguments to be replaced in the message.
190 */ 190 */
191 public void warning(SourcePosition pos, String key, Object... args) { 191 public void warning(SourcePosition pos, String key, Object... args) {
192 printWarning(pos, getText(key, args)); 192 if (configuration.showMessage(pos, key))
193 printWarning(pos, getText(key, args));
193 } 194 }
194 195
195 /** 196 /**
196 * Print warning message, increment warning count. 197 * Print warning message, increment warning count.
197 * 198 *

mercurial