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;scm&gt;</code> element contains
30   * informations required to the SCM
31   *         (Source Control Management) of the project.
32   *         
33   *       
34   * 
35   * @version $Revision$ $Date$
36   */
37  @SuppressWarnings( "all" )
38  public class Scm
39      implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
40  {
41  
42        //--------------------------/
43       //- Class/Member Variables -/
44      //--------------------------/
45  
46      /**
47       * 
48       *             
49       *             The source control management system URL
50       *             that describes the repository and how to connect
51       * to the
52       *             repository. For more information, see the
53       *             <a
54       * href="https://maven.apache.org/scm/scm-url-format.html">URL
55       * format</a>
56       *             and <a
57       * href="https://maven.apache.org/scm/scms-overview.html">list
58       * of supported SCMs</a>.
59       *             This connection is read-only.
60       *             <br><b>Default value is</b>: parent value [+
61       * path adjustment] + (artifactId or project.directory
62       * property), or just parent value if
63       *             scm's
64       * <code>child.scm.connection.inherit.append.path="false"</code>
65       *             
66       *           
67       */
68      private String connection;
69  
70      /**
71       * 
72       *             
73       *             Just like <code>connection</code>, but for
74       * developers, i.e. this scm connection
75       *             will not be read only.
76       *             <br><b>Default value is</b>: parent value [+
77       * path adjustment] + (artifactId or project.directory
78       * property), or just parent value if
79       *             scm's
80       * <code>child.scm.developerConnection.inherit.append.path="false"</code>
81       *             
82       *           
83       */
84      private String developerConnection;
85  
86      /**
87       * The tag of current code. By default, it's set to HEAD during
88       * development.
89       */
90      private String tag = "HEAD";
91  
92      /**
93       * 
94       *             
95       *             The URL to the project's browsable SCM
96       * repository, such as ViewVC or Fisheye.
97       *             <br><b>Default value is</b>: parent value [+
98       * path adjustment] + (artifactId or project.directory
99       * property), or just parent value if
100      *             scm's
101      * <code>child.scm.url.inherit.append.path="false"</code>
102      *             
103      *           
104      */
105     private String url;
106 
107     /**
108      * 
109      *             
110      *             When children inherit from scm connection,
111      * append path or not? Note: While the type
112      *             of this field is <code>String</code> for
113      * technical reasons, the semantic type is actually
114      *             <code>Boolean</code>
115      *             <br><b>Default value is</b>: <code>true</code>
116      *             <br><b>Since</b>: Maven 3.6.1
117      *             
118      *           .
119      */
120     private String childScmConnectionInheritAppendPath;
121 
122     /**
123      * 
124      *             
125      *             When children inherit from scm developer
126      * connection, append path or not? Note: While the type
127      *             of this field is <code>String</code> for
128      * technical reasons, the semantic type is actually
129      *             <code>Boolean</code>
130      *             <br><b>Default value is</b>: <code>true</code>
131      *             <br><b>Since</b>: Maven 3.6.1
132      *             
133      *           .
134      */
135     private String childScmDeveloperConnectionInheritAppendPath;
136 
137     /**
138      * 
139      *             
140      *             When children inherit from scm url, append path
141      * or not? Note: While the type
142      *             of this field is <code>String</code> for
143      * technical reasons, the semantic type is actually
144      *             <code>Boolean</code>
145      *             <br><b>Default value is</b>: <code>true</code>
146      *             <br><b>Since</b>: Maven 3.6.1
147      *             
148      *           .
149      */
150     private String childScmUrlInheritAppendPath;
151 
152     /**
153      * Field locations.
154      */
155     private java.util.Map<Object, InputLocation> locations;
156 
157     /**
158      * Field location.
159      */
160     private InputLocation location;
161 
162     /**
163      * Field connectionLocation.
164      */
165     private InputLocation connectionLocation;
166 
167     /**
168      * Field developerConnectionLocation.
169      */
170     private InputLocation developerConnectionLocation;
171 
172     /**
173      * Field tagLocation.
174      */
175     private InputLocation tagLocation;
176 
177     /**
178      * Field urlLocation.
179      */
180     private InputLocation urlLocation;
181 
182     /**
183      * Field childScmConnectionInheritAppendPathLocation.
184      */
185     private InputLocation childScmConnectionInheritAppendPathLocation;
186 
187     /**
188      * Field childScmDeveloperConnectionInheritAppendPathLocation.
189      */
190     private InputLocation childScmDeveloperConnectionInheritAppendPathLocation;
191 
192     /**
193      * Field childScmUrlInheritAppendPathLocation.
194      */
195     private InputLocation childScmUrlInheritAppendPathLocation;
196 
197 
198       //-----------/
199      //- Methods -/
200     //-----------/
201 
202     /**
203      * Method clone.
204      * 
205      * @return Scm
206      */
207     public Scm clone()
208     {
209         try
210         {
211             Scm copy = (Scm) super.clone();
212 
213             if ( copy.locations != null )
214             {
215                 copy.locations = new java.util.LinkedHashMap( copy.locations );
216             }
217 
218             return copy;
219         }
220         catch ( java.lang.Exception ex )
221         {
222             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
223                 + " does not support clone()" ).initCause( ex );
224         }
225     } //-- Scm clone()
226 
227     /**
228      * Get when children inherit from scm connection, append path
229      * or not? Note: While the type
230      *             of this field is <code>String</code> for
231      * technical reasons, the semantic type is actually
232      *             <code>Boolean</code>
233      *             <br><b>Default value is</b>: <code>true</code>
234      *             <br><b>Since</b>: Maven 3.6.1.
235      * 
236      * @return String
237      */
238     public String getChildScmConnectionInheritAppendPath()
239     {
240         return this.childScmConnectionInheritAppendPath;
241     } //-- String getChildScmConnectionInheritAppendPath()
242 
243     /**
244      * Get when children inherit from scm developer connection,
245      * append path or not? Note: While the type
246      *             of this field is <code>String</code> for
247      * technical reasons, the semantic type is actually
248      *             <code>Boolean</code>
249      *             <br><b>Default value is</b>: <code>true</code>
250      *             <br><b>Since</b>: Maven 3.6.1.
251      * 
252      * @return String
253      */
254     public String getChildScmDeveloperConnectionInheritAppendPath()
255     {
256         return this.childScmDeveloperConnectionInheritAppendPath;
257     } //-- String getChildScmDeveloperConnectionInheritAppendPath()
258 
259     /**
260      * Get when children inherit from scm url, append path or not?
261      * Note: While the type
262      *             of this field is <code>String</code> for
263      * technical reasons, the semantic type is actually
264      *             <code>Boolean</code>
265      *             <br><b>Default value is</b>: <code>true</code>
266      *             <br><b>Since</b>: Maven 3.6.1.
267      * 
268      * @return String
269      */
270     public String getChildScmUrlInheritAppendPath()
271     {
272         return this.childScmUrlInheritAppendPath;
273     } //-- String getChildScmUrlInheritAppendPath()
274 
275     /**
276      * Get the source control management system URL
277      *             that describes the repository and how to connect
278      * to the
279      *             repository. For more information, see the
280      *             <a
281      * href="https://maven.apache.org/scm/scm-url-format.html">URL
282      * format</a>
283      *             and <a
284      * href="https://maven.apache.org/scm/scms-overview.html">list
285      * of supported SCMs</a>.
286      *             This connection is read-only.
287      *             <br><b>Default value is</b>: parent value [+
288      * path adjustment] + (artifactId or project.directory
289      * property), or just parent value if
290      *             scm's
291      * <code>child.scm.connection.inherit.append.path="false"</code>
292      * 
293      * @return String
294      */
295     public String getConnection()
296     {
297         return this.connection;
298     } //-- String getConnection()
299 
300     /**
301      * Get just like <code>connection</code>, but for developers,
302      * i.e. this scm connection
303      *             will not be read only.
304      *             <br><b>Default value is</b>: parent value [+
305      * path adjustment] + (artifactId or project.directory
306      * property), or just parent value if
307      *             scm's
308      * <code>child.scm.developerConnection.inherit.append.path="false"</code>
309      * 
310      * @return String
311      */
312     public String getDeveloperConnection()
313     {
314         return this.developerConnection;
315     } //-- String getDeveloperConnection()
316 
317     /**
318      * 
319      * 
320      * @param key a key object.
321      * @return InputLocation
322      */
323     public InputLocation getLocation( Object key )
324     {
325         if ( key instanceof String )
326         {
327             switch ( ( String ) key )
328             {
329                 case "" :
330                 {
331                     return this.location;
332                 }
333                 case "connection" :
334                 {
335                     return connectionLocation;
336                 }
337                 case "developerConnection" :
338                 {
339                     return developerConnectionLocation;
340                 }
341                 case "tag" :
342                 {
343                     return tagLocation;
344                 }
345                 case "url" :
346                 {
347                     return urlLocation;
348                 }
349                 case "childScmConnectionInheritAppendPath" :
350                 {
351                     return childScmConnectionInheritAppendPathLocation;
352                 }
353                 case "childScmDeveloperConnectionInheritAppendPath" :
354                 {
355                     return childScmDeveloperConnectionInheritAppendPathLocation;
356                 }
357                 case "childScmUrlInheritAppendPath" :
358                 {
359                     return childScmUrlInheritAppendPathLocation;
360                 }
361                 default :
362                 {
363                     return getOtherLocation( key );
364                 }
365                 }
366             }
367             else
368             {
369                 return getOtherLocation( key );
370             }
371     } //-- InputLocation getLocation( Object )
372 
373     /**
374      * 
375      * 
376      * @param key a key object.
377      * @param location a location object.
378      */
379     public void setLocation( Object key, InputLocation location )
380     {
381         if ( key instanceof String )
382         {
383             switch ( ( String ) key )
384             {
385                 case "" :
386                 {
387                     this.location = location;
388                     return;
389                 }
390                 case "connection" :
391                 {
392                     connectionLocation = location;
393                     return;
394                 }
395                 case "developerConnection" :
396                 {
397                     developerConnectionLocation = location;
398                     return;
399                 }
400                 case "tag" :
401                 {
402                     tagLocation = location;
403                     return;
404                 }
405                 case "url" :
406                 {
407                     urlLocation = location;
408                     return;
409                 }
410                 case "childScmConnectionInheritAppendPath" :
411                 {
412                     childScmConnectionInheritAppendPathLocation = location;
413                     return;
414                 }
415                 case "childScmDeveloperConnectionInheritAppendPath" :
416                 {
417                     childScmDeveloperConnectionInheritAppendPathLocation = location;
418                     return;
419                 }
420                 case "childScmUrlInheritAppendPath" :
421                 {
422                     childScmUrlInheritAppendPathLocation = location;
423                     return;
424                 }
425                 default :
426                 {
427                     setOtherLocation( key, location );
428                     return;
429                 }
430             }
431         }
432         else
433         {
434             setOtherLocation( key, location );
435         }
436     } //-- void setLocation( Object, InputLocation )
437 
438     /**
439      * 
440      * 
441      * @param key a key object.
442      * @param location a location object.
443      */
444     public void setOtherLocation( Object key, InputLocation location )
445     {
446         if ( location != null )
447         {
448             if ( this.locations == null )
449             {
450                 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
451             }
452             this.locations.put( key, location );
453         }
454     } //-- void setOtherLocation( Object, InputLocation )
455 
456     /**
457      * 
458      * 
459      * @param key a key object.
460      * @return InputLocation
461      */
462     private InputLocation getOtherLocation( Object key )
463     {
464         return ( locations != null ) ? locations.get( key ) : null;
465     } //-- InputLocation getOtherLocation( Object )
466 
467     /**
468      * Get the tag of current code. By default, it's set to HEAD
469      * during development.
470      * 
471      * @return String
472      */
473     public String getTag()
474     {
475         return this.tag;
476     } //-- String getTag()
477 
478     /**
479      * Get the URL to the project's browsable SCM repository, such
480      * as ViewVC or Fisheye.
481      *             <br><b>Default value is</b>: parent value [+
482      * path adjustment] + (artifactId or project.directory
483      * property), or just parent value if
484      *             scm's
485      * <code>child.scm.url.inherit.append.path="false"</code>
486      * 
487      * @return String
488      */
489     public String getUrl()
490     {
491         return this.url;
492     } //-- String getUrl()
493 
494     /**
495      * Set when children inherit from scm connection, append path
496      * or not? Note: While the type
497      *             of this field is <code>String</code> for
498      * technical reasons, the semantic type is actually
499      *             <code>Boolean</code>
500      *             <br><b>Default value is</b>: <code>true</code>
501      *             <br><b>Since</b>: Maven 3.6.1.
502      * 
503      * @param childScmConnectionInheritAppendPath a
504      * childScmConnectionInheritAppendPath object.
505      */
506     public void setChildScmConnectionInheritAppendPath( String childScmConnectionInheritAppendPath )
507     {
508         this.childScmConnectionInheritAppendPath = childScmConnectionInheritAppendPath;
509     } //-- void setChildScmConnectionInheritAppendPath( String )
510 
511     /**
512      * Set when children inherit from scm developer connection,
513      * append path or not? Note: While the type
514      *             of this field is <code>String</code> for
515      * technical reasons, the semantic type is actually
516      *             <code>Boolean</code>
517      *             <br><b>Default value is</b>: <code>true</code>
518      *             <br><b>Since</b>: Maven 3.6.1.
519      * 
520      * @param childScmDeveloperConnectionInheritAppendPath a
521      * childScmDeveloperConnectionInheritAppendPath object.
522      */
523     public void setChildScmDeveloperConnectionInheritAppendPath( String childScmDeveloperConnectionInheritAppendPath )
524     {
525         this.childScmDeveloperConnectionInheritAppendPath = childScmDeveloperConnectionInheritAppendPath;
526     } //-- void setChildScmDeveloperConnectionInheritAppendPath( String )
527 
528     /**
529      * Set when children inherit from scm url, append path or not?
530      * Note: While the type
531      *             of this field is <code>String</code> for
532      * technical reasons, the semantic type is actually
533      *             <code>Boolean</code>
534      *             <br><b>Default value is</b>: <code>true</code>
535      *             <br><b>Since</b>: Maven 3.6.1.
536      * 
537      * @param childScmUrlInheritAppendPath a
538      * childScmUrlInheritAppendPath object.
539      */
540     public void setChildScmUrlInheritAppendPath( String childScmUrlInheritAppendPath )
541     {
542         this.childScmUrlInheritAppendPath = childScmUrlInheritAppendPath;
543     } //-- void setChildScmUrlInheritAppendPath( String )
544 
545     /**
546      * Set the source control management system URL
547      *             that describes the repository and how to connect
548      * to the
549      *             repository. For more information, see the
550      *             <a
551      * href="https://maven.apache.org/scm/scm-url-format.html">URL
552      * format</a>
553      *             and <a
554      * href="https://maven.apache.org/scm/scms-overview.html">list
555      * of supported SCMs</a>.
556      *             This connection is read-only.
557      *             <br><b>Default value is</b>: parent value [+
558      * path adjustment] + (artifactId or project.directory
559      * property), or just parent value if
560      *             scm's
561      * <code>child.scm.connection.inherit.append.path="false"</code>
562      * 
563      * @param connection a connection object.
564      */
565     public void setConnection( String connection )
566     {
567         this.connection = connection;
568     } //-- void setConnection( String )
569 
570     /**
571      * Set just like <code>connection</code>, but for developers,
572      * i.e. this scm connection
573      *             will not be read only.
574      *             <br><b>Default value is</b>: parent value [+
575      * path adjustment] + (artifactId or project.directory
576      * property), or just parent value if
577      *             scm's
578      * <code>child.scm.developerConnection.inherit.append.path="false"</code>
579      * 
580      * @param developerConnection a developerConnection object.
581      */
582     public void setDeveloperConnection( String developerConnection )
583     {
584         this.developerConnection = developerConnection;
585     } //-- void setDeveloperConnection( String )
586 
587     /**
588      * Set the tag of current code. By default, it's set to HEAD
589      * during development.
590      * 
591      * @param tag a tag object.
592      */
593     public void setTag( String tag )
594     {
595         this.tag = tag;
596     } //-- void setTag( String )
597 
598     /**
599      * Set the URL to the project's browsable SCM repository, such
600      * as ViewVC or Fisheye.
601      *             <br><b>Default value is</b>: parent value [+
602      * path adjustment] + (artifactId or project.directory
603      * property), or just parent value if
604      *             scm's
605      * <code>child.scm.url.inherit.append.path="false"</code>
606      * 
607      * @param url a url object.
608      */
609     public void setUrl( String url )
610     {
611         this.url = url;
612     } //-- void setUrl( String )
613 
614     
615             
616 
617     public boolean isChildScmConnectionInheritAppendPath()
618     {
619         return ( childScmConnectionInheritAppendPath != null ) ? Boolean.parseBoolean( childScmConnectionInheritAppendPath ) : true;
620     }
621 
622     public void setChildScmConnectionInheritAppendPath( boolean childScmConnectionInheritAppendPath )
623     {
624         this.childScmConnectionInheritAppendPath = String.valueOf( childScmConnectionInheritAppendPath );
625     }
626 
627     public boolean isChildScmDeveloperConnectionInheritAppendPath()
628     {
629         return ( childScmDeveloperConnectionInheritAppendPath != null ) ? Boolean.parseBoolean( childScmDeveloperConnectionInheritAppendPath ) : true;
630     }
631 
632     public void setChildScmDeveloperConnectionInheritAppendPath( boolean childScmDeveloperConnectionInheritAppendPath )
633     {
634         this.childScmDeveloperConnectionInheritAppendPath = String.valueOf( childScmDeveloperConnectionInheritAppendPath );
635     }
636 
637     public boolean isChildScmUrlInheritAppendPath()
638     {
639         return ( childScmUrlInheritAppendPath != null ) ? Boolean.parseBoolean( childScmUrlInheritAppendPath ) : true;
640     }
641 
642     public void setChildScmUrlInheritAppendPath( boolean childScmUrlInheritAppendPath )
643     {
644         this.childScmUrlInheritAppendPath = String.valueOf( childScmUrlInheritAppendPath );
645     }
646 
647             
648           
649     
650             
651     /**
652      * @see java.lang.Object#toString()
653      */
654     public String toString()
655     {
656         return "Scm {connection=" + connection + "}";
657     }
658             
659           
660 }