KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > hivemind > definition > ConfigurationPointDefinition


1 // Copyright 2007 The Apache Software Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 package org.apache.hivemind.definition;
16
17 import java.util.Collection JavaDoc;
18
19 import org.apache.hivemind.ApplicationRuntimeException;
20
21 /**
22  * Defines a configuration extension point.
23  * The definition includes the configuration type, contributions and parsers.
24  *
25  * @author Achim Huegen
26  */

27 public interface ConfigurationPointDefinition extends ExtensionPointDefinition
28 {
29     /**
30      * @return the fully qualified class name of the configuration type
31      */

32     public String JavaDoc getConfigurationTypeName();
33
34     /**
35      * @return the expected number of contributions to this configuration point
36      */

37     public Occurances getExpectedContributions();
38
39     /**
40      * @return the contributions to this configuration as instances of {@link ContributionDefinition}
41      */

42     public Collection JavaDoc getContributions();
43
44     /**
45      * Adds a contribution.
46      * @param contribution the contribution
47      * @throws ApplicationRuntimeException if this point is not visible from the
48      * module that defines the contribution
49      */

50     public void addContribution(ContributionDefinition contribution);
51
52     /**
53      * Adds a parser definition.
54      * @param parser the parser
55      * @throws ApplicationRuntimeException if this point is not visible from the module
56      * that defines the parser or if a parser for the specified format is already defined
57      */

58     public void addParser(ConfigurationParserDefinition parser);
59     
60     /**
61      * Returns the parsers which is responsible for processing the specified <code>inputFormat</code>.
62      * @param inputFormat the input format
63      * @return the parser
64      */

65     public ConfigurationParserDefinition getParser(String JavaDoc inputFormat);
66
67     /**
68      * @return returns all parsers as instances of {@link ConfigurationParserDefinition}
69      */

70     public Collection JavaDoc getParsers();
71 }
72
Popular Tags