1 // =================== DO NOT EDIT THIS FILE ==================== 2 // Generated by Modello 1.9.1, 3 // any modifications will be overwritten. 4 // ============================================================== 5 6 package org.apache.maven.consumer.model; 7 8 /** 9 * 10 * 11 * The <code><project></code> element is the root of 12 * the descriptor. 13 * The following table lists all of the possible child 14 * elements. 15 * 16 * 17 * 18 * @version $Revision$ $Date$ 19 */ 20 @SuppressWarnings( "all" ) 21 public class Model 22 extends ModelBase 23 implements java.io.Serializable, java.lang.Cloneable 24 { 25 26 //--------------------------/ 27 //- Class/Member Variables -/ 28 //--------------------------/ 29 30 /** 31 * Declares to which version of project descriptor this POM 32 * conforms. 33 */ 34 private String modelVersion; 35 36 /** 37 * 38 * 39 * A universally unique identifier for a project. 40 * It is normal to 41 * use a fully-qualified package name to 42 * distinguish it from other 43 * projects with a similar name (eg. 44 * <code>org.apache.maven</code>). 45 * 46 * 47 */ 48 private String groupId; 49 50 /** 51 * The identifier for this artifact that is unique within the 52 * group given by the 53 * group ID. An artifact is something that is 54 * either produced or used by a project. 55 * Examples of artifacts produced by Maven for a 56 * project include: JARs, source and binary 57 * distributions, and WARs. 58 */ 59 private String artifactId; 60 61 /** 62 * The current version of the artifact produced by this project. 63 */ 64 private String version; 65 66 /** 67 * 68 * 69 * The type of artifact this project produces, for 70 * example <code>jar</code> 71 * <code>war</code> 72 * <code>ear</code> 73 * <code>pom</code>. 74 * Plugins can create their own packaging, and 75 * therefore their own packaging types, 76 * so this list does not contain all possible 77 * types. 78 * 79 * 80 */ 81 private String packaging = "jar"; 82 83 /** 84 * The full name of the project. 85 */ 86 private String name; 87 88 /** 89 * A detailed description of the project, used by Maven 90 * whenever it needs to 91 * describe the project, such as on the web site. 92 * While this element can be specified as 93 * CDATA to enable the use of HTML tags within the 94 * description, it is discouraged to allow 95 * plain text representation. If you need to modify 96 * the index page of the generated web 97 * site, you are able to specify your own instead 98 * of adjusting this text. 99 */ 100 private String description; 101 102 /** 103 * 104 * 105 * The URL to the project's homepage. 106 * <br><b>Default value is</b>: parent value [+ 107 * path adjustment] + (artifactId or 108 * <code>project.directory</code> property) 109 * 110 * . 111 */ 112 private String url; 113 114 /** 115 * The year of the project's inception, specified with 4 116 * digits. This value is 117 * used when generating copyright notices as well 118 * as being informational. 119 */ 120 private String inceptionYear; 121 122 /** 123 * This element describes various attributes of the 124 * organization to which the 125 * project belongs. These attributes are utilized 126 * when documentation is created (for 127 * copyright notices and links). 128 */ 129 private Organization organization; 130 131 /** 132 * Field licenses. 133 */ 134 private java.util.List<License> licenses; 135 136 /** 137 * Field developers. 138 */ 139 private java.util.List<Developer> developers; 140 141 /** 142 * Field contributors. 143 */ 144 private java.util.List<Contributor> contributors; 145 146 /** 147 * Field mailingLists. 148 */ 149 private java.util.List<MailingList> mailingLists; 150 151 /** 152 * Describes the prerequisites in the build environment for 153 * this project. 154 */ 155 private Prerequisites prerequisites; 156 157 /** 158 * Specification for the SCM used by the project, such as CVS, 159 * Subversion, etc. 160 */ 161 private Scm scm; 162 163 /** 164 * The project's issue management system information. 165 */ 166 private IssueManagement issueManagement; 167 168 /** 169 * Field profiles. 170 */ 171 private java.util.List<Profile> profiles; 172 173 /** 174 * Field modelEncoding. 175 */ 176 private String modelEncoding = "UTF-8"; 177 178 179 //-----------/ 180 //- Methods -/ 181 //-----------/ 182 183 /** 184 * Method addContributor. 185 * 186 * @param contributor 187 */ 188 public void addContributor( Contributor contributor ) 189 { 190 getContributors().add( contributor ); 191 } //-- void addContributor( Contributor ) 192 193 /** 194 * Method addDeveloper. 195 * 196 * @param developer 197 */ 198 public void addDeveloper( Developer developer ) 199 { 200 getDevelopers().add( developer ); 201 } //-- void addDeveloper( Developer ) 202 203 /** 204 * Method addLicense. 205 * 206 * @param license 207 */ 208 public void addLicense( License license ) 209 { 210 getLicenses().add( license ); 211 } //-- void addLicense( License ) 212 213 /** 214 * Method addMailingList. 215 * 216 * @param mailingList 217 */ 218 public void addMailingList( MailingList mailingList ) 219 { 220 getMailingLists().add( mailingList ); 221 } //-- void addMailingList( MailingList ) 222 223 /** 224 * Method addProfile. 225 * 226 * @param profile 227 */ 228 public void addProfile( Profile profile ) 229 { 230 getProfiles().add( profile ); 231 } //-- void addProfile( Profile ) 232 233 /** 234 * Method clone. 235 * 236 * @return Model 237 */ 238 public Model clone() 239 { 240 try 241 { 242 Model copy = (Model) super.clone(); 243 244 if ( this.organization != null ) 245 { 246 copy.organization = (Organization) this.organization.clone(); 247 } 248 249 if ( this.licenses != null ) 250 { 251 copy.licenses = new java.util.ArrayList<License>(); 252 for ( License item : this.licenses ) 253 { 254 copy.licenses.add( ( (License) item).clone() ); 255 } 256 } 257 258 if ( this.developers != null ) 259 { 260 copy.developers = new java.util.ArrayList<Developer>(); 261 for ( Developer item : this.developers ) 262 { 263 copy.developers.add( ( (Developer) item).clone() ); 264 } 265 } 266 267 if ( this.contributors != null ) 268 { 269 copy.contributors = new java.util.ArrayList<Contributor>(); 270 for ( Contributor item : this.contributors ) 271 { 272 copy.contributors.add( ( (Contributor) item).clone() ); 273 } 274 } 275 276 if ( this.mailingLists != null ) 277 { 278 copy.mailingLists = new java.util.ArrayList<MailingList>(); 279 for ( MailingList item : this.mailingLists ) 280 { 281 copy.mailingLists.add( ( (MailingList) item).clone() ); 282 } 283 } 284 285 if ( this.prerequisites != null ) 286 { 287 copy.prerequisites = (Prerequisites) this.prerequisites.clone(); 288 } 289 290 if ( this.scm != null ) 291 { 292 copy.scm = (Scm) this.scm.clone(); 293 } 294 295 if ( this.issueManagement != null ) 296 { 297 copy.issueManagement = (IssueManagement) this.issueManagement.clone(); 298 } 299 300 if ( this.profiles != null ) 301 { 302 copy.profiles = new java.util.ArrayList<Profile>(); 303 for ( Profile item : this.profiles ) 304 { 305 copy.profiles.add( ( (Profile) item).clone() ); 306 } 307 } 308 309 cloneHook( copy ); 310 311 return copy; 312 } 313 catch ( java.lang.Exception ex ) 314 { 315 throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName() 316 + " does not support clone()" ).initCause( ex ); 317 } 318 } //-- Model clone() 319 320 /** 321 * Get the identifier for this artifact that is unique within 322 * the group given by the 323 * group ID. An artifact is something that is 324 * either produced or used by a project. 325 * Examples of artifacts produced by Maven for a 326 * project include: JARs, source and binary 327 * distributions, and WARs. 328 * 329 * @return String 330 */ 331 public String getArtifactId() 332 { 333 return this.artifactId; 334 } //-- String getArtifactId() 335 336 /** 337 * Method getContributors. 338 * 339 * @return List 340 */ 341 public java.util.List<Contributor> getContributors() 342 { 343 if ( this.contributors == null ) 344 { 345 this.contributors = new java.util.ArrayList<Contributor>(); 346 } 347 348 return this.contributors; 349 } //-- java.util.List<Contributor> getContributors() 350 351 /** 352 * Get a detailed description of the project, used by Maven 353 * whenever it needs to 354 * describe the project, such as on the web site. 355 * While this element can be specified as 356 * CDATA to enable the use of HTML tags within the 357 * description, it is discouraged to allow 358 * plain text representation. If you need to modify 359 * the index page of the generated web 360 * site, you are able to specify your own instead 361 * of adjusting this text. 362 * 363 * @return String 364 */ 365 public String getDescription() 366 { 367 return this.description; 368 } //-- String getDescription() 369 370 /** 371 * Method getDevelopers. 372 * 373 * @return List 374 */ 375 public java.util.List<Developer> getDevelopers() 376 { 377 if ( this.developers == null ) 378 { 379 this.developers = new java.util.ArrayList<Developer>(); 380 } 381 382 return this.developers; 383 } //-- java.util.List<Developer> getDevelopers() 384 385 /** 386 * Get a universally unique identifier for a project. It is 387 * normal to 388 * use a fully-qualified package name to 389 * distinguish it from other 390 * projects with a similar name (eg. 391 * <code>org.apache.maven</code>). 392 * 393 * @return String 394 */ 395 public String getGroupId() 396 { 397 return this.groupId; 398 } //-- String getGroupId() 399 400 /** 401 * Get the year of the project's inception, specified with 4 402 * digits. This value is 403 * used when generating copyright notices as well 404 * as being informational. 405 * 406 * @return String 407 */ 408 public String getInceptionYear() 409 { 410 return this.inceptionYear; 411 } //-- String getInceptionYear() 412 413 /** 414 * Get the project's issue management system information. 415 * 416 * @return IssueManagement 417 */ 418 public IssueManagement getIssueManagement() 419 { 420 return this.issueManagement; 421 } //-- IssueManagement getIssueManagement() 422 423 /** 424 * Method getLicenses. 425 * 426 * @return List 427 */ 428 public java.util.List<License> getLicenses() 429 { 430 if ( this.licenses == null ) 431 { 432 this.licenses = new java.util.ArrayList<License>(); 433 } 434 435 return this.licenses; 436 } //-- java.util.List<License> getLicenses() 437 438 /** 439 * Method getMailingLists. 440 * 441 * @return List 442 */ 443 public java.util.List<MailingList> getMailingLists() 444 { 445 if ( this.mailingLists == null ) 446 { 447 this.mailingLists = new java.util.ArrayList<MailingList>(); 448 } 449 450 return this.mailingLists; 451 } //-- java.util.List<MailingList> getMailingLists() 452 453 /** 454 * Get the modelEncoding field. 455 * 456 * @return String 457 */ 458 public String getModelEncoding() 459 { 460 return this.modelEncoding; 461 } //-- String getModelEncoding() 462 463 /** 464 * Get declares to which version of project descriptor this POM 465 * conforms. 466 * 467 * @return String 468 */ 469 public String getModelVersion() 470 { 471 return this.modelVersion; 472 } //-- String getModelVersion() 473 474 /** 475 * Get the full name of the project. 476 * 477 * @return String 478 */ 479 public String getName() 480 { 481 return this.name; 482 } //-- String getName() 483 484 /** 485 * Get this element describes various attributes of the 486 * organization to which the 487 * project belongs. These attributes are utilized 488 * when documentation is created (for 489 * copyright notices and links). 490 * 491 * @return Organization 492 */ 493 public Organization getOrganization() 494 { 495 return this.organization; 496 } //-- Organization getOrganization() 497 498 /** 499 * Get the type of artifact this project produces, for example 500 * <code>jar</code> 501 * <code>war</code> 502 * <code>ear</code> 503 * <code>pom</code>. 504 * Plugins can create their own packaging, and 505 * therefore their own packaging types, 506 * so this list does not contain all possible 507 * types. 508 * 509 * @return String 510 */ 511 public String getPackaging() 512 { 513 return this.packaging; 514 } //-- String getPackaging() 515 516 /** 517 * Get describes the prerequisites in the build environment for 518 * this project. 519 * 520 * @return Prerequisites 521 */ 522 public Prerequisites getPrerequisites() 523 { 524 return this.prerequisites; 525 } //-- Prerequisites getPrerequisites() 526 527 /** 528 * Method getProfiles. 529 * 530 * @return List 531 */ 532 public java.util.List<Profile> getProfiles() 533 { 534 if ( this.profiles == null ) 535 { 536 this.profiles = new java.util.ArrayList<Profile>(); 537 } 538 539 return this.profiles; 540 } //-- java.util.List<Profile> getProfiles() 541 542 /** 543 * Get specification for the SCM used by the project, such as 544 * CVS, Subversion, etc. 545 * 546 * @return Scm 547 */ 548 public Scm getScm() 549 { 550 return this.scm; 551 } //-- Scm getScm() 552 553 /** 554 * Get the URL to the project's homepage. 555 * <br><b>Default value is</b>: parent value [+ 556 * path adjustment] + (artifactId or 557 * <code>project.directory</code> property). 558 * 559 * @return String 560 */ 561 public String getUrl() 562 { 563 return this.url; 564 } //-- String getUrl() 565 566 /** 567 * Get the current version of the artifact produced by this 568 * project. 569 * 570 * @return String 571 */ 572 public String getVersion() 573 { 574 return this.version; 575 } //-- String getVersion() 576 577 /** 578 * Method removeContributor. 579 * 580 * @param contributor 581 */ 582 public void removeContributor( Contributor contributor ) 583 { 584 getContributors().remove( contributor ); 585 } //-- void removeContributor( Contributor ) 586 587 /** 588 * Method removeDeveloper. 589 * 590 * @param developer 591 */ 592 public void removeDeveloper( Developer developer ) 593 { 594 getDevelopers().remove( developer ); 595 } //-- void removeDeveloper( Developer ) 596 597 /** 598 * Method removeLicense. 599 * 600 * @param license 601 */ 602 public void removeLicense( License license ) 603 { 604 getLicenses().remove( license ); 605 } //-- void removeLicense( License ) 606 607 /** 608 * Method removeMailingList. 609 * 610 * @param mailingList 611 */ 612 public void removeMailingList( MailingList mailingList ) 613 { 614 getMailingLists().remove( mailingList ); 615 } //-- void removeMailingList( MailingList ) 616 617 /** 618 * Method removeProfile. 619 * 620 * @param profile 621 */ 622 public void removeProfile( Profile profile ) 623 { 624 getProfiles().remove( profile ); 625 } //-- void removeProfile( Profile ) 626 627 /** 628 * Set the identifier for this artifact that is unique within 629 * the group given by the 630 * group ID. An artifact is something that is 631 * either produced or used by a project. 632 * Examples of artifacts produced by Maven for a 633 * project include: JARs, source and binary 634 * distributions, and WARs. 635 * 636 * @param artifactId 637 */ 638 public void setArtifactId( String artifactId ) 639 { 640 this.artifactId = artifactId; 641 } //-- void setArtifactId( String ) 642 643 /** 644 * Set describes the contributors to a project that are not yet 645 * committers. 646 * 647 * @param contributors 648 */ 649 public void setContributors( java.util.List<Contributor> contributors ) 650 { 651 this.contributors = contributors; 652 } //-- void setContributors( java.util.List ) 653 654 /** 655 * Set a detailed description of the project, used by Maven 656 * whenever it needs to 657 * describe the project, such as on the web site. 658 * While this element can be specified as 659 * CDATA to enable the use of HTML tags within the 660 * description, it is discouraged to allow 661 * plain text representation. If you need to modify 662 * the index page of the generated web 663 * site, you are able to specify your own instead 664 * of adjusting this text. 665 * 666 * @param description 667 */ 668 public void setDescription( String description ) 669 { 670 this.description = description; 671 } //-- void setDescription( String ) 672 673 /** 674 * Set describes the committers of a project. 675 * 676 * @param developers 677 */ 678 public void setDevelopers( java.util.List<Developer> developers ) 679 { 680 this.developers = developers; 681 } //-- void setDevelopers( java.util.List ) 682 683 /** 684 * Set a universally unique identifier for a project. It is 685 * normal to 686 * use a fully-qualified package name to 687 * distinguish it from other 688 * projects with a similar name (eg. 689 * <code>org.apache.maven</code>). 690 * 691 * @param groupId 692 */ 693 public void setGroupId( String groupId ) 694 { 695 this.groupId = groupId; 696 } //-- void setGroupId( String ) 697 698 /** 699 * Set the year of the project's inception, specified with 4 700 * digits. This value is 701 * used when generating copyright notices as well 702 * as being informational. 703 * 704 * @param inceptionYear 705 */ 706 public void setInceptionYear( String inceptionYear ) 707 { 708 this.inceptionYear = inceptionYear; 709 } //-- void setInceptionYear( String ) 710 711 /** 712 * Set the project's issue management system information. 713 * 714 * @param issueManagement 715 */ 716 public void setIssueManagement( IssueManagement issueManagement ) 717 { 718 this.issueManagement = issueManagement; 719 } //-- void setIssueManagement( IssueManagement ) 720 721 /** 722 * Set this element describes all of the licenses for this 723 * project. 724 * Each license is described by a 725 * <code>license</code> element, which 726 * is then described by additional elements. 727 * Projects should only list the license(s) that 728 * applies to the project 729 * and not the licenses that apply to dependencies. 730 * If multiple licenses are listed, it is assumed 731 * that the user can select 732 * any of them, not that they must accept all. 733 * 734 * @param licenses 735 */ 736 public void setLicenses( java.util.List<License> licenses ) 737 { 738 this.licenses = licenses; 739 } //-- void setLicenses( java.util.List ) 740 741 /** 742 * Set contains information about a project's mailing lists. 743 * 744 * @param mailingLists 745 */ 746 public void setMailingLists( java.util.List<MailingList> mailingLists ) 747 { 748 this.mailingLists = mailingLists; 749 } //-- void setMailingLists( java.util.List ) 750 751 /** 752 * Set the modelEncoding field. 753 * 754 * @param modelEncoding 755 */ 756 public void setModelEncoding( String modelEncoding ) 757 { 758 this.modelEncoding = modelEncoding; 759 } //-- void setModelEncoding( String ) 760 761 /** 762 * Set declares to which version of project descriptor this POM 763 * conforms. 764 * 765 * @param modelVersion 766 */ 767 public void setModelVersion( String modelVersion ) 768 { 769 this.modelVersion = modelVersion; 770 } //-- void setModelVersion( String ) 771 772 /** 773 * Set the full name of the project. 774 * 775 * @param name 776 */ 777 public void setName( String name ) 778 { 779 this.name = name; 780 } //-- void setName( String ) 781 782 /** 783 * Set this element describes various attributes of the 784 * organization to which the 785 * project belongs. These attributes are utilized 786 * when documentation is created (for 787 * copyright notices and links). 788 * 789 * @param organization 790 */ 791 public void setOrganization( Organization organization ) 792 { 793 this.organization = organization; 794 } //-- void setOrganization( Organization ) 795 796 /** 797 * Set the type of artifact this project produces, for example 798 * <code>jar</code> 799 * <code>war</code> 800 * <code>ear</code> 801 * <code>pom</code>. 802 * Plugins can create their own packaging, and 803 * therefore their own packaging types, 804 * so this list does not contain all possible 805 * types. 806 * 807 * @param packaging 808 */ 809 public void setPackaging( String packaging ) 810 { 811 this.packaging = packaging; 812 } //-- void setPackaging( String ) 813 814 /** 815 * Set describes the prerequisites in the build environment for 816 * this project. 817 * 818 * @param prerequisites 819 */ 820 public void setPrerequisites( Prerequisites prerequisites ) 821 { 822 this.prerequisites = prerequisites; 823 } //-- void setPrerequisites( Prerequisites ) 824 825 /** 826 * Set a listing of project-local build profiles which will 827 * modify the build process 828 * when activated. 829 * 830 * @param profiles 831 */ 832 public void setProfiles( java.util.List<Profile> profiles ) 833 { 834 this.profiles = profiles; 835 } //-- void setProfiles( java.util.List ) 836 837 /** 838 * Set specification for the SCM used by the project, such as 839 * CVS, Subversion, etc. 840 * 841 * @param scm 842 */ 843 public void setScm( Scm scm ) 844 { 845 this.scm = scm; 846 } //-- void setScm( Scm ) 847 848 /** 849 * Set the URL to the project's homepage. 850 * <br><b>Default value is</b>: parent value [+ 851 * path adjustment] + (artifactId or 852 * <code>project.directory</code> property). 853 * 854 * @param url 855 */ 856 public void setUrl( String url ) 857 { 858 this.url = url; 859 } //-- void setUrl( String ) 860 861 /** 862 * Set the current version of the artifact produced by this 863 * project. 864 * 865 * @param version 866 */ 867 public void setVersion( String version ) 868 { 869 this.version = version; 870 } //-- void setVersion( String ) 871 872 873 874 private void cloneHook( Model copy ) 875 { 876 copy.pomFile = pomFile; 877 } 878 879 /** 880 * The POM from which this model originated. This is transient runtime state and therefore not managed by Modello. 881 */ 882 private java.io.File pomFile; 883 884 /** 885 * Gets the POM file for the corresponding project (if any). 886 * 887 * @return The POM file from which this model originated or {@code null} if this model does not belong to a local 888 * project (e.g. describes the metadata of some artifact from the repository). 889 */ 890 public java.io.File getPomFile() 891 { 892 return pomFile; 893 } 894 895 public void setPomFile( java.io.File pomFile ) 896 { 897 this.pomFile = ( pomFile != null ) ? pomFile.getAbsoluteFile() : null; 898 } 899 900 /** 901 * Gets the base directory for the corresponding project (if any). 902 * 903 * @return The base directory for the corresponding project or {@code null} if this model does not belong to a local 904 * project (e.g. describes the metadata of some artifact from the repository). 905 */ 906 public java.io.File getProjectDirectory() 907 { 908 return ( pomFile != null ) ? pomFile.getParentFile() : null; 909 } 910 911 /** 912 * @return the model id as <code>groupId:artifactId:packaging:version</code> 913 */ 914 public String getId() 915 { 916 StringBuilder id = new StringBuilder( 64 ); 917 918 id.append( ( getGroupId() == null ) ? "[inherited]" : getGroupId() ); 919 id.append( ":" ); 920 id.append( getArtifactId() ); 921 id.append( ":" ); 922 id.append( getPackaging() ); 923 id.append( ":" ); 924 id.append( ( getVersion() == null ) ? "[inherited]" : getVersion() ); 925 926 return id.toString(); 927 } 928 929 @Override 930 public String toString() 931 { 932 return getId(); 933 } 934 935 936 }