|
Java URL Optimization API (Core API) 2.1.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.endeca.soleng.urlformatter.UrlState
public class UrlState
An object that represents URL state for a web application request - a
central component for this API. This object is transformed into URL strings
via UrlFormatter
objects and marshaled into ENEQuery
objects via QueryBuilder
objects.
UrlFormatter
,
QueryBuilder
Constructor Summary | |
---|---|
UrlState(UrlFormatter pUrlFormatter,
java.lang.String pEncoding)
Constructs an empty UrlState object. |
Method Summary | |
---|---|
void |
clearNavState()
Clears any existing navigation state from this UrlState . |
java.lang.Object |
clone()
Returns a cloned instance of this UrlState object. |
boolean |
containsAggrERec()
Returns true if this UrlState contains an AggrERec parameter. |
boolean |
containsERec()
Returns true if this UrlState contains an ERec parameter. |
boolean |
containsNavState()
Returns true if this UrlState contains a navigation state
parameter. |
com.endeca.navigation.AggrERec |
getAggrERec()
Returns the associated AggrERec for this UrlState. |
java.lang.String |
getEncoding()
Returns the character encoding that is used when marshaling parameters and strings contained within this UrlState . |
com.endeca.navigation.ERec |
getERec()
Returns the associated ERec for this UrlState. |
com.endeca.navigation.DimLocationList |
getNavState()
Returns the navigation state for this UrlState or null
if there is no navigation state. |
java.lang.String |
getParam(java.lang.String pKey)
Returns the value associated with the specified key in the underlying parameter map. |
java.util.Collection |
getParameters()
Returns a collection of all UrlParam mappings contained within
this UrlState . |
UrlParam |
getUrlParam(java.lang.String pKey)
Returns the full UrlParam value associated with the specified
key in the underlying parameter map. |
void |
inform(com.endeca.navigation.ENEQueryResults pENEQueryResults)
Initializes this UrlState using state from the
specified ENEQueryResults . |
UrlState |
removeDescriptor(com.endeca.navigation.DimVal pDescriptor,
boolean pClone)
Removes the specifed descriptor DimVal from the current
navigation state. |
void |
removeNavState()
Fully removes any navigation state from this UrlState . |
java.lang.String |
removeParam(java.lang.String pKey)
Removes any value associated with the specified key from the underlying parameter map. |
UrlState |
selectAncestor(com.endeca.navigation.DimVal pAncestor,
com.endeca.navigation.DimVal pDescriptor,
boolean pClone)
Selects an ancestor DimVal for the specified descriptor
DimVal . |
UrlState |
selectRefinement(com.endeca.navigation.Dimension pRefinementDimension,
com.endeca.navigation.DimVal pRefinement,
boolean pClone)
Selects a navigation refinement DimVal from the specified
refinement Dimension . |
UrlState |
selectRefinement(com.endeca.navigation.DimLocation pRefinement,
boolean pClone)
Selects a navigation refinement using a DimLocation object. |
void |
setAggrERec(com.endeca.navigation.AggrERec pAggrERec)
Sets the associated AggrERec for this UrlState. |
void |
setERec(com.endeca.navigation.ERec pERec)
Sets the associated ERec for this UrlState. |
void |
setNavState(com.endeca.navigation.DimensionList pDescriptorDimensionList)
Sets the navigation state for this UrlState using a DimensionList . |
void |
setNavState(com.endeca.navigation.DimLocationList pDimLocationList)
Sets the navigation state for this UrlState using a DimLocationList . |
void |
setNavState(com.endeca.navigation.ERec pERec,
com.endeca.navigation.DimValList pDimValList)
Sets the navigation state for this UrlState using an ERec
and a DimValList . |
java.lang.String |
setParam(java.lang.String pKey,
java.lang.String pValue)
Associates the specified value with the specified key in the underlying parameter map. |
java.lang.String |
toString()
Returns an encoded string representation of this UrlState . |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public UrlState(UrlFormatter pUrlFormatter, java.lang.String pEncoding)
UrlState
object.
pUrlFormatter
- the UrlFormatter
to associate with the UrlState
pEncoding
- the character encoding that should be used when performing various
string transformations. If not null, this value overrides the default encoding for the
specified UrlFormatter
.UrlFormatter.getDefaultEncoding()
Method Detail |
---|
public java.lang.String getEncoding()
UrlState
.
public java.lang.String toString()
UrlState
.
This method utilizes UrlFormatter.formatUrl(UrlState)
to construct
the string.
toString
in class java.lang.Object
UrlState
.public java.lang.String setParam(java.lang.String pKey, java.lang.String pValue)
pKey
- the parameter keypValue
- the parameter value
java.lang.IllegalArgumentException
- if the specified key is null.public java.lang.String getParam(java.lang.String pKey)
pKey
- the parameter key
java.lang.IllegalArgumentException
- if the specified key is null.public UrlParam getUrlParam(java.lang.String pKey)
UrlParam
value associated with the specified
key in the underlying parameter map. Returns null if there is no value for
the specified key.
pKey
- the parameter key
UrlParam
value associated with the specified key,
or null if there is no associated parameter value.
java.lang.IllegalArgumentException
- if the specified key is null.public java.lang.String removeParam(java.lang.String pKey)
pKey
- the parameter key
java.lang.IllegalArgumentException
- if the specified key is null.public java.util.Collection getParameters()
UrlParam
mappings contained within
this UrlState
.
UrlParam
parameters.public void inform(com.endeca.navigation.ENEQueryResults pENEQueryResults)
UrlState
using state from the
specified ENEQueryResults
. This method is typically used
to construct fully "informed" UrlState
objects that can
be used to create ancestor or refinemement links.
pENEQueryResults
- the query resultspublic boolean containsERec()
UrlState
contains an ERec parameter.
UrlFormatter.getERecParamKey()
public void setERec(com.endeca.navigation.ERec pERec)
pERec
- the ERec to associate with this UrlState; can be null
to clear any previously associated ERecpublic com.endeca.navigation.ERec getERec()
public boolean containsAggrERec()
UrlState
contains an AggrERec parameter.
UrlFormatter.getAggrERecParamKey()
public void setAggrERec(com.endeca.navigation.AggrERec pAggrERec)
pAggrERec
- the AggrERec to associate with this UrlState; can
be null to clear any previously associated AggrERecpublic com.endeca.navigation.AggrERec getAggrERec()
public boolean containsNavState()
UrlState
contains a navigation state
parameter.
UrlFormatter.getNavStateParamKey()
public void setNavState(com.endeca.navigation.DimLocationList pDimLocationList)
UrlState
using a DimLocationList
.
This method is typically used to set navigation state from dimension
search results.
pDimLocationList
- the DimLocationList to associate with this
UrlState.clearNavState()
,
removeNavState()
public void setNavState(com.endeca.navigation.DimensionList pDescriptorDimensionList)
UrlState
using a DimensionList
.
This method is typically used to set navigation state from
Navigation.getDescriptorDimensions()
from a current
ENEQueryResults
object.
pDescriptorDimensionList
- the Dimension list to associate with this
UrlState.clearNavState()
,
removeNavState()
public void setNavState(com.endeca.navigation.ERec pERec, com.endeca.navigation.DimValList pDimValList)
UrlState
using an ERec
and a DimValList
. The ERec
is used to reconstruct
full a DimLocationList
for the specified DimValList
. If the
record does not contain enough information to reconstruct a particular DimLocation
,
a degenerate DimLocation
is created and added to the list instead. A degenerate
DimLocation
contains the DimVal and an empty ancestor list.
pERec
- the source ERec
used to reconstruct a full
DimLocationList
object.pDimValList
- the descriptor DimVal
objects that
represent the desired navigation state.clearNavState()
,
removeNavState()
public com.endeca.navigation.DimLocationList getNavState()
UrlState
or null
if there is no navigation state.
java.lang.IllegalStateException
- if the navigation state wasn't explicitly
or implicitly set on this UrlState
.inform(ENEQueryResults)
,
setNavState(DimLocationList)
,
setNavState(DimensionList)
,
setNavState(ERec,DimValList)
,
clearNavState()
public void clearNavState()
UrlState
. This
method is the functional equivalent of setting "N=0"
.
This method will implicitly create an empty navigation
state if one doesn't already exist on this UrlState
.
public void removeNavState()
UrlState
.
public UrlState selectRefinement(com.endeca.navigation.Dimension pRefinementDimension, com.endeca.navigation.DimVal pRefinement, boolean pClone)
DimVal
from the specified
refinement Dimension
. This method is typically used to
select navigation refinements from Navigation.getRefinements()
.
This method is functionally similar to ENEQueryToolkit.selectRefinement(...)
.
This method will implicitly create an empty navigation
state if one doesn't already exist on this UrlState
. This
is done before selecting the specified refinement.
pRefinementDimension
- a Dimension
object from
Navigation.getRefinementDimensions()
.pRefinement
- a valid refinement DimVal
from
pRefinementDimension.getRefinements()
.pClone
- specifies whether this operation should modify a
cloned instance of this UrlState
.
UrlState
object that was modified, i.e. a cloned
UrlState
if pClone
is true
or
this
if pClone
is false
.
java.lang.IllegalStateException
- if the navigation state wasn't explicitly
or implicitly set on this UrlState
.inform(ENEQueryResults)
,
setNavState(DimLocationList)
,
setNavState(DimensionList)
,
setNavState(ERec,DimValList)
,
clearNavState()
public UrlState selectRefinement(com.endeca.navigation.DimLocation pRefinement, boolean pClone)
DimLocation
object.
This method is typically used to select navigation refinements from
ERec.getDimValues()
.
This method is functionally similar to ENEQueryToolkit.selectRefinement(...)
.
This method will implicitly create an empty navigation
state if one doesn't already exist on this UrlState
. This
is done before selecting the specified refinement.
pRefinement
- the DimLocation
to selectpClone
- specifies whether this operation should modify a
cloned instance of this UrlState
.
UrlState
object that was modified, i.e. a cloned
UrlState
if pClone
is true
or
this
if pClone
is false
.
java.lang.IllegalStateException
- if the navigation state wasn't explicitly
set on this UrlState
.inform(ENEQueryResults)
,
setNavState(DimLocationList)
,
setNavState(DimensionList)
,
setNavState(ERec,DimValList)
,
clearNavState()
public UrlState selectAncestor(com.endeca.navigation.DimVal pAncestor, com.endeca.navigation.DimVal pDescriptor, boolean pClone)
DimVal
for the specified descriptor
DimVal
.
This method is functionally similar to ENEQueryToolkit.selectAncestor(...)
.
This method will implicitly create an empty navigation
state if one doesn't already exist on this UrlState
.
pAncestor
- the ancestor DimVal
to select.pDescriptor
- the descriptor DimVal
related to the specifed ancestor.pClone
- specifies whether this operation should modify a
cloned instance of this UrlState
.
UrlState
object that was modified (i.e. a cloned
UrlState
if pClone
is true
or
this
if pClone
is false
.
java.lang.IllegalStateException
- if the navigation state wasn't explicitly
set on this UrlState
.inform(ENEQueryResults)
,
setNavState(DimLocationList)
,
setNavState(DimensionList)
,
setNavState(ERec,DimValList)
public UrlState removeDescriptor(com.endeca.navigation.DimVal pDescriptor, boolean pClone)
DimVal
from the current
navigation state.
This method is functionally similar to ENEQueryToolkit.removeDescriptor(...)
.
This method will implicitly create an empty navigation
state if one doesn't already exist on this UrlState
.
pDescriptor
- the DimVal
to removepClone
- specifies whether this operation should modify a
cloned instance of this UrlState
.
UrlState
object that was modified, i.e. a cloned
UrlState
if pClone
is true
or
this
if pClone
is false
.
java.lang.IllegalStateException
- if the navigation state wasn't explicitly
set on this UrlState
.inform(ENEQueryResults)
,
setNavState(DimLocationList)
,
setNavState(DimensionList)
,
setNavState(ERec,DimValList)
public java.lang.Object clone()
UrlState
object.
clone
in class java.lang.Object
|
Java URL Optimization API (Core API) 2.1.0 | |||||||||
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.0 BUILD: 12010DEV ARCH_OS: n/a DATE: 2010-06-29T04:02:40-0400