AbstractDiagnosticFormatter.java revision 99
0N/A * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. Sun designates this 0N/A * particular file as subject to the "Classpath" exception as provided 0N/A * by Sun in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 873N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * have any questions. 723N/A * This abstract class provides a basic implementation of the functionalities that should be provided 0N/A * by any formatter used by javac. Among the main features provided by AbstractDiagnosticFormatter are: 0N/A * <li> Provides a standard implementation of the visitor-like methods defined in the interface DiagnisticFormatter. 723N/A * Those implementations are specifically targeting JCDiagnostic objects. 0N/A * <li> Provides basic support for i18n and a method for executing all locale-dependent conversions 0N/A * <li> Provides the formatting logic for rendering the arguments of a JCDiagnostic object. 0N/A * Messages object used by this formatter for i18n 0N/A * Initialize an AbstractDiagnosticFormatter by setting its Messages object 0N/A //this code should rely on the locale settings but it's not! See RFE 6443132 0N/A * Format the arguments of a given diagnostic. 0N/A * @param d diagnostic whose arguments are to be formatted 0N/A * @param l locale object to be used for i18n 0N/A * @return a Collection whose elements are the formatted arguments of the diagnostic 723N/A * Format a single argument of a given diagnostic. 723N/A * @param d diagnostic whose argument is to be formatted 0N/A * @param arg argument to be formatted 723N/A * @param l locale object to be used for i18n 0N/A * @return string representation of the diagnostic argument 0N/A * Format an iterable argument of a given diagnostic. 0N/A * @param d diagnostic whose argument is to be formatted 0N/A * @param it iterable argument to be formatted 0N/A * @param l locale object to be used for i18n 0N/A * @return string representation of the diagnostic iterable argument 0N/A * Converts a String into a locale-dependent representation accordingly to a given locale 0N/A * @param l locale object to be used for i18n 0N/A * @param key locale-independent key used for looking up in a resource file 0N/A * @param args localization arguments 723N/A * @return a locale-dependent string