org.apache.sling.i18n.LocaleResolver Maven / Gradle / Ivy
Show all versions of aem-sdk-api Show documentation
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.sling.i18n;
import java.util.List;
import java.util.Locale;
import org.apache.sling.api.SlingHttpServletRequest;
/**
* The LocaleResolver
service interface may be implemented by a
* service registered under this name to allow the resolution of the request
* Locale
to apply.
*
* This interface is intended to be implemented by providers knowing how to
* resolve one or more Locale
s applicable to handle the request.
*
* Only a single LocaleResolver
service is currently used.
* @deprecated The {@link RequestLocaleResolver} should be used instead.
*/
@Deprecated
public interface LocaleResolver {
/**
* Return a non-null
but possiby empty list of
* Locale
instances to consider for localization of the current
* request. The list returned is assumed to be ordered by preference where
* the first entry is the prefered Locale
and the last entry is
* the least prefered Locale
.
*
* Returning an empty list is equivalent to returning a singleton list whose
* single entry is the {@link ResourceBundleProvider#getDefaultLocale()}.
*
* @param request The SlingHttpServletRequest
providing hints
* and information for the Locale
resolution.
* @return The list of Locale
s to use for internationalization
* of request processing
*/
List resolveLocale(SlingHttpServletRequest request);
}