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