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