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        /** Tries to get the localization key itself. */
042        key,
043
044        /** Get the whole raw configured string including macro characters. */
045        raw,
046
047        /** Fully resolve localized string. */
048        text;
049    }
050
051    /**
052     * Checks if this is active.
053     *
054     * @return true if this is active
055     */
056    boolean getIsActive();
057
058    /**
059     * Checks if this wraps a (non-function) formatter.
060     *
061     * @return true if this wraps a normal formatter
062     */
063    boolean getIsFormatter();
064
065    /**
066     * Checks if this wraps a dynamic function.
067     *
068     * @return true if this wraps a dynamic function
069     */
070    boolean getIsFunction();
071
072    /**
073     * Checks if this wraps a resource type.
074     *
075     * @return true if this is a resource type
076     */
077    boolean getIsResourceType();
078
079    /**
080     * Gets the name.
081     *
082     * @return the name
083     */
084    String getName();
085
086    /**
087     * Gets the nice name for the current locale.
088     *
089     * @return the nice name for the current locale
090     */
091    String getNiceName();
092
093    /**
094     * Gets the localization key for the nice name, if one was used, or null otherwise.
095     *
096     * @return the localization key
097     */
098    String getNiceNameKey();
099
100    /**
101     * Gets the raw nice name, without resolving any macros.
102     *
103     * @return the raw nice name
104     */
105    String getNiceNameRaw();
106
107    /**
108     * Gets the nice name in the given locale.
109     *
110     * @param l the locale to use
111     * @return the nice name for the locale
112     */
113    String niceName(Locale l);
114
115}