001////////////////////////////////////////////////////////////////////////////////
002// checkstyle: Checks Java source code for adherence to a set of rules.
003// Copyright (C) 2001-2020 the original author or authors.
004//
005// This library is free software; you can redistribute it and/or
006// modify it under the terms of the GNU Lesser General Public
007// License as published by the Free Software Foundation; either
008// version 2.1 of the License, or (at your option) any later version.
009//
010// This library is distributed in the hope that it will be useful,
011// but WITHOUT ANY WARRANTY; without even the implied warranty of
012// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013// Lesser General Public License for more details.
014//
015// You should have received a copy of the GNU Lesser General Public
016// License along with this library; if not, write to the Free Software
017// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
018////////////////////////////////////////////////////////////////////////////////
019
020package com.puppycrawl.tools.checkstyle.api;
021
022import java.io.Serializable;
023import java.util.Map;
024
025/**
026 * A Configuration is used to configure a Configurable component.  The general
027 * idea of Configuration/Configurable was taken from <a target="_top"
028 * href="http://avalon.apache.org/closed.html">Jakarta's Avalon framework</a>.
029 */
030public interface Configuration extends Serializable {
031
032    /**
033     * The set of attribute names.
034     *
035     * @return The set of attribute names, never null.
036     */
037    String[] getAttributeNames();
038
039    /**
040     * The attribute value for an attribute name.
041     *
042     * @param name the attribute name
043     * @return the value that is associated with name
044     * @throws CheckstyleException if name is not a valid attribute name
045     */
046    String getAttribute(String name) throws CheckstyleException;
047
048    /**
049     * The set of child configurations.
050     *
051     * @return The set of child configurations, never null.
052     */
053    Configuration[] getChildren();
054
055    /**
056     * The name of this configuration.
057     *
058     * @return The name of this configuration.
059     */
060    String getName();
061
062    /**
063     * Returns an unmodifiable map instance containing the custom messages
064     * for this configuration.
065     *
066     * @return unmodifiable map containing custom messages
067     */
068    Map<String, String> getMessages();
069
070}