Coverage report

  %line %branch
org.apache.jetspeed.portalsite.view.SiteViewMenuDefinitionLocator
0% 
0% 

 1  
 /*
 2  
  * Licensed to the Apache Software Foundation (ASF) under one or more
 3  
  * contributor license agreements.  See the NOTICE file distributed with
 4  
  * this work for additional information regarding copyright ownership.
 5  
  * The ASF licenses this file to You under the Apache License, Version 2.0
 6  
  * (the "License"); you may not use this file except in compliance with
 7  
  * the License.  You may obtain a copy of the License at
 8  
  * 
 9  
  *      http://www.apache.org/licenses/LICENSE-2.0
 10  
  * 
 11  
  * Unless required by applicable law or agreed to in writing, software
 12  
  * distributed under the License is distributed on an "AS IS" BASIS,
 13  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14  
  * See the License for the specific language governing permissions and
 15  
  * limitations under the License.
 16  
  */
 17  
 package org.apache.jetspeed.portalsite.view;
 18  
 
 19  
 import org.apache.jetspeed.om.folder.MenuDefinition;
 20  
 import org.apache.jetspeed.page.document.Node;
 21  
 
 22  
 /**
 23  
  * This class represents a menu definition locator that is
 24  
  * comprised of the menu name, (the full definition is saved
 25  
  * here from convenience), and concrete path of the
 26  
  * defining folder or page.
 27  
  * 
 28  
  * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
 29  
  * @version $Id: SiteViewMenuDefinitionLocator.java 517121 2007-03-12 07:45:49Z ate $
 30  
  */
 31  
 public class SiteViewMenuDefinitionLocator
 32  
 {
 33  
     /**
 34  
      * locator - locator string defined for menu containing
 35  
      *           menu name and concrete path of defining node
 36  
      */
 37  
     private String locator;
 38  
 
 39  
     /**
 40  
      * menuDefinition - menu definition
 41  
      */
 42  
     private MenuDefinition menuDefinition;
 43  
 
 44  
     /**
 45  
      * SiteViewMenuDefinitionLocator - custom menu definition constructor
 46  
      *
 47  
      * @param menuDefinition custom menu definition
 48  
      * @param definingNode defining page or folder
 49  
      */
 50  
     public SiteViewMenuDefinitionLocator(MenuDefinition menuDefinition, Node definingNode)
 51  0
     {
 52  0
         this.menuDefinition = menuDefinition;
 53  0
         this.locator = definingNode.getPath() + "|" + menuDefinition.getName();
 54  0
     }
 55  
 
 56  
     /**
 57  
      * SiteViewMenuDefinitionLocator - standard menu definition constructor
 58  
      *
 59  
      * @param menuDefinition standard menu definition
 60  
      */
 61  
     public SiteViewMenuDefinitionLocator(MenuDefinition menuDefinition)
 62  0
     {
 63  0
         this.menuDefinition = menuDefinition;
 64  0
         this.locator = "<standard_menu_definition>|" + menuDefinition.getName();
 65  0
     }
 66  
 
 67  
     /**
 68  
      * toString - return locator
 69  
      *
 70  
      * @return search path
 71  
      */
 72  
     public String toString()
 73  
     {
 74  0
         return locator;
 75  
     }
 76  
 
 77  
     /**
 78  
      * equals - compare as string to locator
 79  
      *
 80  
      * @return equals result
 81  
      */
 82  
     public boolean equals(Object obj)
 83  
     {
 84  0
         if (obj instanceof String)
 85  
         {
 86  0
             return locator.equals(obj);
 87  
         }
 88  0
         return locator.equals(obj.toString());
 89  
     }
 90  
 
 91  
     /**
 92  
      * hashCode - return search path hash code
 93  
      *
 94  
      * @return hash code
 95  
      */
 96  
     public int hashCode()
 97  
     {
 98  0
         return locator.hashCode();
 99  
     }
 100  
 
 101  
     /**
 102  
      * getMenuDefinition - return menu definition
 103  
      *
 104  
      * @return menu definition
 105  
      */
 106  
     public MenuDefinition getMenuDefinition()
 107  
     {
 108  0
         return menuDefinition;
 109  
     }
 110  
 
 111  
     /**
 112  
      * getName - return name of menu definition
 113  
      *
 114  
      * @return menu definition name
 115  
      */
 116  
     public String getName()
 117  
     {
 118  0
         return menuDefinition.getName();
 119  
     }
 120  
 }

This report is generated by jcoverage, Maven and Maven JCoverage Plugin.