001// =================== DO NOT EDIT THIS FILE ==================== 002// Generated by Modello 1.9.1, 003// any modifications will be overwritten. 004// ============================================================== 005 006package org.apache.maven.doxia.document; 007 008/** 009 * Contains meta-data information for the document cover page. 010 * 011 * @version $Revision$ $Date$ 012 */ 013@SuppressWarnings( "all" ) 014public class DocumentCover 015 implements java.io.Serializable 016{ 017 018 //--------------------------/ 019 //- Class/Member Variables -/ 020 //--------------------------/ 021 022 /** 023 * 024 * The title to appear on the cover. 025 * 026 */ 027 private String coverTitle; 028 029 /** 030 * 031 * a sub-title to appear on the cover. 032 * 033 */ 034 private String coverSubTitle; 035 036 /** 037 * 038 * The version of the project that appears on the 039 * cover page. 040 * 041 */ 042 private String coverVersion; 043 044 /** 045 * 046 * The type of the document. This might be used on 047 * the cover page to 048 * specify the type of information contained in the 049 * document 050 * (eg 'User Guide', 'Manual', etc.). 051 * 052 */ 053 private String coverType; 054 055 /** 056 * 057 * The date to appear on the cover. 058 * Use the ISO 8601 format 059 * "yyyy-MM-dd'T'HH:mm:ss.SSS" in xml. 060 * 061 */ 062 private java.util.Date coverDate; 063 064 /** 065 * 066 * The date as String (recommended format is ISO 067 * 8601) to appear on the cover. 068 * Only used if <code>coverDate</code> is not set. 069 * @since 1.1.1 070 * . 071 */ 072 private String coverdate; 073 074 /** 075 * Field authors. 076 */ 077 private java.util.List<DocumentAuthor> authors; 078 079 /** 080 * 081 * A shortcut for the unique author that appears on 082 * the cover page. 083 * For more authors, you could use the 084 * <authors/> tag. 085 * @since 1.1.1 086 * . 087 */ 088 private String author; 089 090 /** 091 * 092 * The name of the project. 093 * 094 */ 095 private String projectName; 096 097 /** 098 * 099 * The location of an image file that represents 100 * the project logo. 101 * 102 */ 103 private String projectLogo; 104 105 /** 106 * 107 * The name of the entity that is responsible for 108 * the content of the 109 * document, or a copyright holder. 110 * 111 */ 112 private String companyName; 113 114 /** 115 * 116 * The location of an image file that represents 117 * the company logo. 118 * 119 */ 120 private String companyLogo; 121 122 123 //-----------/ 124 //- Methods -/ 125 //-----------/ 126 127 /** 128 * Method addAuthor. 129 * 130 * @param documentAuthor 131 */ 132 public void addAuthor( DocumentAuthor documentAuthor ) 133 { 134 getAuthors().add( documentAuthor ); 135 } //-- void addAuthor( DocumentAuthor ) 136 137 /** 138 * Method equals. 139 * 140 * @param other 141 * @return boolean 142 */ 143 public boolean equals( Object other ) 144 { 145 if ( this == other ) 146 { 147 return true; 148 } 149 150 if ( !( other instanceof DocumentCover ) ) 151 { 152 return false; 153 } 154 155 DocumentCover that = (DocumentCover) other; 156 boolean result = true; 157 158 result = result && ( getCoverTitle() == null ? that.getCoverTitle() == null : getCoverTitle().equals( that.getCoverTitle() ) ); 159 result = result && ( getCoverSubTitle() == null ? that.getCoverSubTitle() == null : getCoverSubTitle().equals( that.getCoverSubTitle() ) ); 160 result = result && ( getCoverVersion() == null ? that.getCoverVersion() == null : getCoverVersion().equals( that.getCoverVersion() ) ); 161 result = result && ( getCoverType() == null ? that.getCoverType() == null : getCoverType().equals( that.getCoverType() ) ); 162 result = result && ( getCoverDate() == null ? that.getCoverDate() == null : getCoverDate().equals( that.getCoverDate() ) ); 163 result = result && ( getCoverdate() == null ? that.getCoverdate() == null : getCoverdate().equals( that.getCoverdate() ) ); 164 result = result && ( getAuthors() == null ? that.getAuthors() == null : getAuthors().equals( that.getAuthors() ) ); 165 result = result && ( getAuthor() == null ? that.getAuthor() == null : getAuthor().equals( that.getAuthor() ) ); 166 result = result && ( getProjectName() == null ? that.getProjectName() == null : getProjectName().equals( that.getProjectName() ) ); 167 result = result && ( getProjectLogo() == null ? that.getProjectLogo() == null : getProjectLogo().equals( that.getProjectLogo() ) ); 168 result = result && ( getCompanyName() == null ? that.getCompanyName() == null : getCompanyName().equals( that.getCompanyName() ) ); 169 result = result && ( getCompanyLogo() == null ? that.getCompanyLogo() == null : getCompanyLogo().equals( that.getCompanyLogo() ) ); 170 171 return result; 172 } //-- boolean equals( Object ) 173 174 /** 175 * Get a shortcut for the unique author that appears on the 176 * cover page. 177 * For more authors, you could use the 178 * <authors/> tag. 179 * @since 1.1.1. 180 * 181 * @return String 182 */ 183 public String getAuthor() 184 { 185 return this.author; 186 } //-- String getAuthor() 187 188 /** 189 * Method getAuthors. 190 * 191 * @return List 192 */ 193 public java.util.List<DocumentAuthor> getAuthors() 194 { 195 if ( this.authors == null ) 196 { 197 this.authors = new java.util.ArrayList<DocumentAuthor>(); 198 } 199 200 return this.authors; 201 } //-- java.util.List<DocumentAuthor> getAuthors() 202 203 /** 204 * Get the location of an image file that represents the 205 * company logo. 206 * 207 * @return String 208 */ 209 public String getCompanyLogo() 210 { 211 return this.companyLogo; 212 } //-- String getCompanyLogo() 213 214 /** 215 * Get the name of the entity that is responsible for the 216 * content of the 217 * document, or a copyright holder. 218 * 219 * @return String 220 */ 221 public String getCompanyName() 222 { 223 return this.companyName; 224 } //-- String getCompanyName() 225 226 /** 227 * Get the date to appear on the cover. 228 * Use the ISO 8601 format 229 * "yyyy-MM-dd'T'HH:mm:ss.SSS" in xml. 230 * 231 * @return Date 232 */ 233 public java.util.Date getCoverDate() 234 { 235 return this.coverDate; 236 } //-- java.util.Date getCoverDate() 237 238 /** 239 * Get a sub-title to appear on the cover. 240 * 241 * @return String 242 */ 243 public String getCoverSubTitle() 244 { 245 return this.coverSubTitle; 246 } //-- String getCoverSubTitle() 247 248 /** 249 * Get the title to appear on the cover. 250 * 251 * @return String 252 */ 253 public String getCoverTitle() 254 { 255 return this.coverTitle; 256 } //-- String getCoverTitle() 257 258 /** 259 * Get the type of the document. This might be used on the 260 * cover page to 261 * specify the type of information contained in the 262 * document 263 * (eg 'User Guide', 'Manual', etc.). 264 * 265 * @return String 266 */ 267 public String getCoverType() 268 { 269 return this.coverType; 270 } //-- String getCoverType() 271 272 /** 273 * Get the version of the project that appears on the cover 274 * page. 275 * 276 * @return String 277 */ 278 public String getCoverVersion() 279 { 280 return this.coverVersion; 281 } //-- String getCoverVersion() 282 283 /** 284 * Get the location of an image file that represents the 285 * project logo. 286 * 287 * @return String 288 */ 289 public String getProjectLogo() 290 { 291 return this.projectLogo; 292 } //-- String getProjectLogo() 293 294 /** 295 * Get the name of the project. 296 * 297 * @return String 298 */ 299 public String getProjectName() 300 { 301 return this.projectName; 302 } //-- String getProjectName() 303 304 /** 305 * Method hashCode. 306 * 307 * @return int 308 */ 309 public int hashCode() 310 { 311 int result = 17; 312 313 result = 37 * result + ( coverTitle != null ? coverTitle.hashCode() : 0 ); 314 result = 37 * result + ( coverSubTitle != null ? coverSubTitle.hashCode() : 0 ); 315 result = 37 * result + ( coverVersion != null ? coverVersion.hashCode() : 0 ); 316 result = 37 * result + ( coverType != null ? coverType.hashCode() : 0 ); 317 result = 37 * result + ( coverDate != null ? coverDate.hashCode() : 0 ); 318 result = 37 * result + ( coverdate != null ? coverdate.hashCode() : 0 ); 319 result = 37 * result + ( authors != null ? authors.hashCode() : 0 ); 320 result = 37 * result + ( author != null ? author.hashCode() : 0 ); 321 result = 37 * result + ( projectName != null ? projectName.hashCode() : 0 ); 322 result = 37 * result + ( projectLogo != null ? projectLogo.hashCode() : 0 ); 323 result = 37 * result + ( companyName != null ? companyName.hashCode() : 0 ); 324 result = 37 * result + ( companyLogo != null ? companyLogo.hashCode() : 0 ); 325 326 return result; 327 } //-- int hashCode() 328 329 /** 330 * Method removeAuthor. 331 * 332 * @param documentAuthor 333 */ 334 public void removeAuthor( DocumentAuthor documentAuthor ) 335 { 336 getAuthors().remove( documentAuthor ); 337 } //-- void removeAuthor( DocumentAuthor ) 338 339 /** 340 * Set a shortcut for the unique author that appears on the 341 * cover page. 342 * For more authors, you could use the 343 * <authors/> tag. 344 * @since 1.1.1. 345 * 346 * @param author 347 */ 348 public void setAuthor( String author ) 349 { 350 this.author = author; 351 } //-- void setAuthor( String ) 352 353 /** 354 * Set the authors that appear on the cover page. 355 * Only used if author is not given. 356 * 357 * @param authors 358 */ 359 public void setAuthors( java.util.List<DocumentAuthor> authors ) 360 { 361 this.authors = authors; 362 } //-- void setAuthors( java.util.List ) 363 364 /** 365 * Set the location of an image file that represents the 366 * company logo. 367 * 368 * @param companyLogo 369 */ 370 public void setCompanyLogo( String companyLogo ) 371 { 372 this.companyLogo = companyLogo; 373 } //-- void setCompanyLogo( String ) 374 375 /** 376 * Set the name of the entity that is responsible for the 377 * content of the 378 * document, or a copyright holder. 379 * 380 * @param companyName 381 */ 382 public void setCompanyName( String companyName ) 383 { 384 this.companyName = companyName; 385 } //-- void setCompanyName( String ) 386 387 /** 388 * Set the date to appear on the cover. 389 * Use the ISO 8601 format 390 * "yyyy-MM-dd'T'HH:mm:ss.SSS" in xml. 391 * 392 * @param coverDate 393 */ 394 public void setCoverDate( java.util.Date coverDate ) 395 { 396 this.coverDate = coverDate; 397 } //-- void setCoverDate( java.util.Date ) 398 399 /** 400 * Set a sub-title to appear on the cover. 401 * 402 * @param coverSubTitle 403 */ 404 public void setCoverSubTitle( String coverSubTitle ) 405 { 406 this.coverSubTitle = coverSubTitle; 407 } //-- void setCoverSubTitle( String ) 408 409 /** 410 * Set the title to appear on the cover. 411 * 412 * @param coverTitle 413 */ 414 public void setCoverTitle( String coverTitle ) 415 { 416 this.coverTitle = coverTitle; 417 } //-- void setCoverTitle( String ) 418 419 /** 420 * Set the type of the document. This might be used on the 421 * cover page to 422 * specify the type of information contained in the 423 * document 424 * (eg 'User Guide', 'Manual', etc.). 425 * 426 * @param coverType 427 */ 428 public void setCoverType( String coverType ) 429 { 430 this.coverType = coverType; 431 } //-- void setCoverType( String ) 432 433 /** 434 * Set the version of the project that appears on the cover 435 * page. 436 * 437 * @param coverVersion 438 */ 439 public void setCoverVersion( String coverVersion ) 440 { 441 this.coverVersion = coverVersion; 442 } //-- void setCoverVersion( String ) 443 444 /** 445 * Set the date as String (recommended format is ISO 8601) to 446 * appear on the cover. 447 * Only used if <code>coverDate</code> is not set. 448 * @since 1.1.1. 449 * 450 * @param coverdate 451 */ 452 public void setCoverdate( String coverdate ) 453 { 454 this.coverdate = coverdate; 455 } //-- void setCoverdate( String ) 456 457 /** 458 * Set the location of an image file that represents the 459 * project logo. 460 * 461 * @param projectLogo 462 */ 463 public void setProjectLogo( String projectLogo ) 464 { 465 this.projectLogo = projectLogo; 466 } //-- void setProjectLogo( String ) 467 468 /** 469 * Set the name of the project. 470 * 471 * @param projectName 472 */ 473 public void setProjectName( String projectName ) 474 { 475 this.projectName = projectName; 476 } //-- void setProjectName( String ) 477 478 /** 479 * Method toString. 480 * 481 * @return String 482 */ 483 public java.lang.String toString() 484 { 485 StringBuilder buf = new StringBuilder( 128 ); 486 487 buf.append( "coverTitle = '" ); 488 buf.append( getCoverTitle() ); 489 buf.append( "'" ); 490 buf.append( "\n" ); 491 buf.append( "coverSubTitle = '" ); 492 buf.append( getCoverSubTitle() ); 493 buf.append( "'" ); 494 buf.append( "\n" ); 495 buf.append( "coverVersion = '" ); 496 buf.append( getCoverVersion() ); 497 buf.append( "'" ); 498 buf.append( "\n" ); 499 buf.append( "coverType = '" ); 500 buf.append( getCoverType() ); 501 buf.append( "'" ); 502 buf.append( "\n" ); 503 buf.append( "coverDate = '" ); 504 buf.append( getCoverDate() ); 505 buf.append( "'" ); 506 buf.append( "\n" ); 507 buf.append( "coverdate = '" ); 508 buf.append( getCoverdate() ); 509 buf.append( "'" ); 510 buf.append( "\n" ); 511 buf.append( "authors = '" ); 512 buf.append( getAuthors() ); 513 buf.append( "'" ); 514 buf.append( "\n" ); 515 buf.append( "author = '" ); 516 buf.append( getAuthor() ); 517 buf.append( "'" ); 518 buf.append( "\n" ); 519 buf.append( "projectName = '" ); 520 buf.append( getProjectName() ); 521 buf.append( "'" ); 522 buf.append( "\n" ); 523 buf.append( "projectLogo = '" ); 524 buf.append( getProjectLogo() ); 525 buf.append( "'" ); 526 buf.append( "\n" ); 527 buf.append( "companyName = '" ); 528 buf.append( getCompanyName() ); 529 buf.append( "'" ); 530 buf.append( "\n" ); 531 buf.append( "companyLogo = '" ); 532 buf.append( getCompanyLogo() ); 533 buf.append( "'" ); 534 535 return buf.toString(); 536 } //-- java.lang.String toString() 537 538 539 540 /** 541 * @return {@link #getAuthor()} if the unique author name is defined. Otherwise, return all authors full names 542 * comma separated. 543 * @see #getAuthor() 544 * @see #getAuthors() 545 * @since 1.1.1 546 */ 547 public String getAllAuthorNames() 548 { 549 StringBuffer sb = new StringBuffer(); 550 if ( getAuthor() != null && getAuthor().trim().length() > 0 ) 551 { 552 return getAuthor().trim(); 553 } 554 555 if ( getAuthors() != null ) 556 { 557 for ( java.util.Iterator it = getAuthors().iterator(); it.hasNext(); ) 558 { 559 DocumentAuthor author = (DocumentAuthor) it.next(); 560 561 sb.append( author.getFullName().trim() ); 562 563 if ( it.hasNext() ) 564 { 565 sb.append( ", " ); 566 } 567 } 568 } 569 570 return sb.toString(); 571 } 572 573 /** ISO 8601 date format, i.e. <code>yyyy-MM-dd</code> **/ 574 private static final java.text.DateFormat ISO_8601_FORMAT = new java.text.SimpleDateFormat( "yyyy-MM-dd", java.util.Locale.ENGLISH ); 575 576 /** 577 * Get the date to appear on the cover. 578 * 579 * @return the <code>getCoverDate()</code> if setted, formatted using ISO-8601 English format, otherwise return 580 * the <code>coverdate</code>. 581 * @since 1.1.1 582 * @see #getCoverDate() 583 */ 584 public String getCoverdate() 585 { 586 if ( getCoverDate() != null ) 587 { 588 return ISO_8601_FORMAT.format( getCoverDate() ); 589 } 590 591 return this.coverdate; 592 } 593 594 595}