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.impl;
016    
017    import org.apache.hivemind.Location;
018    import org.apache.hivemind.definition.Contribution;
019    import org.apache.hivemind.definition.ContributionDefinition;
020    import org.apache.hivemind.definition.ModuleDefinition;
021    
022    /**
023     * Default implementation of {@link ContributionDefinition}.
024     * 
025     * @author Achim Huegen
026     */
027    public class ContributionDefinitionImpl extends ExtensionDefinitionImpl implements ContributionDefinition
028    {
029        private Contribution _contribution;
030        private boolean _initial;
031    
032        public ContributionDefinitionImpl(ModuleDefinition module)
033        {
034            super(module);
035        }
036    
037        public ContributionDefinitionImpl(ModuleDefinition module, Location location,
038                Contribution contribution, boolean initial)
039        {
040            super(module, location);
041            _contribution = contribution;
042            _initial = initial;
043        }
044    
045        /**
046         * @see org.apache.hivemind.definition.ContributionDefinition#getContribution()
047         */
048        public Contribution getContribution()
049        {
050            return _contribution;
051        }
052    
053        /**
054         * Sets the contribution implementation.
055         */
056        public void setContribution(Contribution contribution)
057        {
058            _contribution = contribution;
059        }
060    
061        /**
062         * @see org.apache.hivemind.definition.ContributionDefinition#isInitalContribution()
063         */
064        public boolean isInitalContribution()
065        {
066            return _initial;
067        }
068    }