1 /*
2 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
3 * @LastModified: Sep 2017
4 */
5 /*
6 * Licensed to the Apache Software Foundation (ASF) under one or more
7 * contributor license agreements. See the NOTICE file distributed with
8 * this work for additional information regarding copyright ownership.
9 * The ASF licenses this file to You under the Apache License, Version 2.0
10 * (the "License"); you may not use this file except in compliance with
11 * the License. You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 */
21
22 package com.sun.org.apache.xml.internal.serializer.utils;
23
73 * The field contents (returned by getContents()
74 * should be initialized something like this:
75 * <CODE>
76 * public static final Object[][] contents = {
77 * { KEY_ONE, "Something has gone wrong!" },
78 * { KEY_TWO, "The file ''{0}'' does not exist in directory ''{1}''." },
79 * . . .
80 * { KEY_N, "Message N" } }
81 * </CODE>
82 *
83 * Where that section of code with the KEY to Message mappings
84 * (where the message classes 'contents' field is initialized)
85 * can have the Message strings translated in an alternate language
86 * in a errorResourceClass with a language suffix.
87 *
88 *
89 * This class is not a public API, it is only public because it is
90 * used in com.sun.org.apache.xml.internal.serializer.
91 *
92 * @xsl.usage internal
93 */
94 public final class Messages
95 {
96 /** The local object to use. */
97 private final Locale m_locale = Locale.getDefault();
98
99 /** The language specific resource object for messages. */
100 private ResourceBundle m_resourceBundle;
101
102 /** The class name of the error message string table with no language suffix. */
103 private String m_resourceBundleName;
104
105
106
107 /**
108 * Constructor.
109 * @param resourceBundle the class name of the ListResourceBundle
110 * that the instance of this class is associated with and will use when
111 * creating messages.
112 * The class name is without a language suffix. If the value passed
|
1 /*
2 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
3 */
4 /*
5 * Licensed to the Apache Software Foundation (ASF) under one or more
6 * contributor license agreements. See the NOTICE file distributed with
7 * this work for additional information regarding copyright ownership.
8 * The ASF licenses this file to You under the Apache License, Version 2.0
9 * (the "License"); you may not use this file except in compliance with
10 * the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20
21 package com.sun.org.apache.xml.internal.serializer.utils;
22
72 * The field contents (returned by getContents()
73 * should be initialized something like this:
74 * <CODE>
75 * public static final Object[][] contents = {
76 * { KEY_ONE, "Something has gone wrong!" },
77 * { KEY_TWO, "The file ''{0}'' does not exist in directory ''{1}''." },
78 * . . .
79 * { KEY_N, "Message N" } }
80 * </CODE>
81 *
82 * Where that section of code with the KEY to Message mappings
83 * (where the message classes 'contents' field is initialized)
84 * can have the Message strings translated in an alternate language
85 * in a errorResourceClass with a language suffix.
86 *
87 *
88 * This class is not a public API, it is only public because it is
89 * used in com.sun.org.apache.xml.internal.serializer.
90 *
91 * @xsl.usage internal
92 * @LastModified: Sep 2017
93 */
94 public final class Messages
95 {
96 /** The local object to use. */
97 private final Locale m_locale = Locale.getDefault();
98
99 /** The language specific resource object for messages. */
100 private ResourceBundle m_resourceBundle;
101
102 /** The class name of the error message string table with no language suffix. */
103 private String m_resourceBundleName;
104
105
106
107 /**
108 * Constructor.
109 * @param resourceBundle the class name of the ListResourceBundle
110 * that the instance of this class is associated with and will use when
111 * creating messages.
112 * The class name is without a language suffix. If the value passed
|