org.apache.tapestry.engine
Class ServiceEncodingImpl

java.lang.Object
  extended by org.apache.tapestry.engine.ServiceEncodingImpl
All Implemented Interfaces:
ServiceEncoding

public class ServiceEncodingImpl
extends java.lang.Object
implements ServiceEncoding

Implementation of ServiceEncoding, which adds the ability to determine when the encoding has been modified.

Since:
4.0
Author:
Howard M. Lewis Ship

Constructor Summary
ServiceEncodingImpl(java.lang.String servletPath)
          Creates a new instance with a new map of parameters.
ServiceEncodingImpl(java.lang.String servletPath, java.util.Map parametersMap)
           
ServiceEncodingImpl(java.lang.String servletPath, java.lang.String pathInfo, QueryParameterMap parameters)
           
 
Method Summary
 java.lang.String[] getParameterNames()
          Returns an array of parameter names.
 java.lang.String getParameterValue(java.lang.String name)
          Returns the value for the named parameter.
 java.lang.String[] getParameterValues(java.lang.String name)
          Returns the value for the named parameter.
 java.lang.String getPathInfo()
          Returns the portion of the URL after the servlet itself.
 java.lang.String getServletPath()
          Returns the servlet path for the request.
 boolean isModified()
           
 void resetModified()
           
 void setParameterValue(java.lang.String name, java.lang.String value)
          Sets the value for the named query parameter to the provided string.
 void setParameterValues(java.lang.String name, java.lang.String[] values)
          Sets the values for a named query parameter.
 void setServletPath(java.lang.String servletPath)
          Updates the servlet path for the encoding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceEncodingImpl

public ServiceEncodingImpl(java.lang.String servletPath)
Creates a new instance with a new map of parameters.


ServiceEncodingImpl

public ServiceEncodingImpl(java.lang.String servletPath,
                           java.util.Map parametersMap)

ServiceEncodingImpl

public ServiceEncodingImpl(java.lang.String servletPath,
                           java.lang.String pathInfo,
                           QueryParameterMap parameters)
Method Detail

isModified

public boolean isModified()

resetModified

public void resetModified()

getParameterValue

public java.lang.String getParameterValue(java.lang.String name)
Description copied from interface: ServiceEncoding
Returns the value for the named parameter. If multiple values are stored for the query parameter, only the first is returned.

Specified by:
getParameterValue in interface ServiceEncoding
Returns:
the value, or null if no such query parameter exists

getParameterValues

public java.lang.String[] getParameterValues(java.lang.String name)
Description copied from interface: ServiceEncoding
Returns the value for the named parameter.

Specified by:
getParameterValues in interface ServiceEncoding
Returns:
the values, or null if no such query parameter exists

setServletPath

public void setServletPath(java.lang.String servletPath)
Description copied from interface: ServiceEncoding
Updates the servlet path for the encoding. In some cases, this is a combination of the servlet and additional path info.

Specified by:
setServletPath in interface ServiceEncoding

setParameterValue

public void setParameterValue(java.lang.String name,
                              java.lang.String value)
Description copied from interface: ServiceEncoding
Sets the value for the named query parameter to the provided string.

Specified by:
setParameterValue in interface ServiceEncoding
Parameters:
name - the name of the parameter to set.
value - the new value, which may be null.

setParameterValues

public void setParameterValues(java.lang.String name,
                               java.lang.String[] values)
Description copied from interface: ServiceEncoding
Sets the values for a named query parameter.

Specified by:
setParameterValues in interface ServiceEncoding

getServletPath

public java.lang.String getServletPath()
Description copied from interface: ServiceEncoding
Returns the servlet path for the request. This is the portion of the URL recognized as the servlet. When the URL pattern (in web.xml) ends in a "*" (such as "/book/*"), this method will return the matched servlet portion ("/book/") and {#link #getPathInfo} will return the rest of the URL.

Specified by:
getServletPath in interface ServiceEncoding

getParameterNames

public java.lang.String[] getParameterNames()
Description copied from interface: ServiceEncoding
Returns an array of parameter names. The names are returned in alphabetically sorted order. This list includes all parameter names, even those for which the stored value is null.

Specified by:
getParameterNames in interface ServiceEncoding

getPathInfo

public java.lang.String getPathInfo()
Description copied from interface: ServiceEncoding
Returns the portion of the URL after the servlet itself.

Specified by:
getPathInfo in interface ServiceEncoding
Returns:
pathInfo if path info was supplied in the request, or null otherwise.