Clover coverage report - Code Coverage for tapestry release 4.0-alpha-3
Coverage timestamp: Mon May 16 2005 09:05:49 EDT
file stats: LOC: 68   Methods: 2
NCLOC: 29   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
ActionLink.java 50% 66.7% 100% 70%
coverage coverage
 1   
 // Copyright 2004, 2005 The Apache Software Foundation
 2   
 //
 3   
 // Licensed under the Apache License, Version 2.0 (the "License");
 4   
 // you may not use this file except in compliance with the License.
 5   
 // You may obtain a copy of the License at
 6   
 //
 7   
 //     http://www.apache.org/licenses/LICENSE-2.0
 8   
 //
 9   
 // Unless required by applicable law or agreed to in writing, software
 10   
 // distributed under the License is distributed on an "AS IS" BASIS,
 11   
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12   
 // See the License for the specific language governing permissions and
 13   
 // limitations under the License.
 14   
 
 15   
 package org.apache.tapestry.link;
 16   
 
 17   
 import org.apache.tapestry.IAction;
 18   
 import org.apache.tapestry.IActionListener;
 19   
 import org.apache.tapestry.IBinding;
 20   
 import org.apache.tapestry.IRequestCycle;
 21   
 import org.apache.tapestry.RenderRewoundException;
 22   
 import org.apache.tapestry.Tapestry;
 23   
 import org.apache.tapestry.engine.ActionServiceParameter;
 24   
 import org.apache.tapestry.engine.ILink;
 25   
 import org.apache.tapestry.listener.ListenerInvoker;
 26   
 
 27   
 /**
 28   
  * A component for creating a link that is handled using the action service. [ <a
 29   
  * href="../../../../../ComponentReference/ActionLink.html">Component Reference </a>]
 30   
  * 
 31   
  * @author Howard Lewis Ship
 32   
  */
 33   
 
 34   
 public abstract class ActionLink extends AbstractLinkComponent implements IAction
 35   
 {
 36   
     public abstract boolean isStateful();
 37   
 
 38   
     /**
 39   
      * Returns true if the stateful parameter is bound to a true value. If stateful is not bound,
 40   
      * also returns the default, true.
 41   
      * <p>
 42   
      * Note that this method can be called when the component is not rendering, therefore it must
 43   
      * directly access the {@link IBinding}for the stateful parameter.
 44   
      */
 45   
 
 46  1
     public boolean getRequiresSession()
 47   
     {
 48  1
         return isStateful();
 49   
     }
 50   
 
 51  1
     public ILink getLink(IRequestCycle cycle)
 52   
     {
 53  1
         String actionId = cycle.getNextActionId();
 54   
 
 55  1
         if (cycle.isRewound(this))
 56   
         {
 57  0
             getListenerInvoker().invokeListener(getListener(), this, cycle);
 58   
 
 59  0
             throw new RenderRewoundException(this);
 60   
         }
 61   
 
 62  1
         return getLink(cycle, Tapestry.ACTION_SERVICE, new ActionServiceParameter(this, actionId));
 63   
     }
 64   
 
 65   
     public abstract IActionListener getListener();
 66   
 
 67   
     public abstract ListenerInvoker getListenerInvoker();
 68   
 }