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 019/** 020 * Interface to be implemented by objects that can resolve {@link Theme Themes}. 021 * This enables parameterization and internationalization of messages 022 * for a given 'theme'. 023 * 024 * @author Jean-Pierre Pawlak 025 * @author Juergen Hoeller 026 * @see Theme 027 */ 028public interface ThemeSource { 029 030 /** 031 * Return the Theme instance for the given theme name. 032 * <p>The returned Theme will resolve theme-specific messages, codes, 033 * file paths, etc (e.g. CSS and image files in a web environment). 034 * @param themeName the name of the theme 035 * @return the corresponding Theme, or {@code null} if none defined. 036 * Note that, by convention, a ThemeSource should at least be able to 037 * return a default Theme for the default theme name "theme" but may also 038 * return default Themes for other theme names. 039 * @see org.springframework.web.servlet.theme.AbstractThemeResolver#ORIGINAL_DEFAULT_THEME_NAME 040 */ 041 Theme getTheme(String themeName); 042 043}