Clover coverage report - Code Coverage for tapestry release 4.0-beta-9
Coverage timestamp: Sat Oct 1 2005 08:36:20 EDT
file stats: LOC: 67   Methods: 2
NCLOC: 28   Classes: 1
 
 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.IRequestCycle;
 20    import org.apache.tapestry.RenderRewoundException;
 21    import org.apache.tapestry.Tapestry;
 22    import org.apache.tapestry.engine.ActionServiceParameter;
 23    import org.apache.tapestry.engine.ILink;
 24    import org.apache.tapestry.listener.ListenerInvoker;
 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 getListenerInvoker().invokeListener(getListener(), 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   
 66    public abstract ListenerInvoker getListenerInvoker();
 67    }