Java URL Optimization API (Core API) 2.1.0

com.endeca.soleng.urlformatter
Interface UrlFormatter

All Known Implementing Classes:
BasicUrlFormatter

public interface UrlFormatter

An interface that is responsible for formatting UrlState objects into URL strings. Implementations are also responsible for parsing HttpServletRequest objects into UrlState objects.

See Also:
UrlState

Method Summary
 AggrERecUrlParam createAggrERecUrlParam(UrlState pUrlState, com.endeca.navigation.AggrERec pAggrERec)
          Creates an URL parameter containing an AggrERec.
 ERecUrlParam createERecUrlParam(UrlState pUrlState, com.endeca.navigation.ERec pERec)
          Creates an URL parameter containing an ERec.
 NavStateUrlParam createNavStateUrlParam(UrlState pUrlState)
          Creates an URL parameter containing an empty NavState.
 UrlParam createUrlParam(UrlState pUrlState, java.lang.String pKey, java.lang.String pValue)
          Creates an URL parameter for the specified UrlState.
 java.lang.String formatUrl(UrlState pUrlState)
          Formats the specified UrlState into an URL string.
 java.lang.String getAggrERecParamKey()
          The parameter key used for aggregate record detail links - typically "A".
 java.lang.String getDefaultEncoding()
          Returns the default character encoding that should be used when transforming URLs to and from various string forms.
 java.lang.String getERecParamKey()
          The parameter key used for record detail links - typically "R".
 java.lang.String getNavStateParamKey()
          The parameter key used for navigation state - typically "N".
 UrlState parseRequest(javax.servlet.http.HttpServletRequest pRequest)
          Parses the specified request into an UrlState.
 

Method Detail

parseRequest

UrlState parseRequest(javax.servlet.http.HttpServletRequest pRequest)
                      throws UrlFormatException
Parses the specified request into an UrlState.

Parameters:
pRequest - the request to parse.
Throws:
UrlFormatException - if the request cannot be parsed.

formatUrl

java.lang.String formatUrl(UrlState pUrlState)
                           throws UrlFormatException
Formats the specified UrlState into an URL string.

Parameters:
pUrlState - the UrlState to format.
Throws:
UrlFormatException - if the UrlState cannot be formatted.

getDefaultEncoding

java.lang.String getDefaultEncoding()
Returns the default character encoding that should be used when transforming URLs to and from various string forms. This value is overridden by any character encoding specified explicitly when constructing an UrlState.

Returns:
the default encoding.
See Also:
UrlState.UrlState(UrlFormatter,String)

createUrlParam

UrlParam createUrlParam(UrlState pUrlState,
                        java.lang.String pKey,
                        java.lang.String pValue)
Creates an URL parameter for the specified UrlState. This is an internal method used by an UrlState. You shouldn't need to use this method unless you are implementing a custom UrlFormatter.

Parameters:
pUrlState - the UrlState that will contain the parameter.
pKey - the parameter key.
pValue - the parameter string value (fully decoded).
Returns:
the newly created URL parameter.

createERecUrlParam

ERecUrlParam createERecUrlParam(UrlState pUrlState,
                                com.endeca.navigation.ERec pERec)
Creates an URL parameter containing an ERec. This is an internal method used by an UrlState. You shouldn't need to use this method unless you are implementing a custom UrlFormatter.

Parameters:
pUrlState - the UrlState that will contain the parameter.
pERec - the ERec to be contained in the UrlState.
Returns:
the newly created URL parameter.
See Also:
getERecParamKey()

createAggrERecUrlParam

AggrERecUrlParam createAggrERecUrlParam(UrlState pUrlState,
                                        com.endeca.navigation.AggrERec pAggrERec)
Creates an URL parameter containing an AggrERec. This is an internal method used by an UrlState. You shouldn't need to use this method unless you are implementing a custom UrlFormatter.

Parameters:
pUrlState - the UrlState that will contain the parameter.
pAggrERec - the AggrERec to be contained in the UrlState.
Returns:
the newly created URL parameter.
See Also:
getAggrERecParamKey()

createNavStateUrlParam

NavStateUrlParam createNavStateUrlParam(UrlState pUrlState)
Creates an URL parameter containing an empty NavState. This is an internal method used by an UrlState. You shouldn't need to use this method unless you are implementing a custom UrlFormatter.

Parameters:
pUrlState - the UrlState that will contain the parameter.
Returns:
the newly created URL parameter.
See Also:
getNavStateParamKey()

getNavStateParamKey

java.lang.String getNavStateParamKey()
The parameter key used for navigation state - typically "N".

See Also:
createNavStateUrlParam(UrlState)

getERecParamKey

java.lang.String getERecParamKey()
The parameter key used for record detail links - typically "R".

See Also:
createERecUrlParam(UrlState,com.endeca.navigation.ERec)

getAggrERecParamKey

java.lang.String getAggrERecParamKey()
The parameter key used for aggregate record detail links - typically "A".

See Also:
createAggrERecUrlParam(UrlState,com.endeca.navigation.AggrERec)

Java URL Optimization API (Core API) 2.1.0

Copyright © 2010 Endeca Technologies, Inc. All Rights Reserved.
@VERSION
PRODUCT: Java URL Optimization API (Core API) (urlFormatterCore)
VERSION: 2.1.0
BUILD:   12010DEV
ARCH_OS: n/a
DATE:    2010-06-29T04:02:40-0400