001    // =================== DO NOT EDIT THIS FILE ====================
002    // Generated by Modello 1.7,
003    // any modifications will be overwritten.
004    // ==============================================================
005    
006    package org.apache.maven.model;
007    
008    /**
009     * Section for management of default dependency information for use
010     * in a group of
011     *         POMs.
012     * 
013     * @version $Revision$ $Date$
014     */
015    @SuppressWarnings( "all" )
016    public class DependencyManagement
017        implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
018    {
019    
020          //--------------------------/
021         //- Class/Member Variables -/
022        //--------------------------/
023    
024        /**
025         * Field dependencies.
026         */
027        private java.util.List<Dependency> dependencies;
028    
029        /**
030         * Field locations.
031         */
032        private java.util.Map<Object, InputLocation> locations;
033    
034    
035          //-----------/
036         //- Methods -/
037        //-----------/
038    
039        /**
040         * Method addDependency.
041         * 
042         * @param dependency
043         */
044        public void addDependency( Dependency dependency )
045        {
046            getDependencies().add( dependency );
047        } //-- void addDependency( Dependency )
048    
049        /**
050         * Method clone.
051         * 
052         * @return DependencyManagement
053         */
054        public DependencyManagement clone()
055        {
056            try
057            {
058                DependencyManagement copy = (DependencyManagement) super.clone();
059    
060                if ( this.dependencies != null )
061                {
062                    copy.dependencies = new java.util.ArrayList<Dependency>();
063                    for ( Dependency item : this.dependencies )
064                    {
065                        copy.dependencies.add( ( (Dependency) item).clone() );
066                    }
067                }
068    
069                if ( copy.locations != null )
070                {
071                    copy.locations = new java.util.LinkedHashMap( copy.locations );
072                }
073    
074                return copy;
075            }
076            catch ( java.lang.Exception ex )
077            {
078                throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
079                    + " does not support clone()" ).initCause( ex );
080            }
081        } //-- DependencyManagement clone()
082    
083        /**
084         * Method getDependencies.
085         * 
086         * @return List
087         */
088        public java.util.List<Dependency> getDependencies()
089        {
090            if ( this.dependencies == null )
091            {
092                this.dependencies = new java.util.ArrayList<Dependency>();
093            }
094    
095            return this.dependencies;
096        } //-- java.util.List<Dependency> getDependencies()
097    
098        /**
099         * 
100         * 
101         * @param key
102         * @return InputLocation
103         */
104        public InputLocation getLocation( Object key )
105        {
106            return ( locations != null ) ? locations.get( key ) : null;
107        } //-- InputLocation getLocation( Object )
108    
109        /**
110         * Method removeDependency.
111         * 
112         * @param dependency
113         */
114        public void removeDependency( Dependency dependency )
115        {
116            getDependencies().remove( dependency );
117        } //-- void removeDependency( Dependency )
118    
119        /**
120         * Set the dependencies specified here are not used until they
121         * are referenced in a
122         *             POM within the group. This allows the
123         * specification of a "standard" version for a
124         *             particular dependency.
125         * 
126         * @param dependencies
127         */
128        public void setDependencies( java.util.List<Dependency> dependencies )
129        {
130            this.dependencies = dependencies;
131        } //-- void setDependencies( java.util.List )
132    
133        /**
134         * 
135         * 
136         * @param key
137         * @param location
138         */
139        public void setLocation( Object key, InputLocation location )
140        {
141            if ( location != null )
142            {
143                if ( this.locations == null )
144                {
145                    this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
146                }
147                this.locations.put( key, location );
148            }
149        } //-- void setLocation( Object, InputLocation )
150    
151    }