|
Java URL Optimization API (Core API) 2.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.endeca.soleng.urlformatter.basic.BasicUrlFormatter
public class BasicUrlFormatter
An UrlFormatter
that formats traditional Endeca URLs.
Property Summary | ||
---|---|---|
Property | Type | Default Value |
defaultEncoding |
String |
UTF-8 |
prependQuestionMark |
boolean |
true |
navStateParamKey |
String |
N |
ERecParamKey |
String |
R |
aggrERecParamKey |
String |
A |
Constructor Summary | |
---|---|
BasicUrlFormatter()
|
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 encoding for this URL formatter. |
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". |
boolean |
getPrependQuestionMark()
|
UrlState |
parseRequest(javax.servlet.http.HttpServletRequest pRequest)
Parses the specified request into an UrlState . |
UrlState |
parseRequest(java.lang.String pQueryString,
java.lang.String pCharacterEncoding)
|
void |
setAggrERecParamKey(java.lang.String pAggrERecParamKey)
Sets the AggrERecParamKey. |
void |
setDefaultEncoding(java.lang.String pDefaultEncoding)
Sets the default encoding for this URL formatter. |
void |
setERecParamKey(java.lang.String pERecParamKey)
Sets the ERecParamKey. |
void |
setNavStateParamKey(java.lang.String pNavStateParamKey)
Sets the NavStateParamKey. |
void |
setPrependQuestionMark(boolean pPrependQuestionMark)
Determines whether or not question marks will be appended to the Url. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicUrlFormatter()
Method Detail |
---|
public UrlState parseRequest(javax.servlet.http.HttpServletRequest pRequest) throws UrlFormatException
UrlFormatter
UrlState
.
parseRequest
in interface UrlFormatter
pRequest
- the request to parse.
UrlFormatException
- if the request cannot be parsed.public UrlState parseRequest(java.lang.String pQueryString, java.lang.String pCharacterEncoding) throws UrlFormatException
UrlFormatException
public java.lang.String formatUrl(UrlState pUrlState) throws UrlFormatException
UrlFormatter
UrlState
into an URL string.
formatUrl
in interface UrlFormatter
pUrlState
- the UrlState
to format.
UrlFormatException
- if the UrlState
cannot be formatted.public UrlParam createUrlParam(UrlState pUrlState, java.lang.String pKey, java.lang.String pValue)
UrlFormatter
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
.
createUrlParam
in interface UrlFormatter
pUrlState
- the UrlState
that will contain the parameter.pKey
- the parameter key.pValue
- the parameter string value (fully decoded).
public ERecUrlParam createERecUrlParam(UrlState pUrlState, com.endeca.navigation.ERec pERec)
UrlFormatter
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
.
createERecUrlParam
in interface UrlFormatter
pUrlState
- the UrlState
that will contain the parameter.pERec
- the ERec
to be contained in the UrlState
.
UrlFormatter.getERecParamKey()
public AggrERecUrlParam createAggrERecUrlParam(UrlState pUrlState, com.endeca.navigation.AggrERec pAggrERec)
UrlFormatter
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
.
createAggrERecUrlParam
in interface UrlFormatter
pUrlState
- the UrlState
that will contain the parameter.pAggrERec
- the AggrERec
to be contained in the UrlState
.
UrlFormatter.getAggrERecParamKey()
public NavStateUrlParam createNavStateUrlParam(UrlState pUrlState)
UrlFormatter
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
.
createNavStateUrlParam
in interface UrlFormatter
pUrlState
- the UrlState
that will contain the parameter.
UrlFormatter.getNavStateParamKey()
public java.lang.String getDefaultEncoding()
getDefaultEncoding
in interface UrlFormatter
UrlState.UrlState(UrlFormatter,String)
public void setDefaultEncoding(java.lang.String pDefaultEncoding)
pDefaultEncoding
- Encoding to set. Cannot be null.
java.lang.IllegalArgumentException
- if pDefaultEncoding is null.
The encoding is set to "UTF", for example.public boolean getPrependQuestionMark()
public void setPrependQuestionMark(boolean pPrependQuestionMark)
pPrependQuestionMark
- flag to set.
If this is set to true:
String url = urlFormatter.formatUrl(urlState); // url = "?N=0";
If this is set to false:
String url = urlFormatter.formatUrl(urlState); // url = "N=0";
public java.lang.String getNavStateParamKey()
UrlFormatter
getNavStateParamKey
in interface UrlFormatter
UrlFormatter.createNavStateUrlParam(UrlState)
public void setNavStateParamKey(java.lang.String pNavStateParamKey)
pNavStateParamKey
- to set. Cannot be null.
java.lang.IllegalArgumentException
- if pNavStateParamKey is null.public java.lang.String getERecParamKey()
UrlFormatter
getERecParamKey
in interface UrlFormatter
UrlFormatter.createERecUrlParam(UrlState,com.endeca.navigation.ERec)
public void setERecParamKey(java.lang.String pERecParamKey)
pERecParamKey
- to set. Cannot be null.
java.lang.IllegalArgumentException
- if pERecParamKey is null.public java.lang.String getAggrERecParamKey()
UrlFormatter
getAggrERecParamKey
in interface UrlFormatter
UrlFormatter.createAggrERecUrlParam(UrlState,com.endeca.navigation.AggrERec)
public void setAggrERecParamKey(java.lang.String pAggrERecParamKey)
pAggrERecParamKey
- to set. Cannot be null.
java.lang.IllegalArgumentException
- if pAggrERecParamKey is null.
|
Java URL Optimization API (Core API) 2.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@VERSION PRODUCT: Java URL Optimization API (Core API) (urlFormatterCore) VERSION: 2.1.1 BUILD: 12083DEV ARCH_OS: n/a DATE: 2012-02-16T20:40:08-0500