001/* 002 * This library is part of OpenCms - 003 * the Open Source Content Management System 004 * 005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com) 006 * 007 * This library is free software; you can redistribute it and/or 008 * modify it under the terms of the GNU Lesser General Public 009 * License as published by the Free Software Foundation; either 010 * version 2.1 of the License, or (at your option) any later version. 011 * 012 * This library is distributed in the hope that it will be useful, 013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 015 * Lesser General Public License for more details. 016 * 017 * For further information about Alkacon Software, please see the 018 * company website: http://www.alkacon.com 019 * 020 * For further information about OpenCms, please see the 021 * project website: http://www.opencms.org 022 * 023 * You should have received a copy of the GNU Lesser General Public 024 * License along with this library; if not, write to the Free Software 025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 026 */ 027 028package org.opencms.jsp.util; 029 030import java.util.Locale; 031 032/** 033 * Common interface for accessing formatter / resource type infos in JSPs. 034 */ 035public interface I_CmsFormatterInfo extends I_CmsInfoWrapper { 036 037 /** 038 * Mode which controls whether / how localized strings should be resolved. 039 */ 040 enum ResolveMode { 041 /** Fully resolve localized string. */ 042 text, 043 044 /** Tries to get the localization key itself. */ 045 key, 046 047 /** Get the whole raw configured string including macro characters. */ 048 raw; 049 } 050 051 /** 052 * Gets the description in the given locale. 053 * 054 * @param l the locale to use 055 * @return the description 056 */ 057 String description(Locale l); 058 059 /** 060 * Checks if this is active. 061 * 062 * @return true if this is active 063 */ 064 boolean getIsActive(); 065 066 /** 067 * Checks if this wraps a (non-function) formatter. 068 * 069 * @return true if this wraps a normal formatter 070 */ 071 boolean getIsFormatter(); 072 073 /** 074 * Checks if this wraps a dynamic function. 075 * 076 * @return true if this wraps a dynamic function 077 */ 078 boolean getIsFunction(); 079 080 /** 081 * Checks if this wraps a resource type. 082 * 083 * @return true if this is a resource type 084 */ 085 boolean getIsResourceType(); 086 087 /** 088 * Gets the name. 089 * 090 * @return the name 091 */ 092 String getName(); 093 094 /** 095 * Gets the nice name for the current locale. 096 * 097 * @return the nice name for the current locale 098 */ 099 String getNiceName(); 100 101 /** 102 * Gets the localization key for the nice name, if one was used, or null otherwise. 103 * 104 * @return the localization key 105 */ 106 String getNiceNameKey(); 107 108 /** 109 * Gets the raw nice name, without resolving any macros. 110 * 111 * @return the raw nice name 112 */ 113 String getNiceNameRaw(); 114 115 /** 116 * Gets the nice name in the given locale. 117 * 118 * @param l the locale to use 119 * @return the nice name for the locale 120 */ 121 String niceName(Locale l); 122 123}