001 // Copyright 2007 The Apache Software Foundation 002 // 003 // Licensed under the Apache License, Version 2.0 (the "License"); 004 // you may not use this file except in compliance with the License. 005 // You may obtain a copy of the License at 006 // 007 // http://www.apache.org/licenses/LICENSE-2.0 008 // 009 // Unless required by applicable law or agreed to in writing, software 010 // distributed under the License is distributed on an "AS IS" BASIS, 011 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 012 // See the License for the specific language governing permissions and 013 // limitations under the License. 014 015 package org.apache.hivemind.definition; 016 017 import java.util.Collection; 018 019 import org.apache.hivemind.ApplicationRuntimeException; 020 021 /** 022 * Defines a configuration extension point. 023 * The definition includes the configuration type, contributions and parsers. 024 * 025 * @author Achim Huegen 026 */ 027 public interface ConfigurationPointDefinition extends ExtensionPointDefinition 028 { 029 /** 030 * @return the fully qualified class name of the configuration type 031 */ 032 public String getConfigurationTypeName(); 033 034 /** 035 * @return the expected number of contributions to this configuration point 036 */ 037 public Occurances getExpectedContributions(); 038 039 /** 040 * @return the contributions to this configuration as instances of {@link ContributionDefinition} 041 */ 042 public Collection getContributions(); 043 044 /** 045 * Adds a contribution. 046 * @param contribution the contribution 047 * @throws ApplicationRuntimeException if this point is not visible from the 048 * module that defines the contribution 049 */ 050 public void addContribution(ContributionDefinition contribution); 051 052 /** 053 * Adds a parser definition. 054 * @param parser the parser 055 * @throws ApplicationRuntimeException if this point is not visible from the module 056 * that defines the parser or if a parser for the specified format is already defined 057 */ 058 public void addParser(ConfigurationParserDefinition parser); 059 060 /** 061 * Returns the parsers which is responsible for processing the specified <code>inputFormat</code>. 062 * @param inputFormat the input format 063 * @return the parser 064 */ 065 public ConfigurationParserDefinition getParser(String inputFormat); 066 067 /** 068 * @return returns all parsers as instances of {@link ConfigurationParserDefinition} 069 */ 070 public Collection getParsers(); 071 }