View Javadoc

1   /*
2    * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3    * Copyright (C) 2004-2009 Frederico Caldeira Knabben
4    * 
5    * == BEGIN LICENSE ==
6    * 
7    * Licensed under the terms of any of the following licenses at your
8    * choice:
9    * 
10   *  - GNU General Public License Version 2 or later (the "GPL")
11   *    http://www.gnu.org/licenses/gpl.html
12   * 
13   *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14   *    http://www.gnu.org/licenses/lgpl.html
15   * 
16   *  - Mozilla Public License Version 1.1 or later (the "MPL")
17   *    http://www.mozilla.org/MPL/MPL-1.1.html
18   * 
19   * == END LICENSE ==
20   */
21  package net.fckeditor.localization;
22  
23  import java.util.Locale;
24  
25  import javax.servlet.http.HttpServletRequest;
26  
27  /**
28   * An interface for user locale resolution.
29   * <p>
30   * <strong>Note:</strong> You are free to implement this interface the way you
31   * need it, in other words your return values can be global, regardless of the
32   * request, or on a per-request basis.
33   * </p> 
34   * @version $Id: LocaleResolver.java 3759 2009-06-22 20:02:26Z mosipov $
35   */
36  public interface LocaleResolver {
37  
38  	/**
39  	 * Returns the locale of a given request.
40  	 * 
41  	 * @param request
42  	 *            the current request instance
43  	 * @return the locale of the request, <code>null</code> if the locale
44  	 *         couldn't be resolved
45  	 */
46  	public Locale resolveLocale(final HttpServletRequest request);
47  
48  }