public class MockHstSiteMenuItem extends Object implements HstSiteMenuItem
HstSiteMenuItem
.Constructor and Description |
---|
MockHstSiteMenuItem() |
MockHstSiteMenuItem(String name) |
MockHstSiteMenuItem(String name,
boolean isExpanded) |
Modifier and Type | Method and Description |
---|---|
void |
addLocalParameter(String name,
String value) |
void |
addParameter(String name,
String value) |
HstSiteMenuItem |
addSiteMenuItem(HstSiteMenuItem siteMenuItem) |
List<HstSiteMenuItem> |
getChildMenuItems() |
int |
getDepth() |
String |
getExternalLink()
When this method does not return null, then by default
CommonMenuItem.getHstLink() will return null even
if the sitemenu item has a sitemap reference path defined |
HstLink |
getHstLink() |
HstSiteMenu |
getHstSiteMenu() |
String |
getLocalParameter(String name)
The value of the local (no parameters inherited from ancestor items) parameter with possible property placeholders substituted
|
Map<String,String> |
getLocalParameters() |
String |
getName() |
String |
getParameter(String name)
A HstSiteMenuItem can contain a Map of parameters.
|
Map<String,String> |
getParameters()
Parameters are inherited from ancestor sitemenu items.
|
HstSiteMenuItem |
getParentItem() |
Map<String,Object> |
getProperties()
When developers have customized SiteMenuItem configuration with extra properties, these properties can be
accessed through this Map
|
List<HstSiteMenuItem> |
getSiteMenuItems() |
boolean |
isExpanded()
A sitemenu item is expanded if one of its descendants is selected or if it is selected itself
|
boolean |
isRepositoryBased() |
boolean |
isSelected() |
void |
putAllProperties(Map<String,Object> properties) |
void |
removeLocalParameter(String name) |
void |
removeParameter(String name) |
ResolvedSiteMapItem |
resolveToSiteMapItem() |
ResolvedSiteMapItem |
resolveToSiteMapItem(HstRequest request) |
void |
setDepth(int depth) |
void |
setExpanded(boolean isExpanded) |
void |
setExternalLink(String externalLink) |
void |
setHstLink(HstLink hstLink) |
void |
setHstSiteMenu(HstSiteMenu hstSiteMenu) |
void |
setName(String name) |
void |
setParentItem(HstSiteMenuItem parentItem) |
void |
setRepositoryBased(boolean repositoryBased) |
void |
setSelected(boolean selected) |
public MockHstSiteMenuItem()
public MockHstSiteMenuItem(String name)
public MockHstSiteMenuItem(String name, boolean isExpanded)
public List<HstSiteMenuItem> getChildMenuItems()
getChildMenuItems
in interface HstSiteMenuItem
public String getName()
getName
in interface CommonMenuItem
public ResolvedSiteMapItem resolveToSiteMapItem()
resolveToSiteMapItem
in interface CommonMenuItem
ResolvedSiteMapItem
belonging to this SiteMenuItem or null
if it
cannot be resolved in the HstSiteMap
public ResolvedSiteMapItem resolveToSiteMapItem(HstRequest request)
resolveToSiteMapItem
in interface CommonMenuItem
public Map<String,Object> getProperties()
CommonMenuItem
getProperties
in interface CommonMenuItem
public HstSiteMenuItem addSiteMenuItem(HstSiteMenuItem siteMenuItem)
public boolean isExpanded()
CommonMenuItem
isExpanded
in interface CommonMenuItem
true
if the SiteMenuItem is expandedpublic void setExpanded(boolean isExpanded)
public HstSiteMenuItem getParentItem()
getParentItem
in interface HstSiteMenuItem
HstSiteMenuItem
or null
if it is a root itempublic void setParentItem(HstSiteMenuItem parentItem)
public HstSiteMenu getHstSiteMenu()
getHstSiteMenu
in interface HstSiteMenuItem
HstSiteMenu
of this HstSiteMenuItem
public void setHstSiteMenu(HstSiteMenu hstSiteMenu)
public HstLink getHstLink()
getHstLink
in interface CommonMenuItem
public void setHstLink(HstLink hstLink)
public String getExternalLink()
CommonMenuItem
CommonMenuItem.getHstLink()
will return null
even
if the sitemenu item has a sitemap reference path definedgetExternalLink
in interface CommonMenuItem
null
if no external link is definedpublic void setExternalLink(String externalLink)
public boolean isRepositoryBased()
isRepositoryBased
in interface CommonMenuItem
true
when below this sitemenu item repository based navigation is expectedpublic void setRepositoryBased(boolean repositoryBased)
public int getDepth()
getDepth
in interface CommonMenuItem
public void setDepth(int depth)
public boolean isSelected()
isSelected
in interface CommonMenuItem
true
is the SiteMenuItem is selectedpublic void setSelected(boolean selected)
public List<HstSiteMenuItem> getSiteMenuItems()
public void setName(String name)
public String getParameter(String name)
HstSiteMenuItem
null
will be returned. The parameters are fetched from the HstSiteMenuItemConfiguration.getParameter(String)
, but in the value possible property placeholders in the
value are replaced by the wildcards from HstSiteMapItem
that was matched. When there are property placeholders that can not be resolved, the value
is set to null
Parameters are inherited from ancestor HstSiteMenuItem's. When this HstSiteMenuItem configures the same parameter as an ancestor, the
value from the ancestor is overwritten.getParameter
in interface HstSiteMenuItem
name
- the name of the parameternull
when not present or has unresolved property placeholderspublic Map<String,String> getParameters()
HstSiteMenuItem
getParameters
in interface HstSiteMenuItem
HstSiteMenu
. If no parameters present, and empty map is returned, only now the entire parameters map is returned.
public void removeParameter(String name)
public String getLocalParameter(String name)
HstSiteMenuItem
getLocalParameter
in interface HstSiteMenuItem
name
- the name of the parameternull
when not present or has unresolved property placeholders, only this method returns parameters without inheritance
public Map<String,String> getLocalParameters()
getLocalParameters
in interface HstSiteMenuItem
HstSiteMapItem
. If no parameters present, and empty map is returned, only this method returns parameters without inheritance
public void removeLocalParameter(String name)
Copyright © 2008–2016 Hippo B.V. (http://www.onehippo.com). All rights reserved.