KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > context > MessageSourceResolvable


1 /*
2  * Copyright 2002-2006 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.springframework.context;
18
19 /**
20  * Interface for objects that are suitable for message resolution in a
21  * {@link MessageSource}.
22  *
23  * <p>Spring's own validation error classes implement this interface.
24  *
25  * @author Juergen Hoeller
26  * @see MessageSource#getMessage(MessageSourceResolvable, java.util.Locale)
27  * @see org.springframework.validation.ObjectError
28  * @see org.springframework.validation.FieldError
29  */

30 public interface MessageSourceResolvable {
31
32     /**
33      * Return the codes to be used to resolve this message, in the order that
34      * they should get tried. The last code will therefore be the default one.
35      * @return a String array of codes which are associated with this message
36      */

37     public String JavaDoc[] getCodes();
38
39     /**
40      * Return the array of arguments to be used to resolve this message.
41      * @return an array of objects to be used as parameters to replace
42      * placeholders within the message text
43      * @see java.text.MessageFormat
44      */

45     public Object JavaDoc[] getArguments();
46
47     /**
48      * Return the default message to be used to resolve this message.
49      * @return the default message, or <code>null</code> if no default
50      */

51     public String JavaDoc getDefaultMessage();
52
53 }
54
Popular Tags