01: /*
02: * Copyright 2006 Dan Shellman
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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: package org.iscreen;
17:
18: import java.util.Locale;
19:
20: /**
21: * A failure message is a holding interface for objects that represent
22: * failure messages. These are passed to Validators to use to report
23: * particular failures. For example, a Validator may report two different
24: * types of failures, so it'll be configured with two different instances
25: * of this interface, which it will use to report failures, depending
26: * upon the type.
27: *
28: * @author Shellman, Dan
29: */
30: public interface FailureMessage {
31: /**
32: * Get the actual failure message. Validators shouldn't call this method,
33: * as it's used by the context to construct the actual failure object
34: * that is eventually returned. This method takes an additional
35: * locale for internationalization support.
36: *
37: * @param obj An object used in generating the message
38: * @param locale The locale use for localizing the message.
39: */
40: String getMessage(Object obj, Locale locale);
41: }
|