001 /* 002 * Copyright 2002-2006 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 005 * use this file except in compliance with the License. You may obtain a copy of 006 * the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 012 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 013 * License for the specific language governing permissions and limitations under 014 * the License. 015 */ 016 package org.springframework.rules.reporting; 017 018 import java.util.Locale; 019 020 /** 021 * A factory which creates instances of MessageTranslator 022 * 023 * @author Mathias Broekelmann 024 * 025 */ 026 public interface MessageTranslatorFactory { 027 028 /** 029 * Creates a message translator by using the given object name resolver and 030 * the default locale 031 * 032 * @param resolver 033 * the object name resolver which is used to resolve a name to 034 * use in the translated message for an object name 035 * @return the created message translator instance, must not be null 036 */ 037 MessageTranslator createTranslator(ObjectNameResolver resolver); 038 039 /** 040 * Creates a message translator by using the given object name resolver and 041 * the locale 042 * 043 * @param resolver 044 * the object name resolver which is used to resolve a name to 045 * use in the translated message for an object name 046 * @param locale 047 * the locale for the translated messages, if null the default 048 * locale is used 049 * @return the created message translator instance, must not be null 050 */ 051 MessageTranslator createTranslator(ObjectNameResolver resolver, 052 Locale locale); 053 }