org.apache.tapestry.services.impl
Class LinkFactoryImpl

java.lang.Object
  extended byorg.apache.tapestry.services.impl.LinkFactoryImpl
All Implemented Interfaces:
LinkFactory

public class LinkFactoryImpl
extends java.lang.Object
implements LinkFactory

Since:
4.0
Author:
Howard M. Lewis Ship

Constructor Summary
LinkFactoryImpl()
           
 
Method Summary
 ILink constructLink(IEngineService service, boolean post, java.util.Map parameters, boolean stateful)
          Constructs an ILink.
 java.lang.Object[] extractListenerParameters(IRequestCycle cycle)
          A secondary function of the service is to convert encoded (aka "squeezed") listener parameters back into an array of Objects.
protected  void finalizeParameters(IEngineService service, java.util.Map parameters)
           
 ServiceEncoder[] getServiceEncoders()
          Returns an array of ServiceEncoder, ordering into execution order.
 void initializeService()
           
 void setContextPath(java.lang.String contextPath)
           
 void setContributions(java.util.List contributions)
           
 void setDataSqueezer(DataSqueezer dataSqueezer)
           
 void setErrorLog(org.apache.hivemind.ErrorLog errorLog)
           
 void setPersistenceStrategySource(PropertyPersistenceStrategySource persistenceStrategySource)
          This is kind of limiting; it's possible that other things beyond persistence strategies will want to have a hand at encoding data into URLs.
 void setRequest(WebRequest request)
           
 void setRequestCycle(IRequestCycle requestCycle)
           
 void setServletPath(java.lang.String servletPath)
           
protected  void squeezeServiceParameters(java.util.Map parameters)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkFactoryImpl

public LinkFactoryImpl()
Method Detail

initializeService

public void initializeService()

constructLink

public ILink constructLink(IEngineService service,
                           boolean post,
                           java.util.Map parameters,
                           boolean stateful)
Description copied from interface: LinkFactory
Constructs an ILink.

Specified by:
constructLink in interface LinkFactory
Parameters:
service - the service for which the link is being generated
post - if true, then the link will be used for a post (not a get, i.e., for a HTML form); this may affect what information is encoded into the link
parameters - A map; keys are strings and values are strings or string arrays (exception: key ServiceConstants.PARAMETER is an array of objects. Certain keys, defined in ServiceConstants may have special meaning. The map will typically be modified internally. May not be null.
stateful - If true, then the final URL should be encoded (with the session id) if necessary. If false, the session encoding should not occur. The latter case is useful for services that will absolutely not need any access to user-specific state.

finalizeParameters

protected void finalizeParameters(IEngineService service,
                                  java.util.Map parameters)

getServiceEncoders

public ServiceEncoder[] getServiceEncoders()
Description copied from interface: LinkFactory
Returns an array of ServiceEncoder, ordering into execution order. May return an empty array, but won't return null.

Specified by:
getServiceEncoders in interface LinkFactory

squeezeServiceParameters

protected void squeezeServiceParameters(java.util.Map parameters)

extractListenerParameters

public java.lang.Object[] extractListenerParameters(IRequestCycle cycle)
Description copied from interface: LinkFactory
A secondary function of the service is to convert encoded (aka "squeezed") listener parameters back into an array of Objects. This does (barely) makes sense .. the link factory is responsible for encoding the listener parameters, it should be responsible for decoding them.

Specified by:
extractListenerParameters in interface LinkFactory
Parameters:
cycle - the current request cycle
Returns:
an array of Object[]. May return an empty array, but won't return null.

setDataSqueezer

public void setDataSqueezer(DataSqueezer dataSqueezer)

setContributions

public void setContributions(java.util.List contributions)

setErrorLog

public void setErrorLog(org.apache.hivemind.ErrorLog errorLog)

setServletPath

public void setServletPath(java.lang.String servletPath)

setContextPath

public void setContextPath(java.lang.String contextPath)

setRequest

public void setRequest(WebRequest request)

setPersistenceStrategySource

public void setPersistenceStrategySource(PropertyPersistenceStrategySource persistenceStrategySource)
This is kind of limiting; it's possible that other things beyond persistence strategies will want to have a hand at encoding data into URLs. If that comes to pass, we'll need to implement an event coordinator/listener combo to let implementations know about links being generated.


setRequestCycle

public void setRequestCycle(IRequestCycle requestCycle)