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    * Contains the configuration information of the container like
10   * Plugin.
11   * 
12   * @version $Revision$ $Date$
13   */
14  @SuppressWarnings( "all" )
15  public class ConfigurationContainer
16      implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
17  {
18  
19        //--------------------------/
20       //- Class/Member Variables -/
21      //--------------------------/
22  
23      /**
24       * 
25       *             
26       *             Whether any configuration should be propagated
27       * to child POMs. Note: While the type
28       *             of this field is <code>String</code> for
29       * technical reasons, the semantic type is actually
30       *             <code>Boolean</code>. Default value is
31       * <code>true</code>.
32       *             
33       *           
34       */
35      private String inherited;
36  
37      /**
38       * 
39       *             
40       *             <p>The configuration as DOM object.</p>
41       *             <p>By default, every element content is trimmed,
42       * but starting with Maven 3.1.0, you can add
43       *             <code>xml:space="preserve"</code> to elements
44       * you want to preserve whitespace.</p>
45       *             <p>You can control how child POMs inherit
46       * configuration from parent POMs by adding
47       * <code>combine.children</code>
48       *             or <code>combine.self</code> attributes to the
49       * children of the configuration element:</p>
50       *             <ul>
51       *             <li><code>combine.children</code>: available
52       * values are <code>merge</code> (default) and
53       * <code>append</code>,</li>
54       *             <li><code>combine.self</code>: available values
55       * are <code>merge</code> (default) and
56       * <code>override</code>.</li>
57       *             </ul>
58       *             <p>See <a
59       * href="https://maven.apache.org/pom.html#Plugins">POM
60       * Reference documentation</a> and
61       *             <a
62       * href="https://codehaus-plexus.github.io/plexus-utils/apidocs/org/codehaus/plexus/util/xml/Xpp3DomUtils.html">Xpp3DomUtils</a>
63       *             for more information.</p>
64       *             
65       *           
66       */
67      private Object configuration;
68  
69      /**
70       * Field locations.
71       */
72      private java.util.Map<Object, InputLocation> locations;
73  
74      /**
75       * Field location.
76       */
77      private InputLocation location;
78  
79      /**
80       * Field inheritedLocation.
81       */
82      private InputLocation inheritedLocation;
83  
84      /**
85       * Field configurationLocation.
86       */
87      private InputLocation configurationLocation;
88  
89  
90        //-----------/
91       //- Methods -/
92      //-----------/
93  
94      /**
95       * Method clone.
96       * 
97       * @return ConfigurationContainer
98       */
99      public ConfigurationContainer clone()
100     {
101         try
102         {
103             ConfigurationContainer copy = (ConfigurationContainer) super.clone();
104 
105             if ( this.configuration != null )
106             {
107                 copy.configuration = new org.codehaus.plexus.util.xml.Xpp3Dom( (org.codehaus.plexus.util.xml.Xpp3Dom) this.configuration );
108             }
109 
110             if ( copy.locations != null )
111             {
112                 copy.locations = new java.util.LinkedHashMap( copy.locations );
113             }
114 
115             return copy;
116         }
117         catch ( java.lang.Exception ex )
118         {
119             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
120                 + " does not support clone()" ).initCause( ex );
121         }
122     } //-- ConfigurationContainer clone()
123 
124     /**
125      * Get <p>The configuration as DOM object.</p>
126      *             <p>By default, every element content is trimmed,
127      * but starting with Maven 3.1.0, you can add
128      *             <code>xml:space="preserve"</code> to elements
129      * you want to preserve whitespace.</p>
130      *             <p>You can control how child POMs inherit
131      * configuration from parent POMs by adding
132      * <code>combine.children</code>
133      *             or <code>combine.self</code> attributes to the
134      * children of the configuration element:</p>
135      *             <ul>
136      *             <li><code>combine.children</code>: available
137      * values are <code>merge</code> (default) and
138      * <code>append</code>,</li>
139      *             <li><code>combine.self</code>: available values
140      * are <code>merge</code> (default) and
141      * <code>override</code>.</li>
142      *             </ul>
143      *             <p>See <a
144      * href="https://maven.apache.org/pom.html#Plugins">POM
145      * Reference documentation</a> and
146      *             <a
147      * href="https://codehaus-plexus.github.io/plexus-utils/apidocs/org/codehaus/plexus/util/xml/Xpp3DomUtils.html">Xpp3DomUtils</a>
148      *             for more information.</p>
149      * 
150      * @return Object
151      */
152     public Object getConfiguration()
153     {
154         return this.configuration;
155     } //-- Object getConfiguration()
156 
157     /**
158      * Get whether any configuration should be propagated to child
159      * POMs. Note: While the type
160      *             of this field is <code>String</code> for
161      * technical reasons, the semantic type is actually
162      *             <code>Boolean</code>. Default value is
163      * <code>true</code>.
164      * 
165      * @return String
166      */
167     public String getInherited()
168     {
169         return this.inherited;
170     } //-- String getInherited()
171 
172     /**
173      * 
174      * 
175      * @param key
176      * @return InputLocation
177      */
178     public InputLocation getLocation( Object key )
179     {
180         if ( key instanceof String )
181         {
182             switch ( ( String ) key )
183             {
184                 case "" :
185                 {
186                     return this.location;
187                 }
188                 case "inherited" :
189                 {
190                     return inheritedLocation;
191                 }
192                 case "configuration" :
193                 {
194                     return configurationLocation;
195                 }
196                 default :
197                 {
198                     return getOtherLocation( key );
199                 }
200                 }
201             }
202             else
203             {
204                 return getOtherLocation( key );
205             }
206     } //-- InputLocation getLocation( Object )
207 
208     /**
209      * 
210      * 
211      * @param key
212      * @param location
213      */
214     public void setLocation( Object key, InputLocation location )
215     {
216         if ( key instanceof String )
217         {
218             switch ( ( String ) key )
219             {
220                 case "" :
221                 {
222                     this.location = location;
223                     return;
224                 }
225                 case "inherited" :
226                 {
227                     inheritedLocation = location;
228                     return;
229                 }
230                 case "configuration" :
231                 {
232                     configurationLocation = location;
233                     return;
234                 }
235                 default :
236                 {
237                     setOtherLocation( key, location );
238                     return;
239                 }
240                 }
241             }
242             else
243             {
244                 setOtherLocation( key, location );
245             }
246     } //-- void setLocation( Object, InputLocation )
247 
248     /**
249      * 
250      * 
251      * @param key
252      * @param location
253      */
254     public void setOtherLocation( Object key, InputLocation location )
255     {
256         if ( location != null )
257         {
258             if ( this.locations == null )
259             {
260                 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
261             }
262             this.locations.put( key, location );
263         }
264     } //-- void setOtherLocation( Object, InputLocation )
265 
266     /**
267      * 
268      * 
269      * @param key
270      * @return InputLocation
271      */
272     private InputLocation getOtherLocation( Object key )
273     {
274         return ( locations != null ) ? locations.get( key ) : null;
275     } //-- InputLocation getOtherLocation( Object )
276 
277     /**
278      * Set <p>The configuration as DOM object.</p>
279      *             <p>By default, every element content is trimmed,
280      * but starting with Maven 3.1.0, you can add
281      *             <code>xml:space="preserve"</code> to elements
282      * you want to preserve whitespace.</p>
283      *             <p>You can control how child POMs inherit
284      * configuration from parent POMs by adding
285      * <code>combine.children</code>
286      *             or <code>combine.self</code> attributes to the
287      * children of the configuration element:</p>
288      *             <ul>
289      *             <li><code>combine.children</code>: available
290      * values are <code>merge</code> (default) and
291      * <code>append</code>,</li>
292      *             <li><code>combine.self</code>: available values
293      * are <code>merge</code> (default) and
294      * <code>override</code>.</li>
295      *             </ul>
296      *             <p>See <a
297      * href="https://maven.apache.org/pom.html#Plugins">POM
298      * Reference documentation</a> and
299      *             <a
300      * href="https://codehaus-plexus.github.io/plexus-utils/apidocs/org/codehaus/plexus/util/xml/Xpp3DomUtils.html">Xpp3DomUtils</a>
301      *             for more information.</p>
302      * 
303      * @param configuration
304      */
305     public void setConfiguration( Object configuration )
306     {
307         this.configuration = configuration;
308     } //-- void setConfiguration( Object )
309 
310     /**
311      * Set whether any configuration should be propagated to child
312      * POMs. Note: While the type
313      *             of this field is <code>String</code> for
314      * technical reasons, the semantic type is actually
315      *             <code>Boolean</code>. Default value is
316      * <code>true</code>.
317      * 
318      * @param inherited
319      */
320     public void setInherited( String inherited )
321     {
322         this.inherited = inherited;
323     } //-- void setInherited( String )
324 
325     
326             
327     public boolean isInherited()
328     {
329         return ( inherited != null ) ? Boolean.parseBoolean( inherited ) : true;
330     }
331 
332     public void setInherited( boolean inherited )
333     {
334         this.inherited = String.valueOf( inherited );
335     }
336 
337     private boolean inheritanceApplied = true;
338 
339     public void unsetInheritanceApplied()
340     {
341         this.inheritanceApplied = false;
342     }
343 
344     public boolean isInheritanceApplied()
345     {
346         return inheritanceApplied;
347     }
348             
349           
350 }