KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jdo > api > persistence > enhancer > util > Support


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24
25 package com.sun.jdo.api.persistence.enhancer.util;
26
27 import java.util.ResourceBundle JavaDoc;
28
29 import com.sun.jdo.spi.persistence.utility.I18NHelper;
30
31
32 /**
33  * Basic support for enhancer implementation.
34  */

35 //@olsen: added class
36
public class Support
37     extends Assertion {
38
39     //^olsen: hack
40
static public Timer timer = new Timer();
41
42     /**
43      * I18N message handler
44      */

45     static private ResourceBundle JavaDoc MESSAGES;
46
47
48     /**
49      *
50      */

51     static
52     {
53         try
54         {
55             MESSAGES = I18NHelper.loadBundle(
56                 "com.sun.jdo.api.persistence.enhancer.Bundle", //NOI18N
57
Support.class.getClassLoader());
58         }
59         catch (java.util.MissingResourceException JavaDoc ex)
60         {
61             ex.printStackTrace ();
62         }
63     }
64
65     /**
66      * Returns the I18N message.
67      */

68     static protected final String JavaDoc getI18N(String JavaDoc key) {
69         return I18NHelper.getMessage(MESSAGES, key);
70     }
71
72     /**
73      * Returns the I18N message.
74      */

75     static protected final String JavaDoc getI18N(String JavaDoc key,
76                                           String JavaDoc arg) {
77         return I18NHelper.getMessage(MESSAGES, key, arg);
78     }
79
80     /**
81      * Returns the I18N message.
82      */

83     static protected final String JavaDoc getI18N(String JavaDoc key,
84                                           String JavaDoc arg1,
85                                           String JavaDoc arg2) {
86         return I18NHelper.getMessage(MESSAGES, key, arg1, arg2);
87     }
88
89     /**
90      * Returns the I18N message.
91      */

92     static protected final String JavaDoc getI18N(String JavaDoc key,
93                                           String JavaDoc arg1,
94                                           String JavaDoc arg2,
95                                           String JavaDoc arg3) {
96         return I18NHelper.getMessage(MESSAGES, key, arg1, arg2, arg3);
97     }
98
99     /**
100      * Returns the I18N message.
101      */

102     static protected final String JavaDoc getI18N(String JavaDoc key,
103                                           int arg1,
104                                           String JavaDoc arg2) {
105         return I18NHelper.getMessage(MESSAGES, key,
106                                      new Object JavaDoc[]{new Integer JavaDoc(arg1), arg2});
107     }
108
109     /**
110      * Returns the I18N message.
111      */

112     static protected final String JavaDoc getI18N(String JavaDoc key,
113                                           Object JavaDoc[] args) {
114         return I18NHelper.getMessage(MESSAGES, key, args);
115     }
116 }
117
Popular Tags