org.hippoecm.hst.mock.core.request
Class MockComponentConfiguration

java.lang.Object
  extended by org.hippoecm.hst.mock.core.request.MockComponentConfiguration
All Implemented Interfaces:
ComponentConfiguration

public class MockComponentConfiguration
extends Object
implements ComponentConfiguration

Mock implementation of {@link org.hippoecm.hst.core.request.ComponentConfiguration for testing purposes.


Constructor Summary
MockComponentConfiguration()
           
 
Method Summary
 void addLocalParameter(String name, String value)
           
 void addParameter(String name, String value)
           
 void addRawLocalParameter(String name, String value)
           
 void addRawParameter(String name, String value)
           
 String getCanonicalIdentifier()
          Returns the identifier of the backing stored component configuration.
 String getCanonicalPath()
          Returns the canonical path of the backing stored configuration location.
 HstComponentConfiguration.Type getComponentType()
           
 String getLocalParameter(String name, ResolvedSiteMapItem hstResolvedSiteMapItem)
          Returns the property without inheritance and if an expession exists it is resolved with the help of the ResolvedSiteMapItem
 Map<String,String> getLocalParameters(ResolvedSiteMapItem hstResolvedSiteMapItem)
          Returns all resolved parameters without inheritance into a map
 String getParameter(String name, ResolvedSiteMapItem hstResolvedSiteMapItem)
          Returns the property and if an expession exists it is resolved with the help of the ResolvedSiteMapItem
 List<String> getParameterNames()
           
 Map<String,String> getParameters(ResolvedSiteMapItem hstResolvedSiteMapItem)
          Returns all resolved parameters into a map
 Map<String,String> getRawLocalParameters()
          Also see ComponentConfiguration.getLocalParameters(ResolvedSiteMapItem).
 Map<String,String> getRawParameters()
          Also see ComponentConfiguration.getParameters(ResolvedSiteMapItem).
 String getRenderPath()
           
 String getServeResourcePath()
           
 String getXType()
           
 void removeLocalParameter(String name)
           
 void removeParameter(String name)
           
 void removeRawLocalParameter(String name)
           
 void removeRawParameter(String name)
           
 void setCanonicalIdentifier(String canonicalIdentifier)
           
 void setCanonicalPath(String canonicalPath)
           
 void setComponentType(HstComponentConfiguration.Type componentType)
           
 void setRenderPath(String renderPath)
           
 void setServeResourcePath(String serveResourcePath)
           
 void setXType(String xType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockComponentConfiguration

public MockComponentConfiguration()
Method Detail

getParameter

public String getParameter(String name,
                           ResolvedSiteMapItem hstResolvedSiteMapItem)
Description copied from interface: ComponentConfiguration
Returns the property and if an expession exists it is resolved with the help of the ResolvedSiteMapItem

Specified by:
getParameter in interface ComponentConfiguration

getParameters

public Map<String,String> getParameters(ResolvedSiteMapItem hstResolvedSiteMapItem)
Description copied from interface: ComponentConfiguration
Returns all resolved parameters into a map

Specified by:
getParameters in interface ComponentConfiguration

addParameter

public void addParameter(String name,
                         String value)

removeParameter

public void removeParameter(String name)

getLocalParameter

public String getLocalParameter(String name,
                                ResolvedSiteMapItem hstResolvedSiteMapItem)
Description copied from interface: ComponentConfiguration
Returns the property without inheritance and if an expession exists it is resolved with the help of the ResolvedSiteMapItem

Specified by:
getLocalParameter in interface ComponentConfiguration

getLocalParameters

public Map<String,String> getLocalParameters(ResolvedSiteMapItem hstResolvedSiteMapItem)
Description copied from interface: ComponentConfiguration
Returns all resolved parameters without inheritance into a map

Specified by:
getLocalParameters in interface ComponentConfiguration

addLocalParameter

public void addLocalParameter(String name,
                              String value)

removeLocalParameter

public void removeLocalParameter(String name)

getRawParameters

public Map<String,String> getRawParameters()
Description copied from interface: ComponentConfiguration
Also see ComponentConfiguration.getParameters(ResolvedSiteMapItem). Normally, you use ComponentConfiguration.getParameters(ResolvedSiteMapItem), unless you want to access parameter values without having their property placeholders (like ${1}) substituded by the current request context. In other words, the parameter values exactly the way they are in the HstComponentConfiguration

Specified by:
getRawParameters in interface ComponentConfiguration
Returns:
An unmodifiableMap of all parameters the way they are configured in the hst component configuration without having any property placeholder filled in by the current context

addRawParameter

public void addRawParameter(String name,
                            String value)

removeRawParameter

public void removeRawParameter(String name)

getRawLocalParameters

public Map<String,String> getRawLocalParameters()
Description copied from interface: ComponentConfiguration
Also see ComponentConfiguration.getLocalParameters(ResolvedSiteMapItem). Normally, you use ComponentConfiguration.getLocalParameters(ResolvedSiteMapItem), unless you want to access parameter values without having their property placeholders (like ${1}) substituded by the current request context. In other words, the parameter values exactly the way they are in the HstComponentConfiguration. Note that this method does not return inherited parameters, but only its local (directly) configured ones

Specified by:
getRawLocalParameters in interface ComponentConfiguration
Returns:
An unmodifiableMap of all parameters the way they are configured in the hst component configuration without having any property placeholder filled in by the current context and without parameter inheritance

addRawLocalParameter

public void addRawLocalParameter(String name,
                                 String value)

removeRawLocalParameter

public void removeRawLocalParameter(String name)

getRenderPath

public String getRenderPath()
Specified by:
getRenderPath in interface ComponentConfiguration
Returns:
the location of the view renderer

setRenderPath

public void setRenderPath(String renderPath)

getServeResourcePath

public String getServeResourcePath()
Specified by:
getServeResourcePath in interface ComponentConfiguration
Returns:
return the servletpath of the servlet that must serve the resources for this HstComponent

setServeResourcePath

public void setServeResourcePath(String serveResourcePath)

getCanonicalPath

public String getCanonicalPath()
Description copied from interface: ComponentConfiguration
Returns the canonical path of the backing stored configuration location. Note that multiple (many) ComponentConfiguration's can share the same canonical path: When a component is added by a reference, this method will return the same canonical path as the direct (not referenced) component.

Specified by:
getCanonicalPath in interface ComponentConfiguration
Returns:
the canonical path of the backing stored configuration location.

setCanonicalPath

public void setCanonicalPath(String canonicalPath)

getCanonicalIdentifier

public String getCanonicalIdentifier()
Description copied from interface: ComponentConfiguration
Returns the identifier of the backing stored component configuration. Note that multiple ComponentConfiguration's can share the same canonical identifier due to inheritance. Also, multiple subsites can share the same backing configuration, and thus share the same canonical identifiers

Specified by:
getCanonicalIdentifier in interface ComponentConfiguration
Returns:
the identifier of the backing stored component configuration

setCanonicalIdentifier

public void setCanonicalIdentifier(String canonicalIdentifier)

getComponentType

public HstComponentConfiguration.Type getComponentType()
Specified by:
getComponentType in interface ComponentConfiguration
Returns:
the HstComponentConfiguration.Type of this ComponentConfiguration

setComponentType

public void setComponentType(HstComponentConfiguration.Type componentType)

getXType

public String getXType()
Specified by:
getXType in interface ComponentConfiguration
Returns:
the xtype of this ComponentConfiguration and null if the component does not have one

setXType

public void setXType(String xType)

getParameterNames

public List<String> getParameterNames()
Specified by:
getParameterNames in interface ComponentConfiguration
Returns:
the ordered list of available parameter names, empty list if there are no parameters


Copyright © 2008-2012 Hippo. All Rights Reserved.