Coverage Report - org.apache.maven.doxia.site.decoration.DecorationModel
 
Classes in this File Line Coverage Branch Coverage Complexity
DecorationModel
32%
57/173
34%
56/162
2,676
 
 1  
 /*
 2  
  =================== DO NOT EDIT THIS FILE ====================
 3  
  Generated by Modello 1.4.1 on 2012-04-17 22:28:45,
 4  
  any modifications will be overwritten.
 5  
  ==============================================================
 6  
  */
 7  
 
 8  
 package org.apache.maven.doxia.site.decoration;
 9  
 
 10  
 /**
 11  
  * 
 12  
  *          The <code>&lt;project&gt;</code> element is the root of
 13  
  * the site decoration descriptor.
 14  
  *          The following table lists all of the possible child
 15  
  * elements.
 16  
  *       
 17  
  * 
 18  
  * @version $Revision$ $Date$
 19  
  */
 20  
 @SuppressWarnings( "all" )
 21  158
 public class DecorationModel
 22  
     implements java.io.Serializable, java.lang.Cloneable
 23  
 {
 24  
 
 25  
       //--------------------------/
 26  
      //- Class/Member Variables -/
 27  
     //--------------------------/
 28  
 
 29  
     /**
 30  
      * The full name of the project.
 31  
      */
 32  
     private String name;
 33  
 
 34  
     /**
 35  
      * Banner logo on the masthead of the site to the left.
 36  
      */
 37  
     private Banner bannerLeft;
 38  
 
 39  
     /**
 40  
      * Banner logo on the masthead of the site to the right.
 41  
      */
 42  
     private Banner bannerRight;
 43  
 
 44  
     /**
 45  
      * Your Google AdSense client id.
 46  
      */
 47  
     private String googleAdSenseClient;
 48  
 
 49  
     /**
 50  
      * Your Google AdSense slot id.
 51  
      */
 52  
     private String googleAdSenseSlot;
 53  
 
 54  
     /**
 55  
      * The id for your Google Analytics account.
 56  
      */
 57  
     private String googleAnalyticsAccountId;
 58  
 
 59  
     /**
 60  
      * Modify the date published display properties.
 61  
      */
 62  
     private PublishDate publishDate;
 63  
 
 64  
     /**
 65  
      * Modify the version published display properties.
 66  
      */
 67  
     private Version version;
 68  
 
 69  
     /**
 70  
      * Field poweredBy.
 71  
      */
 72  
     private java.util.List<Logo> poweredBy;
 73  
 
 74  
     /**
 75  
      * The artifact containing the skin for the site.
 76  
      */
 77  
     private Skin skin;
 78  
 
 79  
     /**
 80  
      * The main site content decoration.
 81  
      */
 82  
     private Body body;
 83  
 
 84  
     /**
 85  
      * 
 86  
      *             Custom configuration for use with customized
 87  
      * Velocity templates. Data from this field are
 88  
      *             accessible in Velocity template from
 89  
      * <code>$decoration.custom</code> variable as DOM content.
 90  
      *             Example: <code>$decoration.custom.getChild(
 91  
      * 'customElement' ).getValue()</code>
 92  
      *           
 93  
      */
 94  
     private Object custom;
 95  
 
 96  
     /**
 97  
      * Timestamp of the last modification of this decoration model.
 98  
      */
 99  158
     private long lastModified = 0L;
 100  
 
 101  
     /**
 102  
      * Field modelEncoding.
 103  
      */
 104  158
     private String modelEncoding = "UTF-8";
 105  
 
 106  
 
 107  
       //-----------/
 108  
      //- Methods -/
 109  
     //-----------/
 110  
 
 111  
     /**
 112  
      * Method addPoweredBy.
 113  
      * 
 114  
      * @param logo
 115  
      */
 116  
     public void addPoweredBy( Logo logo )
 117  
     {
 118  10
         getPoweredBy().add( logo );
 119  10
     } //-- void addPoweredBy( Logo )
 120  
 
 121  
     /**
 122  
      * Method clone.
 123  
      * 
 124  
      * @return DecorationModel
 125  
      */
 126  
     public DecorationModel clone()
 127  
     {
 128  
         try
 129  
         {
 130  0
             DecorationModel copy = (DecorationModel) super.clone();
 131  
 
 132  0
             if ( this.bannerLeft != null )
 133  
             {
 134  0
                 copy.bannerLeft = (Banner) this.bannerLeft.clone();
 135  
             }
 136  
 
 137  0
             if ( this.bannerRight != null )
 138  
             {
 139  0
                 copy.bannerRight = (Banner) this.bannerRight.clone();
 140  
             }
 141  
 
 142  0
             if ( this.publishDate != null )
 143  
             {
 144  0
                 copy.publishDate = (PublishDate) this.publishDate.clone();
 145  
             }
 146  
 
 147  0
             if ( this.version != null )
 148  
             {
 149  0
                 copy.version = (Version) this.version.clone();
 150  
             }
 151  
 
 152  0
             if ( this.poweredBy != null )
 153  
             {
 154  0
                 copy.poweredBy = new java.util.ArrayList<Logo>();
 155  0
                 for ( Logo item : this.poweredBy )
 156  
                 {
 157  0
                     copy.poweredBy.add( ( (Logo) item).clone() );
 158  
                 }
 159  
             }
 160  
 
 161  0
             if ( this.skin != null )
 162  
             {
 163  0
                 copy.skin = (Skin) this.skin.clone();
 164  
             }
 165  
 
 166  0
             if ( this.body != null )
 167  
             {
 168  0
                 copy.body = (Body) this.body.clone();
 169  
             }
 170  
 
 171  0
             if ( this.custom != null )
 172  
             {
 173  0
                 copy.custom = new org.codehaus.plexus.util.xml.Xpp3Dom( (org.codehaus.plexus.util.xml.Xpp3Dom) this.custom );
 174  
             }
 175  
 
 176  0
             return copy;
 177  
         }
 178  0
         catch ( java.lang.Exception ex )
 179  
         {
 180  0
             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
 181  
                 + " does not support clone()" ).initCause( ex );
 182  
         }
 183  
     } //-- DecorationModel clone()
 184  
 
 185  
     /**
 186  
      * Method equals.
 187  
      * 
 188  
      * @param other
 189  
      * @return boolean
 190  
      */
 191  
     public boolean equals( Object other )
 192  
     {
 193  54
         if ( this == other )
 194  
         {
 195  0
             return true;
 196  
         }
 197  
 
 198  54
         if ( !( other instanceof DecorationModel ) )
 199  
         {
 200  0
             return false;
 201  
         }
 202  
 
 203  54
         DecorationModel that = (DecorationModel) other;
 204  54
         boolean result = true;
 205  
 
 206  54
         result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) );
 207  54
         result = result && ( getBannerLeft() == null ? that.getBannerLeft() == null : getBannerLeft().equals( that.getBannerLeft() ) );
 208  54
         result = result && ( getBannerRight() == null ? that.getBannerRight() == null : getBannerRight().equals( that.getBannerRight() ) );
 209  54
         result = result && ( getGoogleAdSenseClient() == null ? that.getGoogleAdSenseClient() == null : getGoogleAdSenseClient().equals( that.getGoogleAdSenseClient() ) );
 210  54
         result = result && ( getGoogleAdSenseSlot() == null ? that.getGoogleAdSenseSlot() == null : getGoogleAdSenseSlot().equals( that.getGoogleAdSenseSlot() ) );
 211  54
         result = result && ( getGoogleAnalyticsAccountId() == null ? that.getGoogleAnalyticsAccountId() == null : getGoogleAnalyticsAccountId().equals( that.getGoogleAnalyticsAccountId() ) );
 212  54
         result = result && ( getPublishDate() == null ? that.getPublishDate() == null : getPublishDate().equals( that.getPublishDate() ) );
 213  54
         result = result && ( getVersion() == null ? that.getVersion() == null : getVersion().equals( that.getVersion() ) );
 214  54
         result = result && ( getPoweredBy() == null ? that.getPoweredBy() == null : getPoweredBy().equals( that.getPoweredBy() ) );
 215  54
         result = result && ( getSkin() == null ? that.getSkin() == null : getSkin().equals( that.getSkin() ) );
 216  54
         result = result && ( getBody() == null ? that.getBody() == null : getBody().equals( that.getBody() ) );
 217  54
         result = result && ( getCustom() == null ? that.getCustom() == null : getCustom().equals( that.getCustom() ) );
 218  
 
 219  54
         return result;
 220  
     } //-- boolean equals( Object )
 221  
 
 222  
     /**
 223  
      * Get banner logo on the masthead of the site to the left.
 224  
      * 
 225  
      * @return Banner
 226  
      */
 227  
     public Banner getBannerLeft()
 228  
     {
 229  442
         return this.bannerLeft;
 230  
     } //-- Banner getBannerLeft()
 231  
 
 232  
     /**
 233  
      * Get banner logo on the masthead of the site to the right.
 234  
      * 
 235  
      * @return Banner
 236  
      */
 237  
     public Banner getBannerRight()
 238  
     {
 239  438
         return this.bannerRight;
 240  
     } //-- Banner getBannerRight()
 241  
 
 242  
     /**
 243  
      * Get the main site content decoration.
 244  
      * 
 245  
      * @return Body
 246  
      */
 247  
     public Body getBody()
 248  
     {
 249  514
         return this.body;
 250  
     } //-- Body getBody()
 251  
 
 252  
     /**
 253  
      * Get custom configuration for use with customized Velocity
 254  
      * templates. Data from this field are
 255  
      *             accessible in Velocity template from
 256  
      * <code>$decoration.custom</code> variable as DOM content.
 257  
      *             Example: <code>$decoration.custom.getChild(
 258  
      * 'customElement' ).getValue()</code>
 259  
      * 
 260  
      * @return Object
 261  
      */
 262  
     public Object getCustom()
 263  
     {
 264  254
         return this.custom;
 265  
     } //-- Object getCustom()
 266  
 
 267  
     /**
 268  
      * Get your Google AdSense client id.
 269  
      * 
 270  
      * @return String
 271  
      */
 272  
     public String getGoogleAdSenseClient()
 273  
     {
 274  108
         return this.googleAdSenseClient;
 275  
     } //-- String getGoogleAdSenseClient()
 276  
 
 277  
     /**
 278  
      * Get your Google AdSense slot id.
 279  
      * 
 280  
      * @return String
 281  
      */
 282  
     public String getGoogleAdSenseSlot()
 283  
     {
 284  108
         return this.googleAdSenseSlot;
 285  
     } //-- String getGoogleAdSenseSlot()
 286  
 
 287  
     /**
 288  
      * Get the id for your Google Analytics account.
 289  
      * 
 290  
      * @return String
 291  
      */
 292  
     public String getGoogleAnalyticsAccountId()
 293  
     {
 294  108
         return this.googleAnalyticsAccountId;
 295  
     } //-- String getGoogleAnalyticsAccountId()
 296  
 
 297  
     /**
 298  
      * Get timestamp of the last modification of this decoration
 299  
      * model.
 300  
      * 
 301  
      * @return long
 302  
      */
 303  
     public long getLastModified()
 304  
     {
 305  128
         return this.lastModified;
 306  
     } //-- long getLastModified()
 307  
 
 308  
     /**
 309  
      * Get the modelEncoding field.
 310  
      * 
 311  
      * @return String
 312  
      */
 313  
     public String getModelEncoding()
 314  
     {
 315  0
         return this.modelEncoding;
 316  
     } //-- String getModelEncoding()
 317  
 
 318  
     /**
 319  
      * Get the full name of the project.
 320  
      * 
 321  
      * @return String
 322  
      */
 323  
     public String getName()
 324  
     {
 325  160
         return this.name;
 326  
     } //-- String getName()
 327  
 
 328  
     /**
 329  
      * Method getPoweredBy.
 330  
      * 
 331  
      * @return List
 332  
      */
 333  
     public java.util.List<Logo> getPoweredBy()
 334  
     {
 335  364
         if ( this.poweredBy == null )
 336  
         {
 337  94
             this.poweredBy = new java.util.ArrayList<Logo>();
 338  
         }
 339  
 
 340  364
         return this.poweredBy;
 341  
     } //-- java.util.List<Logo> getPoweredBy()
 342  
 
 343  
     /**
 344  
      * Get modify the date published display properties.
 345  
      * 
 346  
      * @return PublishDate
 347  
      */
 348  
     public PublishDate getPublishDate()
 349  
     {
 350  250
         return this.publishDate;
 351  
     } //-- PublishDate getPublishDate()
 352  
 
 353  
     /**
 354  
      * Get the artifact containing the skin for the site.
 355  
      * 
 356  
      * @return Skin
 357  
      */
 358  
     public Skin getSkin()
 359  
     {
 360  260
         return this.skin;
 361  
     } //-- Skin getSkin()
 362  
 
 363  
     /**
 364  
      * Get modify the version published display properties.
 365  
      * 
 366  
      * @return Version
 367  
      */
 368  
     public Version getVersion()
 369  
     {
 370  250
         return this.version;
 371  
     } //-- Version getVersion()
 372  
 
 373  
     /**
 374  
      * Method hashCode.
 375  
      * 
 376  
      * @return int
 377  
      */
 378  
     public int hashCode()
 379  
     {
 380  0
         int result = 17;
 381  
 
 382  0
         result = 37 * result + ( name != null ? name.hashCode() : 0 );
 383  0
         result = 37 * result + ( bannerLeft != null ? bannerLeft.hashCode() : 0 );
 384  0
         result = 37 * result + ( bannerRight != null ? bannerRight.hashCode() : 0 );
 385  0
         result = 37 * result + ( googleAdSenseClient != null ? googleAdSenseClient.hashCode() : 0 );
 386  0
         result = 37 * result + ( googleAdSenseSlot != null ? googleAdSenseSlot.hashCode() : 0 );
 387  0
         result = 37 * result + ( googleAnalyticsAccountId != null ? googleAnalyticsAccountId.hashCode() : 0 );
 388  0
         result = 37 * result + ( publishDate != null ? publishDate.hashCode() : 0 );
 389  0
         result = 37 * result + ( version != null ? version.hashCode() : 0 );
 390  0
         result = 37 * result + ( poweredBy != null ? poweredBy.hashCode() : 0 );
 391  0
         result = 37 * result + ( skin != null ? skin.hashCode() : 0 );
 392  0
         result = 37 * result + ( body != null ? body.hashCode() : 0 );
 393  0
         result = 37 * result + ( custom != null ? custom.hashCode() : 0 );
 394  
 
 395  0
         return result;
 396  
     } //-- int hashCode()
 397  
 
 398  
     /**
 399  
      * Method removePoweredBy.
 400  
      * 
 401  
      * @param logo
 402  
      */
 403  
     public void removePoweredBy( Logo logo )
 404  
     {
 405  0
         getPoweredBy().remove( logo );
 406  0
     } //-- void removePoweredBy( Logo )
 407  
 
 408  
     /**
 409  
      * Set banner logo on the masthead of the site to the left.
 410  
      * 
 411  
      * @param bannerLeft
 412  
      */
 413  
     public void setBannerLeft( Banner bannerLeft )
 414  
     {
 415  102
         this.bannerLeft = bannerLeft;
 416  102
     } //-- void setBannerLeft( Banner )
 417  
 
 418  
     /**
 419  
      * Set banner logo on the masthead of the site to the right.
 420  
      * 
 421  
      * @param bannerRight
 422  
      */
 423  
     public void setBannerRight( Banner bannerRight )
 424  
     {
 425  100
         this.bannerRight = bannerRight;
 426  100
     } //-- void setBannerRight( Banner )
 427  
 
 428  
     /**
 429  
      * Set the main site content decoration.
 430  
      * 
 431  
      * @param body
 432  
      */
 433  
     public void setBody( Body body )
 434  
     {
 435  134
         this.body = body;
 436  134
     } //-- void setBody( Body )
 437  
 
 438  
     /**
 439  
      * Set custom configuration for use with customized Velocity
 440  
      * templates. Data from this field are
 441  
      *             accessible in Velocity template from
 442  
      * <code>$decoration.custom</code> variable as DOM content.
 443  
      *             Example: <code>$decoration.custom.getChild(
 444  
      * 'customElement' ).getValue()</code>
 445  
      * 
 446  
      * @param custom
 447  
      */
 448  
     public void setCustom( Object custom )
 449  
     {
 450  82
         this.custom = custom;
 451  82
     } //-- void setCustom( Object )
 452  
 
 453  
     /**
 454  
      * Set your Google AdSense client id.
 455  
      * 
 456  
      * @param googleAdSenseClient
 457  
      */
 458  
     public void setGoogleAdSenseClient( String googleAdSenseClient )
 459  
     {
 460  0
         this.googleAdSenseClient = googleAdSenseClient;
 461  0
     } //-- void setGoogleAdSenseClient( String )
 462  
 
 463  
     /**
 464  
      * Set your Google AdSense slot id.
 465  
      * 
 466  
      * @param googleAdSenseSlot
 467  
      */
 468  
     public void setGoogleAdSenseSlot( String googleAdSenseSlot )
 469  
     {
 470  0
         this.googleAdSenseSlot = googleAdSenseSlot;
 471  0
     } //-- void setGoogleAdSenseSlot( String )
 472  
 
 473  
     /**
 474  
      * Set the id for your Google Analytics account.
 475  
      * 
 476  
      * @param googleAnalyticsAccountId
 477  
      */
 478  
     public void setGoogleAnalyticsAccountId( String googleAnalyticsAccountId )
 479  
     {
 480  0
         this.googleAnalyticsAccountId = googleAnalyticsAccountId;
 481  0
     } //-- void setGoogleAnalyticsAccountId( String )
 482  
 
 483  
     /**
 484  
      * Set timestamp of the last modification of this decoration
 485  
      * model.
 486  
      * 
 487  
      * @param lastModified
 488  
      */
 489  
     public void setLastModified( long lastModified )
 490  
     {
 491  0
         this.lastModified = lastModified;
 492  0
     } //-- void setLastModified( long )
 493  
 
 494  
     /**
 495  
      * Set the modelEncoding field.
 496  
      * 
 497  
      * @param modelEncoding
 498  
      */
 499  
     public void setModelEncoding( String modelEncoding )
 500  
     {
 501  120
         this.modelEncoding = modelEncoding;
 502  120
     } //-- void setModelEncoding( String )
 503  
 
 504  
     /**
 505  
      * Set the full name of the project.
 506  
      * 
 507  
      * @param name
 508  
      */
 509  
     public void setName( String name )
 510  
     {
 511  120
         this.name = name;
 512  120
     } //-- void setName( String )
 513  
 
 514  
     /**
 515  
      * Set powered by logos list.
 516  
      * 
 517  
      * @param poweredBy
 518  
      */
 519  
     public void setPoweredBy( java.util.List<Logo> poweredBy )
 520  
     {
 521  128
         this.poweredBy = poweredBy;
 522  128
     } //-- void setPoweredBy( java.util.List )
 523  
 
 524  
     /**
 525  
      * Set modify the date published display properties.
 526  
      * 
 527  
      * @param publishDate
 528  
      */
 529  
     public void setPublishDate( PublishDate publishDate )
 530  
     {
 531  22
         this.publishDate = publishDate;
 532  22
     } //-- void setPublishDate( PublishDate )
 533  
 
 534  
     /**
 535  
      * Set the artifact containing the skin for the site.
 536  
      * 
 537  
      * @param skin
 538  
      */
 539  
     public void setSkin( Skin skin )
 540  
     {
 541  32
         this.skin = skin;
 542  32
     } //-- void setSkin( Skin )
 543  
 
 544  
     /**
 545  
      * Set modify the version published display properties.
 546  
      * 
 547  
      * @param version
 548  
      */
 549  
     public void setVersion( Version version )
 550  
     {
 551  22
         this.version = version;
 552  22
     } //-- void setVersion( Version )
 553  
 
 554  
     /**
 555  
      * Method toString.
 556  
      * 
 557  
      * @return String
 558  
      */
 559  
     public java.lang.String toString()
 560  
     {
 561  0
         StringBuilder buf = new StringBuilder( 128 );
 562  
 
 563  0
         buf.append( "name = '" );
 564  0
         buf.append( getName() );
 565  0
         buf.append( "'" );
 566  0
         buf.append( "\n" ); 
 567  0
         buf.append( "bannerLeft = '" );
 568  0
         buf.append( getBannerLeft() );
 569  0
         buf.append( "'" );
 570  0
         buf.append( "\n" ); 
 571  0
         buf.append( "bannerRight = '" );
 572  0
         buf.append( getBannerRight() );
 573  0
         buf.append( "'" );
 574  0
         buf.append( "\n" ); 
 575  0
         buf.append( "googleAdSenseClient = '" );
 576  0
         buf.append( getGoogleAdSenseClient() );
 577  0
         buf.append( "'" );
 578  0
         buf.append( "\n" ); 
 579  0
         buf.append( "googleAdSenseSlot = '" );
 580  0
         buf.append( getGoogleAdSenseSlot() );
 581  0
         buf.append( "'" );
 582  0
         buf.append( "\n" ); 
 583  0
         buf.append( "googleAnalyticsAccountId = '" );
 584  0
         buf.append( getGoogleAnalyticsAccountId() );
 585  0
         buf.append( "'" );
 586  0
         buf.append( "\n" ); 
 587  0
         buf.append( "publishDate = '" );
 588  0
         buf.append( getPublishDate() );
 589  0
         buf.append( "'" );
 590  0
         buf.append( "\n" ); 
 591  0
         buf.append( "version = '" );
 592  0
         buf.append( getVersion() );
 593  0
         buf.append( "'" );
 594  0
         buf.append( "\n" ); 
 595  0
         buf.append( "poweredBy = '" );
 596  0
         buf.append( getPoweredBy() );
 597  0
         buf.append( "'" );
 598  0
         buf.append( "\n" ); 
 599  0
         buf.append( "skin = '" );
 600  0
         buf.append( getSkin() );
 601  0
         buf.append( "'" );
 602  0
         buf.append( "\n" ); 
 603  0
         buf.append( "body = '" );
 604  0
         buf.append( getBody() );
 605  0
         buf.append( "'" );
 606  0
         buf.append( "\n" ); 
 607  0
         buf.append( "custom = '" );
 608  0
         buf.append( getCustom() );
 609  0
         buf.append( "'" );
 610  
 
 611  0
         return buf.toString();
 612  
     } //-- java.lang.String toString()
 613  
 
 614  
     
 615  
             
 616  
     private java.util.Map<String, Menu> menusByRef;
 617  
 
 618  
     /**
 619  
      * @param key not null
 620  
      * @return the menu ref defined by the given key.
 621  
      */
 622  
     public Menu getMenuRef( String key )
 623  
     {
 624  0
         if ( menusByRef == null )
 625  
         {
 626  0
             menusByRef = new java.util.HashMap<String, Menu>();
 627  
 
 628  0
             if ( body != null )
 629  
             {
 630  0
                 for ( Menu menu : body.getMenus() )
 631  
                 {
 632  0
                     if ( menu.getRef() != null )
 633  
                     {
 634  0
                         menusByRef.put( menu.getRef(), menu );
 635  
                     }
 636  
                 }
 637  
             }
 638  
         }
 639  0
         return menusByRef.get( key );
 640  
     }
 641  
 
 642  
     /**
 643  
      * @param key not null
 644  
      */
 645  
     public void removeMenuRef( String key )
 646  
     {
 647  0
         if ( body != null )
 648  
         {
 649  0
             for ( java.util.Iterator<Menu> i = body.getMenus().iterator(); i.hasNext(); )
 650  
             {
 651  0
                 Menu menu = i.next();
 652  0
                 if ( key.equals( menu.getRef() ) )
 653  
                 {
 654  0
                     i.remove();
 655  
                 }
 656  0
             }
 657  
         }
 658  0
     }
 659  
 
 660  
     /**
 661  
      * @return the menus list or EMPTY_LIST.
 662  
      */
 663  
     public java.util.List<Menu> getMenus()
 664  
     {
 665  
         java.util.List menus;
 666  0
         if ( body != null && body.getMenus() != null )
 667  
         {
 668  0
             menus = body.getMenus();
 669  
         }
 670  
         else
 671  
         {
 672  0
             menus = java.util.Collections.emptyList();
 673  
         }
 674  0
         return menus;
 675  
     }
 676  
             
 677  
           
 678  
 }