286N/A/*
286N/A * reserved comment block
286N/A * DO NOT REMOVE OR ALTER!
286N/A */
286N/A/*
286N/A * Copyright 1999-2004 The Apache Software Foundation.
286N/A *
286N/A * Licensed under the Apache License, Version 2.0 (the "License");
286N/A * you may not use this file except in compliance with the License.
286N/A * You may obtain a copy of the License at
286N/A *
286N/A * http://www.apache.org/licenses/LICENSE-2.0
286N/A *
286N/A * Unless required by applicable law or agreed to in writing, software
286N/A * distributed under the License is distributed on an "AS IS" BASIS,
286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
286N/A * See the License for the specific language governing permissions and
286N/A * limitations under the License.
286N/A */
286N/A/*
286N/A * $Id: XSLMessages.java,v 1.2.4.1 2005/09/09 07:41:10 pvedula Exp $
286N/A */
286N/Apackage com.sun.org.apache.xalan.internal.res;
286N/A
524N/Aimport com.sun.org.apache.xalan.internal.utils.SecuritySupport;
286N/Aimport java.util.ListResourceBundle;
286N/A
286N/Aimport com.sun.org.apache.xpath.internal.res.XPATHMessages;
286N/A
286N/A/**
524N/A * Sets things up for issuing error messages. This class is misnamed, and should
524N/A * be called XalanMessages, or some such.
524N/A *
286N/A * @xsl.usage internal
286N/A */
524N/Apublic class XSLMessages extends XPATHMessages {
286N/A
524N/A /**
524N/A * The language specific resource object for Xalan messages.
524N/A */
524N/A private static ListResourceBundle XSLTBundle = null;
524N/A /**
524N/A * The class name of the Xalan error message string table.
524N/A */
524N/A private static final String XSLT_ERROR_RESOURCES =
524N/A "com.sun.org.apache.xalan.internal.res.XSLTErrorResources";
286N/A
524N/A /**
524N/A * Creates a message from the specified key and replacement arguments,
524N/A * localized to the given locale.
524N/A *
524N/A * @param msgKey The key for the message text.
524N/A * @param args The arguments to be used as replacement text in the message
524N/A * created.
524N/A *
524N/A * @return The formatted message string.
524N/A */
524N/A public static String createMessage(String msgKey, Object args[]) //throws Exception
286N/A {
524N/A if (XSLTBundle == null) {
524N/A XSLTBundle = SecuritySupport.getResourceBundle(XSLT_ERROR_RESOURCES);
524N/A }
524N/A
524N/A if (XSLTBundle != null) {
524N/A return createMsg(XSLTBundle, msgKey, args);
524N/A } else {
524N/A return "Could not load any resource bundles.";
524N/A }
286N/A }
286N/A
524N/A /**
524N/A * Creates a message from the specified key and replacement arguments,
524N/A * localized to the given locale.
524N/A *
524N/A * @param msgKey The key for the message text.
524N/A * @param args The arguments to be used as replacement text in the message
524N/A * created.
524N/A *
524N/A * @return The formatted warning string.
524N/A */
524N/A public static String createWarning(String msgKey, Object args[]) //throws Exception
524N/A {
524N/A if (XSLTBundle == null) {
524N/A XSLTBundle = SecuritySupport.getResourceBundle(XSLT_ERROR_RESOURCES);
524N/A }
286N/A
524N/A if (XSLTBundle != null) {
524N/A return createMsg(XSLTBundle, msgKey, args);
524N/A } else {
524N/A return "Could not load any resource bundles.";
524N/A }
286N/A }
286N/A}