View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   // Generated by Modello 1.11,
3   // any modifications will be overwritten.
4   // ==============================================================
5   
6   package org.apache.maven.model;
7   
8   /**
9    * 
10   *         
11   *         The <code>&lt;exclusion&gt;</code> element contains
12   * informations required to exclude
13   *         an artifact to the project.
14   *         
15   *       
16   * 
17   * @version $Revision$ $Date$
18   */
19  @SuppressWarnings( "all" )
20  public class Exclusion
21      implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
22  {
23  
24        //--------------------------/
25       //- Class/Member Variables -/
26      //--------------------------/
27  
28      /**
29       * The group ID of the project to exclude.
30       */
31      private String groupId;
32  
33      /**
34       * The artifact ID of the project to exclude.
35       */
36      private String artifactId;
37  
38      /**
39       * Field locations.
40       */
41      private java.util.Map<Object, InputLocation> locations;
42  
43      /**
44       * Field location.
45       */
46      private InputLocation location;
47  
48      /**
49       * Field groupIdLocation.
50       */
51      private InputLocation groupIdLocation;
52  
53      /**
54       * Field artifactIdLocation.
55       */
56      private InputLocation artifactIdLocation;
57  
58  
59        //-----------/
60       //- Methods -/
61      //-----------/
62  
63      /**
64       * Method clone.
65       * 
66       * @return Exclusion
67       */
68      public Exclusion clone()
69      {
70          try
71          {
72              Exclusion copy = (Exclusion) super.clone();
73  
74              if ( copy.locations != null )
75              {
76                  copy.locations = new java.util.LinkedHashMap( copy.locations );
77              }
78  
79              return copy;
80          }
81          catch ( java.lang.Exception ex )
82          {
83              throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
84                  + " does not support clone()" ).initCause( ex );
85          }
86      } //-- Exclusion clone()
87  
88      /**
89       * Get the artifact ID of the project to exclude.
90       * 
91       * @return String
92       */
93      public String getArtifactId()
94      {
95          return this.artifactId;
96      } //-- String getArtifactId()
97  
98      /**
99       * Get the group ID of the project to exclude.
100      * 
101      * @return String
102      */
103     public String getGroupId()
104     {
105         return this.groupId;
106     } //-- String getGroupId()
107 
108     /**
109      * 
110      * 
111      * @param key
112      * @return InputLocation
113      */
114     public InputLocation getLocation( Object key )
115     {
116         if ( key instanceof String )
117         {
118             switch ( ( String ) key )
119             {
120                 case "" :
121                 {
122                     return this.location;
123                 }
124                 case "groupId" :
125                 {
126                     return groupIdLocation;
127                 }
128                 case "artifactId" :
129                 {
130                     return artifactIdLocation;
131                 }
132                 default :
133                 {
134                     return getOtherLocation( key );
135                 }
136                 }
137             }
138             else
139             {
140                 return getOtherLocation( key );
141             }
142     } //-- InputLocation getLocation( Object )
143 
144     /**
145      * 
146      * 
147      * @param key
148      * @param location
149      */
150     public void setLocation( Object key, InputLocation location )
151     {
152         if ( key instanceof String )
153         {
154             switch ( ( String ) key )
155             {
156                 case "" :
157                 {
158                     this.location = location;
159                     return;
160                 }
161                 case "groupId" :
162                 {
163                     groupIdLocation = location;
164                     return;
165                 }
166                 case "artifactId" :
167                 {
168                     artifactIdLocation = location;
169                     return;
170                 }
171                 default :
172                 {
173                     setOtherLocation( key, location );
174                     return;
175                 }
176                 }
177             }
178             else
179             {
180                 setOtherLocation( key, location );
181             }
182     } //-- void setLocation( Object, InputLocation )
183 
184     /**
185      * 
186      * 
187      * @param key
188      * @param location
189      */
190     public void setOtherLocation( Object key, InputLocation location )
191     {
192         if ( location != null )
193         {
194             if ( this.locations == null )
195             {
196                 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
197             }
198             this.locations.put( key, location );
199         }
200     } //-- void setOtherLocation( Object, InputLocation )
201 
202     /**
203      * 
204      * 
205      * @param key
206      * @return InputLocation
207      */
208     private InputLocation getOtherLocation( Object key )
209     {
210         return ( locations != null ) ? locations.get( key ) : null;
211     } //-- InputLocation getOtherLocation( Object )
212 
213     /**
214      * Set the artifact ID of the project to exclude.
215      * 
216      * @param artifactId
217      */
218     public void setArtifactId( String artifactId )
219     {
220         this.artifactId = artifactId;
221     } //-- void setArtifactId( String )
222 
223     /**
224      * Set the group ID of the project to exclude.
225      * 
226      * @param groupId
227      */
228     public void setGroupId( String groupId )
229     {
230         this.groupId = groupId;
231     } //-- void setGroupId( String )
232 
233 }