001/* 002 * Copyright 2002-2012 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * https://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, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.springframework.ui.context; 018 019import org.springframework.lang.Nullable; 020 021/** 022 * Interface to be implemented by objects that can resolve {@link Theme Themes}. 023 * This enables parameterization and internationalization of messages 024 * for a given 'theme'. 025 * 026 * @author Jean-Pierre Pawlak 027 * @author Juergen Hoeller 028 * @see Theme 029 */ 030public interface ThemeSource { 031 032 /** 033 * Return the Theme instance for the given theme name. 034 * <p>The returned Theme will resolve theme-specific messages, codes, 035 * file paths, etc (e.g. CSS and image files in a web environment). 036 * @param themeName the name of the theme 037 * @return the corresponding Theme, or {@code null} if none defined. 038 * Note that, by convention, a ThemeSource should at least be able to 039 * return a default Theme for the default theme name "theme" but may also 040 * return default Themes for other theme names. 041 * @see org.springframework.web.servlet.theme.AbstractThemeResolver#ORIGINAL_DEFAULT_THEME_NAME 042 */ 043 @Nullable 044 Theme getTheme(String themeName); 045 046}