Coverage Report - org.apache.tapestry.services.LinkFactory
 
Classes in this File Line Coverage Branch Coverage Complexity
LinkFactory
N/A
N/A
1
 
 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.services;
 16  
 
 17  
 import java.util.Map;
 18  
 
 19  
 import org.apache.tapestry.IRequestCycle;
 20  
 import org.apache.tapestry.engine.IEngineService;
 21  
 import org.apache.tapestry.engine.ILink;
 22  
 import org.apache.tapestry.engine.ServiceEncoder;
 23  
 
 24  
 /**
 25  
  * A source of {@link org.apache.tapestry.engine.ILink}instances. This is
 26  
  * primarily used by {@link org.apache.tapestry.engine.IEngineService}s.
 27  
  * 
 28  
  * @author Howard M. Lewis Ship
 29  
  * @since 4.0
 30  
  */
 31  
 public interface LinkFactory
 32  
 {
 33  
 
 34  
     /**
 35  
      * Constructs an {@link org.apache.tapestry.engine.ILink}.
 36  
      * 
 37  
      * @param service
 38  
      *            the service for which the link is being generated
 39  
      * @param post
 40  
      *            if true, then the link will be used for a post (not a get,
 41  
      *            i.e., for a HTML form); this may affect what information is
 42  
      *            encoded into the link
 43  
      * @param parameters
 44  
      *            A map; keys are strings and values are strings or string
 45  
      *            arrays (exception: key {@link ServiceConstants#PARAMETER} is
 46  
      *            an array of objects. Certain keys, defined in
 47  
      *            {@link ServiceConstants} may have special meaning. The map
 48  
      *            will typically be modified internally. May not be null.
 49  
      * @param stateful
 50  
      *            If true, then the final URL should be encoded (with the
 51  
      *            session id) if necessary. If false, the session encoding
 52  
      *            should not occur. The latter case is useful for services that
 53  
      *            will absolutely not need any access to user-specific state.
 54  
      */
 55  
     ILink constructLink(IEngineService service, boolean post,
 56  
             Map parameters, boolean stateful);
 57  
 
 58  
     /**
 59  
      * A secondary function of the service is to convert encoded (aka
 60  
      * "squeezed") listener parameters back into an array of Objects. This does
 61  
      * (barely) makes sense .. the link factory is responsible for encoding the
 62  
      * listener parameters, it should be responsible for decoding them.
 63  
      * 
 64  
      * @param cycle
 65  
      *            the current request cycle
 66  
      * @return an array of Object[]. May return an empty array, but won't return
 67  
      *         null.
 68  
      */
 69  
 
 70  
     Object[] extractListenerParameters(IRequestCycle cycle);
 71  
 
 72  
     /**
 73  
      * Returns an array of {@link org.apache.tapestry.engine.ServiceEncoder},
 74  
      * ordering into execution order. May return an empty array, but won't
 75  
      * return null.
 76  
      */
 77  
 
 78  
     ServiceEncoder[] getServiceEncoders();
 79  
 }