001////////////////////////////////////////////////////////////////////////////////
002// checkstyle: Checks Java source code for adherence to a set of rules.
003// Copyright (C) 2001-2018 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 * @author lkuehne
030 */
031public interface Configuration extends Serializable {
032
033    /**
034     * The set of attribute names.
035     * @return The set of attribute names, never null.
036     */
037    String[] getAttributeNames();
038
039    /**
040     * The attribute value for an attribute name.
041     * @param name the attribute name
042     * @return the value that is associated with name
043     * @throws CheckstyleException if name is not a valid attribute name
044     */
045    String getAttribute(String name) throws CheckstyleException;
046
047    /**
048     * The set of child configurations.
049     * @return The set of child configurations, never null.
050     */
051    Configuration[] getChildren();
052
053    /**
054     * The name of this configuration.
055     * @return The name of this configuration.
056     */
057    String getName();
058
059    /**
060     * Returns an unmodifiable map instance containing the custom messages
061     * for this configuration.
062     * @return unmodifiable map containing custom messages
063     */
064    Map<String, String> getMessages();
065
066}