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