Package: MessageFactory
MessageFactory
name | instruction | branch | complexity | line | method | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
MessageFactory() |
|
|
|
|
|
||||||||||||||||||||
get(String) |
|
|
|
|
|
||||||||||||||||||||
get(String, Object) |
|
|
|
|
|
||||||||||||||||||||
get(String, Object, Object) |
|
|
|
|
|
||||||||||||||||||||
get(String, Object, Object, Object) |
|
|
|
|
|
||||||||||||||||||||
get(String, Object, Object, Object, Object) |
|
|
|
|
|
||||||||||||||||||||
get(String, Object, Object, Object, Object, Object) |
|
|
|
|
|
||||||||||||||||||||
getArray(String, Object[]) |
|
|
|
|
|
||||||||||||||||||||
static {...} |
|
|
|
|
|
Coverage
1: /*
2: * Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
3: *
4: * This program and the accompanying materials are made available under the
5: * terms of the Eclipse Public License v. 2.0, which is available at
6: * http://www.eclipse.org/legal/epl-2.0.
7: *
8: * This Source Code may also be made available under the following Secondary
9: * Licenses when the conditions for such availability set forth in the
10: * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11: * version 2 with the GNU Classpath Exception, which is available at
12: * https://www.gnu.org/software/classpath/license.html.
13: *
14: * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15: */
16:
17: package com.sun.el.util;
18:
19: import java.text.MessageFormat;
20: import java.util.ResourceBundle;
21:
22: /**
23: * @author Jacob Hookom [jacob@hookom.net]
24: * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: kchung $
25: */
26: public final class MessageFactory {
27:
28: protected final static ResourceBundle bundle = ResourceBundle.getBundle("com.sun.el.Messages");
29:
30: /**
31: *
32: */
33: public MessageFactory() {
34: super();
35: }
36:
37: public static String get(final String key) {
38: return bundle.getString(key);
39: }
40:
41: public static String get(final String key, final Object obj0) {
42: return getArray(key, new Object[] { obj0 });
43: }
44:
45: public static String get(final String key, final Object obj0, final Object obj1) {
46: return getArray(key, new Object[] { obj0, obj1 });
47: }
48:
49: public static String get(final String key, final Object obj0, final Object obj1, final Object obj2) {
50: return getArray(key, new Object[] { obj0, obj1, obj2 });
51: }
52:
53: public static String get(final String key, final Object obj0, final Object obj1, final Object obj2, final Object obj3) {
54: return getArray(key, new Object[] { obj0, obj1, obj2, obj3 });
55: }
56:
57: public static String get(final String key, final Object obj0, final Object obj1, final Object obj2, final Object obj3, final Object obj4) {
58: return getArray(key, new Object[] { obj0, obj1, obj2, obj3, obj4 });
59: }
60:
61: public static String getArray(final String key, final Object[] objA) {
62: return MessageFormat.format(bundle.getString(key), objA);
63: }
64:
65: }