Interface HstResponseState


  • public interface HstResponseState
    Temporarily holds the current state of a HST response. Basically the response of each HstComponent is buffered and stored in a HstResponseState implementation. At the final stage, the HstComponent container will flush every buffered content by using this HstResponseState implementation. Therefore, this interface has all the similar methods which can be found in HttpServletResponse to keep the contents buffered.
    Version:
    $Id$
    • Method Detail

      • isActionResponse

        boolean isActionResponse()
      • isRenderResponse

        boolean isRenderResponse()
      • isResourceResponse

        boolean isResourceResponse()
      • isMimeResponse

        boolean isMimeResponse()
      • isStateAwareResponse

        boolean isStateAwareResponse()
      • addCookie

        void addCookie​(javax.servlet.http.Cookie cookie)
      • addDateHeader

        void addDateHeader​(String name,
                           long date)
      • addIntHeader

        void addIntHeader​(String name,
                          int value)
      • containsHeader

        boolean containsHeader​(String name)
      • getErrorCode

        int getErrorCode()
      • getErrorMessage

        String getErrorMessage()
      • getRedirectLocation

        String getRedirectLocation()
      • getForwardPathInfo

        String getForwardPathInfo()
      • setDateHeader

        void setDateHeader​(String name,
                           long date)
      • setIntHeader

        void setIntHeader​(String name,
                          int value)
      • setStatus

        void setStatus​(int statusCode,
                       String message)
      • setStatus

        void setStatus​(int statusCode)
      • getStatus

        int getStatus()
        Returns:
        the status when set through setStatus(int) and 0 if not set
      • getBufferSize

        int getBufferSize()
      • getCharacterEncoding

        String getCharacterEncoding()
      • getContentType

        String getContentType()
      • getLocale

        Locale getLocale()
      • isCommitted

        boolean isCommitted()
      • reset

        void reset()
      • resetBuffer

        void resetBuffer()
      • setBufferSize

        void setBufferSize​(int size)
      • setCharacterEncoding

        void setCharacterEncoding​(String charset)
      • setContentLength

        void setContentLength​(int len)
      • setContentLengthLong

        void setContentLengthLong​(long len)
      • setContentType

        void setContentType​(String type)
      • setLocale

        void setLocale​(Locale locale)
      • addHeadElement

        void addHeadElement​(Element element,
                            String keyHint)
      • containsHeadElement

        boolean containsHeadElement​(String keyHint)
      • addProcessedHeadElement

        void addProcessedHeadElement​(Element headElement)
      • addPreambleNode

        void addPreambleNode​(Comment comment)
      • addPreambleNode

        void addPreambleNode​(Element element)
        Preamble Nodes are written before the rest of the content of this HstResponseState. Note that from this element only the attributes and text of the element are printed, and *not* any descendant @link org.w3c.dom.Node}s of element
        Parameters:
        element - the element that is a preamble
      • getPreambleNodes

        List<Node> getPreambleNodes()
        Return unmodifiable preamble Nodes.
        Returns:
        unmodifiable preamble Nodes
      • clearPreambleComments

        void clearPreambleComments()
        clears the currently available preamble nodes on the HstResponseState
      • addEpilogueNode

        void addEpilogueNode​(Comment comment)
      • getEpilogueNodes

        List<Node> getEpilogueNodes()
        Return unmodifiable epilogue Nodes.
        Returns:
        unmodifiable epilogue Nodes
      • clearEpilogueComments

        void clearEpilogueComments()
        clears the currently available epilogue nodes on the HstResponseState
      • setWrapperElement

        void setWrapperElement​(Element element)
      • getWrapperElement

        Element getWrapperElement()
      • clear

        void clear()
      • flush

        void flush​(boolean skipMessageBody)
            throws IOException
        Flushes the HstResponseState but depending on skipMessageBody skips writing the actual response message body
        Parameters:
        skipMessageBody -
        Throws:
        IOException
      • flush

        void flush​(Writer writer,
                   boolean skipMessageBody)
            throws IOException
        Flushes the HstResponseState to writer but depending on skipMessageBody skips writing the actual response message body
        Parameters:
        writer -
        skipMessageBody -
        Throws:
        IOException
      • isFlushed

        boolean isFlushed()