org.hippoecm.hst.mock.core.linking
Class MockHstLink

java.lang.Object
  extended by org.hippoecm.hst.mock.core.linking.MockHstLink
All Implemented Interfaces:
HstLink

public class MockHstLink
extends Object
implements HstLink

Mock implementation of HstLink.


Field Summary
 
Fields inherited from interface org.hippoecm.hst.core.linking.HstLink
PATH_SUBPATH_DELIMITER
 
Constructor Summary
MockHstLink()
           
MockHstLink(String path)
           
 
Method Summary
 boolean getContainerResource()
           
 Mount getMount()
           
 String getPath()
          Note: This is *not* a url!
 String[] getPathElements()
           
 String getSubPath()
          Returns the subPath of this HstLink object.
 boolean isNotFound()
          When for example for some bean the (real) link cannot be created through the HstLinkCreator, a HstLink can be returned with a path that is for example from some configured property like '/pagenotfound'.
 void setContainerResource(boolean containerResource)
           
 void setMount(Mount mount)
           
 void setNotFound(boolean notFound)
           
 void setPath(String path)
          (re)-sets the path of the HstLink
 void setSubPath(String subPath)
          sets the subPath of this HstLink.
 String toUrlForm(HstRequestContext requestContext, boolean fullyQualified)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockHstLink

public MockHstLink()

MockHstLink

public MockHstLink(String path)
Method Detail

getPath

public String getPath()
Description copied from interface: HstLink
Note: This is *not* a url!

Specified by:
getPath in interface HstLink
Returns:
the path of this HstLink. Note: This is *not* a url! The value never starts or ends with a slash /

setPath

public void setPath(String path)
Description copied from interface: HstLink
(re)-sets the path of the HstLink

Specified by:
setPath in interface HstLink

getContainerResource

public boolean getContainerResource()
Specified by:
getContainerResource in interface HstLink
Returns:
true when the HstLink represents a container resource, like a repository binary

setContainerResource

public void setContainerResource(boolean containerResource)
Specified by:
setContainerResource in interface HstLink
Parameters:
containerResource - sets the containerResource

getPathElements

public String[] getPathElements()
Specified by:
getPathElements in interface HstLink
Returns:
the path elements of this HstLink, which is the HstLink.getPath() splitted on slashes

isNotFound

public boolean isNotFound()
Description copied from interface: HstLink
When for example for some bean the (real) link cannot be created through the HstLinkCreator, a HstLink can be returned with a path that is for example from some configured property like '/pagenotfound'. If this method returns true it indicates that the link is some hardcoded path for beans that cannot be linked to

Specified by:
isNotFound in interface HstLink
Returns:
true when this HstLink indicates to be a link that is actually a notFound link

setNotFound

public void setNotFound(boolean notFound)
Specified by:
setNotFound in interface HstLink
Parameters:
notFound - true whether this HstLink is actually a notFound link

getMount

public Mount getMount()
Specified by:
getMount in interface HstLink
Returns:
the Mount that can represent this link. This might be an Mount which is a different one then the Mount the link was created in. This could result in a cross-domain (different hostname) link being created, depending on the backing Mount.getVirtualHost(). If no Mount is set, null can be returned

setMount

public void setMount(Mount mount)

getSubPath

public String getSubPath()
Description copied from interface: HstLink
Returns the subPath of this HstLink object. This part will be appended to the HstLink.getPath() and delimited by ./. It will be before the queryString. Note that an empty String subPath will result in a URL having a ./ appended: An empty subPath is thus something different then a null subPath.

Specified by:
getSubPath in interface HstLink
Returns:
the subPath of this HstLink object.

setSubPath

public void setSubPath(String subPath)
Description copied from interface: HstLink
sets the subPath of this HstLink. Note that setting the subPath to an empty String will result in a URL having a ./ appended: An empty subPath is thus something different then a null subPath.

Specified by:
setSubPath in interface HstLink

toUrlForm

public String toUrlForm(HstRequestContext requestContext,
                        boolean fullyQualified)
Specified by:
toUrlForm in interface HstLink
fullyQualified - if true, the returned link is a fully qualified URL, in other words including http/https etc
Returns:
the url form of this HstLink, which is a url


Copyright © 2008-2012 Hippo. All Rights Reserved.