Clover coverage report - Code Coverage for tapestry release 4.0-alpha-2
Coverage timestamp: Thu May 5 2005 09:57:44 EDT
file stats: LOC: 65   Methods: 2
NCLOC: 27   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   
 
 26   
 /**
 27   
  * A component for creating a link that is handled using the action service. [ <a
 28   
  * href="../../../../../ComponentReference/ActionLink.html">Component Reference </a>]
 29   
  * 
 30   
  * @author Howard Lewis Ship
 31   
  */
 32   
 
 33   
 public abstract class ActionLink extends AbstractLinkComponent implements IAction
 34   
 {
 35   
     public abstract boolean isStateful();
 36   
 
 37   
     /**
 38   
      * Returns true if the stateful parameter is bound to a true value. If stateful is not bound,
 39   
      * also returns the default, true.
 40   
      * <p>
 41   
      * Note that this method can be called when the component is not rendering, therefore it must
 42   
      * directly access the {@link IBinding}for the stateful parameter.
 43   
      */
 44   
 
 45  1
     public boolean getRequiresSession()
 46   
     {
 47  1
         return isStateful();
 48   
     }
 49   
 
 50  1
     public ILink getLink(IRequestCycle cycle)
 51   
     {
 52  1
         String actionId = cycle.getNextActionId();
 53   
 
 54  1
         if (cycle.isRewound(this))
 55   
         {
 56  0
             getListener().actionTriggered(this, cycle);
 57   
 
 58  0
             throw new RenderRewoundException(this);
 59   
         }
 60   
 
 61  1
         return getLink(cycle, Tapestry.ACTION_SERVICE, new ActionServiceParameter(this, actionId));
 62   
     }
 63   
 
 64   
     public abstract IActionListener getListener();
 65   
 }