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