File Source: ThemeTemplateWrapper.java

         /* 
    P/P   *  Method: org.apache.roller.weblogger.pojos.wrapper.ThemeTemplateWrapper__static_init
          */
     1  /*
     2   * Licensed to the Apache Software Foundation (ASF) under one or more
     3   * contributor license agreements.  The ASF licenses this file to You
     4   * under the Apache License, Version 2.0 (the "License"); you may not
     5   * use this file except in compliance with the License.
     6   * You may obtain a copy of the License at
     7   *
     8   *   http://www.apache.org/licenses/LICENSE-2.0
     9   *
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS,
    12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13   * See the License for the specific language governing permissions and
    14   * limitations under the License.  For additional information regarding
    15   * copyright in this work, please see the NOTICE file in the top level
    16   * directory of this distribution.
    17   */
    18  
    19  package org.apache.roller.weblogger.pojos.wrapper;
    20  
    21  import java.util.Date;
    22  import org.apache.roller.weblogger.pojos.ThemeTemplate;
    23  
    24  
    25  /**
    26   * Pojo safety wrapper for ThemeTemplate objects.
    27   */
    28  public class ThemeTemplateWrapper {
    29      
    30      // keep a reference to the wrapped pojo
    31      private final ThemeTemplate pojo;
    32      
    33      // this is private so that we can force the use of the .wrap(pojo) method
             /* 
    P/P       *  Method: void org.apache.roller.weblogger.pojos.wrapper.ThemeTemplateWrapper(ThemeTemplate)
              * 
              *  Postconditions:
              *    this.pojo == toWrap
              *    init'ed(this.pojo)
              */
    34      private ThemeTemplateWrapper(ThemeTemplate toWrap) {
    35          this.pojo = toWrap;
    36      }
    37      
    38      
    39      // wrap the given pojo if it is not null
    40      public static ThemeTemplateWrapper wrap(ThemeTemplate toWrap) {
                 /* 
    P/P           *  Method: ThemeTemplateWrapper wrap(ThemeTemplate)
                  * 
                  *  Postconditions:
                  *    return_value == One-of{&new ThemeTemplateWrapper(wrap#1), null}
                  *    return_value in Addr_Set{null,&new ThemeTemplateWrapper(wrap#1)}
                  *    new ThemeTemplateWrapper(wrap#1) num objects <= 1
                  *    new ThemeTemplateWrapper(wrap#1).pojo == toWrap
                  *    new ThemeTemplateWrapper(wrap#1).pojo != null
                  * 
                  *  Test Vectors:
                  *    toWrap: Addr_Set{null}, Inverse{null}
                  */
    41          if(toWrap != null)
    42              return new ThemeTemplateWrapper(toWrap);
    43          
    44          return null;
    45      }
    46      
    47      
    48      public String getId() {
                 /* 
    P/P           *  Method: String getId()
                  * 
                  *  Preconditions:
                  *    this.pojo != null
                  * 
                  *  Postconditions:
                  *    init'ed(return_value)
                  */
    49          return this.pojo.getId();
    50      }
    51      
    52      
    53      public String getName() {
                 /* 
    P/P           *  Method: String getName()
                  * 
                  *  Preconditions:
                  *    this.pojo != null
                  * 
                  *  Postconditions:
                  *    init'ed(return_value)
                  */
    54          return this.pojo.getName();
    55      }
    56      
    57      
    58      public String getDescription() {
                 /* 
    P/P           *  Method: String getDescription()
                  * 
                  *  Preconditions:
                  *    this.pojo != null
                  * 
                  *  Postconditions:
                  *    init'ed(return_value)
                  */
    59          return this.pojo.getDescription();
    60      }
    61      
    62      
    63      public String getContents() {
                 /* 
    P/P           *  Method: String getContents()
                  * 
                  *  Preconditions:
                  *    this.pojo != null
                  *    (soft) init'ed(this.pojo.contents)
                  * 
                  *  Postconditions:
                  *    (soft) init'ed(return_value)
                  */
    64          return this.pojo.getContents();
    65      }
    66      
    67      
    68      public String getLink() {
                 /* 
    P/P           *  Method: String getLink()
                  * 
                  *  Preconditions:
                  *    this.pojo != null
                  *    (soft) init'ed(this.pojo.link)
                  * 
                  *  Postconditions:
                  *    (soft) init'ed(return_value)
                  */
    69          return this.pojo.getLink();
    70      }
    71      
    72      
    73      public Date getLastModified() {
                 /* 
    P/P           *  Method: Date getLastModified()
                  * 
                  *  Preconditions:
                  *    this.pojo != null
                  * 
                  *  Postconditions:
                  *    init'ed(return_value)
                  */
    74          return this.pojo.getLastModified();
    75      }
    76      
    77      
    78      public boolean isHidden() {
                 /* 
    P/P           *  Method: bool isHidden()
                  * 
                  *  Preconditions:
                  *    this.pojo != null
                  *    (soft) init'ed(this.pojo.hidden)
                  * 
                  *  Postconditions:
                  *    init'ed(return_value)
                  */
    79          return this.pojo.isHidden();
    80      }
    81      
    82      
    83      public boolean isNavbar() {
                 /* 
    P/P           *  Method: bool isNavbar()
                  * 
                  *  Preconditions:
                  *    this.pojo != null
                  *    (soft) init'ed(this.pojo.navbar)
                  * 
                  *  Postconditions:
                  *    init'ed(return_value)
                  */
    84          return this.pojo.isNavbar();
    85      }
    86      
    87  }








SofCheck Inspector Build Version : 2.18479
ThemeTemplateWrapper.java 2009-Jan-02 14:24:46
ThemeTemplateWrapper.class 2009-Sep-04 03:12:32