jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeMessageFormatter.java
changeset 16953 a44e04deb948
parent 12457 c348e06f0e82
child 25264 040625ce9b72
equal deleted inserted replaced
16416:bcebd3fdefc9 16953:a44e04deb948
    18  * limitations under the License.
    18  * limitations under the License.
    19  */
    19  */
    20 
    20 
    21 package com.sun.org.apache.xerces.internal.xinclude;
    21 package com.sun.org.apache.xerces.internal.xinclude;
    22 
    22 
       
    23 import com.sun.org.apache.xerces.internal.util.MessageFormatter;
       
    24 import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
    23 import java.util.Locale;
    25 import java.util.Locale;
    24 import java.util.MissingResourceException;
    26 import java.util.MissingResourceException;
    25 import java.util.ResourceBundle;
    27 import java.util.ResourceBundle;
    26 import java.util.PropertyResourceBundle;
       
    27 import com.sun.org.apache.xerces.internal.util.MessageFormatter;
       
    28 
    28 
    29 // TODO: fix error messages in XIncludeMessages.properties
    29 // TODO: fix error messages in XIncludeMessages.properties
    30 /**
    30 /**
    31  * XIncludeMessageFormatter provides error messages for the XInclude 1.0 Candidate Recommendation
    31  * XIncludeMessageFormatter provides error messages for the XInclude 1.0 Candidate Recommendation
    32  *
    32  *
    33  * @author Peter McCracken, IBM
    33  * @author Peter McCracken, IBM
    34  *
    34  *
       
    35  * @version $Id: XIncludeMessageFormatter.java,v 1.7 2010-11-01 04:40:18 joehw Exp $
    35  */
    36  */
    36 public class XIncludeMessageFormatter implements MessageFormatter {
    37 public class XIncludeMessageFormatter implements MessageFormatter {
    37 
    38 
    38     public static final String XINCLUDE_DOMAIN = "http://www.w3.org/TR/xinclude";
    39     public static final String XINCLUDE_DOMAIN = "http://www.w3.org/TR/xinclude";
    39 
    40 
    59      public String formatMessage(Locale locale, String key, Object[] arguments)
    60      public String formatMessage(Locale locale, String key, Object[] arguments)
    60         throws MissingResourceException {
    61         throws MissingResourceException {
    61 
    62 
    62         if (fResourceBundle == null || locale != fLocale) {
    63         if (fResourceBundle == null || locale != fLocale) {
    63             if (locale != null) {
    64             if (locale != null) {
    64                 fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XIncludeMessages", locale);
    65                 fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XIncludeMessages", locale);
    65                 // memorize the most-recent locale
    66                 // memorize the most-recent locale
    66                 fLocale = locale;
    67                 fLocale = locale;
    67             }
    68             }
    68             if (fResourceBundle == null)
    69             if (fResourceBundle == null)
    69                 fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XIncludeMessages");
    70                 fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XIncludeMessages");
    70         }
    71         }
    71 
    72 
    72         String msg = fResourceBundle.getString(key);
    73         String msg = fResourceBundle.getString(key);
    73         if (arguments != null) {
    74         if (arguments != null) {
    74             try {
    75             try {