001//////////////////////////////////////////////////////////////////////////////// 002// checkstyle: Checks Java source code for adherence to a set of rules. 003// Copyright (C) 2001-2014 Oliver Burn 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//////////////////////////////////////////////////////////////////////////////// 019package com.puppycrawl.tools.checkstyle.api; 020 021import com.google.common.collect.ImmutableMap; 022 023import java.io.Serializable; 024 025 026/** 027 * A Configuration is used to configure a Configurable component. The general 028 * idea of Configuration/Configurable was taken from <a target="_top" 029 * href="http://jakarta.apache.org/avalon/">Jakarta's Avalon framework</a>. 030 * @author lkuehne 031 */ 032public interface Configuration extends Serializable 033{ 034 /** 035 * The set of attribute names. 036 * @return The set of attribute names, never null. 037 */ 038 String[] getAttributeNames(); 039 040 /** 041 * The attribute value for an attribute name. 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 * @return The set of child configurations, never null. 051 */ 052 Configuration[] getChildren(); 053 054 /** 055 * The name of this configuration. 056 * @return The name of this configuration. 057 */ 058 String getName(); 059 060 /** 061 * Returns an unmodifiable map instance containing the custom messages 062 * for this configuration. 063 * @return unmodifiable map containing custom messages 064 */ 065 ImmutableMap<String, String> getMessages(); 066}