KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > xml > bind > util > Messages


1 /*
2  * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
3  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4  */

5
6 package javax.xml.bind.util;
7
8 import java.text.MessageFormat JavaDoc;
9 import java.util.ResourceBundle JavaDoc;
10
11 /**
12  * Formats error messages.
13  */

14 class Messages
15 {
16     static String JavaDoc format( String JavaDoc property ) {
17         return format( property, null );
18     }
19     
20     static String JavaDoc format( String JavaDoc property, Object JavaDoc arg1 ) {
21         return format( property, new Object JavaDoc[]{arg1} );
22     }
23     
24     static String JavaDoc format( String JavaDoc property, Object JavaDoc arg1, Object JavaDoc arg2 ) {
25         return format( property, new Object JavaDoc[]{arg1,arg2} );
26     }
27     
28     static String JavaDoc format( String JavaDoc property, Object JavaDoc arg1, Object JavaDoc arg2, Object JavaDoc arg3 ) {
29         return format( property, new Object JavaDoc[]{arg1,arg2,arg3} );
30     }
31     
32     // add more if necessary.
33

34     /** Loads a string resource and formats it with specified arguments. */
35     static String JavaDoc format( String JavaDoc property, Object JavaDoc[] args ) {
36         String JavaDoc text = ResourceBundle.getBundle(Messages.class.getName()).getString(property);
37         return MessageFormat.format(text,args);
38     }
39     
40 //
41
//
42
// Message resources
43
//
44
//
45
static final String JavaDoc UNRECOGNIZED_SEVERITY = // 1 arg
46
"ValidationEventCollector.UnrecognizedSeverity";
47
48     static final String JavaDoc RESULT_NULL_CONTEXT = // 0 args
49
"JAXBResult.NullContext";
50
51     static final String JavaDoc RESULT_NULL_UNMARSHALLER = // 0 arg
52
"JAXBResult.NullUnmarshaller";
53         
54     static final String JavaDoc SOURCE_NULL_CONTEXT = // 0 args
55
"JAXBSource.NullContext";
56
57     static final String JavaDoc SOURCE_NULL_CONTENT = // 0 arg
58
"JAXBSource.NullContent";
59         
60     static final String JavaDoc SOURCE_NULL_MARSHALLER = // 0 arg
61
"JAXBSource.NullMarshaller";
62         
63 }
64
Popular Tags