Class MockComponentContext

  • All Implemented Interfaces:
    com.day.cq.wcm.api.components.ComponentContext

    public final class MockComponentContext
    extends java.lang.Object
    implements com.day.cq.wcm.api.components.ComponentContext
    Mock implementation of ComponentContext.
    • Field Summary

      • Fields inherited from interface com.day.cq.wcm.api.components.ComponentContext

        BYPASS_COMPONENT_HANDLING_ON_INCLUDE_ATTRIBUTE, CONTEXT_ATTR_NAME
    • Constructor Summary

      Constructors 
      Constructor Description
      MockComponentContext​(@NotNull com.day.cq.wcm.api.Page currentPage, @NotNull org.apache.sling.api.SlingHttpServletRequest request)  
    • Constructor Detail

      • MockComponentContext

        public MockComponentContext​(@NotNull
                                    @NotNull com.day.cq.wcm.api.Page currentPage,
                                    @NotNull
                                    @NotNull org.apache.sling.api.SlingHttpServletRequest request)
        Parameters:
        currentPage - Current page
        request - Request
    • Method Detail

      • getPage

        public com.day.cq.wcm.api.Page getPage()
        Specified by:
        getPage in interface com.day.cq.wcm.api.components.ComponentContext
      • getResource

        public org.apache.sling.api.resource.Resource getResource()
        Specified by:
        getResource in interface com.day.cq.wcm.api.components.ComponentContext
      • getComponent

        public com.day.cq.wcm.api.components.Component getComponent()
        Specified by:
        getComponent in interface com.day.cq.wcm.api.components.ComponentContext
      • getAttribute

        public java.lang.Object getAttribute​(java.lang.String name)
        Specified by:
        getAttribute in interface com.day.cq.wcm.api.components.ComponentContext
      • setAttribute

        public java.lang.Object setAttribute​(java.lang.String name,
                                             java.lang.Object value)
        Specified by:
        setAttribute in interface com.day.cq.wcm.api.components.ComponentContext
      • hasDecoration

        public boolean hasDecoration()
        Specified by:
        hasDecoration in interface com.day.cq.wcm.api.components.ComponentContext
      • setDecorate

        public void setDecorate​(boolean decorate)
        Specified by:
        setDecorate in interface com.day.cq.wcm.api.components.ComponentContext
      • getDecorationTagName

        public java.lang.String getDecorationTagName()
        Specified by:
        getDecorationTagName in interface com.day.cq.wcm.api.components.ComponentContext
      • setDecorationTagName

        public void setDecorationTagName​(java.lang.String value)
        Specified by:
        setDecorationTagName in interface com.day.cq.wcm.api.components.ComponentContext
      • getDefaultDecorationTagName

        public java.lang.String getDefaultDecorationTagName()
        Specified by:
        getDefaultDecorationTagName in interface com.day.cq.wcm.api.components.ComponentContext
      • setDefaultDecorationTagName

        public void setDefaultDecorationTagName​(java.lang.String value)
        Specified by:
        setDefaultDecorationTagName in interface com.day.cq.wcm.api.components.ComponentContext
      • getEditContext

        public com.day.cq.wcm.api.components.EditContext getEditContext()
        Specified by:
        getEditContext in interface com.day.cq.wcm.api.components.ComponentContext
      • getCell

        public com.day.cq.wcm.api.designer.Cell getCell()
        Specified by:
        getCell in interface com.day.cq.wcm.api.components.ComponentContext
      • setCell

        public void setCell​(com.day.cq.wcm.api.designer.Cell cell)
      • getCssClassNames

        public java.util.Set<java.lang.String> getCssClassNames()
        Specified by:
        getCssClassNames in interface com.day.cq.wcm.api.components.ComponentContext
      • setCssClassNames

        public void setCssClassNames​(java.util.Set<java.lang.String> cssClassNames)
      • getParent

        public com.day.cq.wcm.api.components.ComponentContext getParent()
        Specified by:
        getParent in interface com.day.cq.wcm.api.components.ComponentContext
      • getRoot

        public com.day.cq.wcm.api.components.ComponentContext getRoot()
        Specified by:
        getRoot in interface com.day.cq.wcm.api.components.ComponentContext
      • isRoot

        public boolean isRoot()
        Specified by:
        isRoot in interface com.day.cq.wcm.api.components.ComponentContext
      • getAnalyzeContext

        public com.day.cq.wcm.api.components.AnalyzeContext getAnalyzeContext()
        Specified by:
        getAnalyzeContext in interface com.day.cq.wcm.api.components.ComponentContext