01: /*
02: *
03: *
04: * Portions Copyright 2000-2007 Sun Microsystems, Inc. All Rights
05: * Reserved. Use is subject to license terms.
06: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
07: *
08: * This program is free software; you can redistribute it and/or
09: * modify it under the terms of the GNU General Public License version
10: * 2 only, as published by the Free Software Foundation.
11: *
12: * This program is distributed in the hope that it will be useful, but
13: * WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * General Public License version 2 for more details (a copy is
16: * included at /legal/license.txt).
17: *
18: * You should have received a copy of the GNU General Public License
19: * version 2 along with this work; if not, write to the Free Software
20: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21: * 02110-1301 USA
22: *
23: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
24: * Clara, CA 95054 or visit www.sun.com if you need additional
25: * information or have any questions.
26: */
27:
28: /*****************************************************************************
29: * Copyright (C) The Apache Software Foundation. All rights reserved. *
30: * ------------------------------------------------------------------------- *
31: * This software is published under the terms of the Apache Software License *
32: * version 1.1, a copy of which has been included with this distribution in *
33: * the LICENSE file. *
34: *****************************************************************************/package com.sun.perseus.midp;
35:
36: import com.sun.perseus.platform.MessagesSupport;
37:
38: /**
39: *
40: * @version $Id: Messages.java,v 1.2 2006/04/21 06:40:52 st125089 Exp $
41: */
42: final class Messages {
43: /*
44: * Error message codes.
45: *
46: */
47:
48: /**
49: * Error when a method is called while the target object is in the
50: * wrong state.
51: *
52: * {0} : the target object class name.
53: * {1} : the target object's current state.
54: * {2} : the method name
55: * {3} : the valid state(s) for the method.
56: */
57: static String ERROR_INVALID_STATE = "error.invalid.state";
58:
59: /**
60: * This class does not need to be instantiated.
61: */
62: private Messages() {
63: }
64:
65: /**
66: * The error messages bundle class name.
67: */
68: protected static final String RESOURCES = "com.sun.perseus.awt.resources.Messages";
69:
70: /**
71: * The localizable support for the error messages.
72: */
73: protected static MessagesSupport messagesSupport = new MessagesSupport(
74: RESOURCES);
75:
76: /**
77: * Formats the message identified by <tt>key</tt> with the input
78: * arguments.
79: *
80: * @param key the message's key
81: * @param args the arguments used to format the message
82: * @return the formatted message
83: */
84: public static String formatMessage(final String key,
85: final Object[] args) {
86: return messagesSupport.formatMessage(key, args);
87: }
88: }
|