Class FilteringHeaderResponse

    • Field Detail

      • DEFAULT_HEADER_FILTER_NAME

        public static final java.lang.String DEFAULT_HEADER_FILTER_NAME
        The default name of the filter that will collect contributions which should be rendered in the page's <head>
        See Also:
        Constant Field Values
    • Constructor Detail

      • FilteringHeaderResponse

        public FilteringHeaderResponse​(IHeaderResponse response)
        Constructor without explicit filters. Generates filters automatically for any FilteredHeaderItem. Any other contribution is rendered in the page's <head>
        Parameters:
        response - the wrapped IHeaderResponse
        See Also:
        HeaderResponseContainer
      • FilteringHeaderResponse

        public FilteringHeaderResponse​(IHeaderResponse response,
                                       java.lang.String headerFilterName,
                                       java.lang.Iterable<? extends FilteringHeaderResponse.IHeaderResponseFilter> filters)
        Construct.
        Parameters:
        response - the wrapped IHeaderResponse
        headerFilterName - the name that the filter for things that should appear in the head (default Wicket location) uses
        filters - the filters to use to bucket things. There will be a bucket created for each filter, by name. There should typically be at least one filter with the same name as your headerFilterName
    • Method Detail

      • get

        public static FilteringHeaderResponse get()
        Returns:
        the FilteringHeaderResponse being used in this RequestCycle
      • close

        public void close()
        Description copied from interface: IHeaderResponse
        Mark Header rendering is completed and subsequent usage will be ignored. If some kind of buffering is used internally, this action will mark that the contents has to be flushed out.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface IHeaderResponse
        Overrides:
        close in class DecoratingHeaderResponse
      • getContent

        public final java.lang.CharSequence getContent​(java.lang.String filterName)
        Gets the content that was rendered to this header response and matched the filter with the given name.
        Parameters:
        filterName - the name of the filter to get the bucket for
        Returns:
        the content that was accepted by the filter with this name
      • decorate

        protected IHeaderResponse decorate​(IHeaderResponse response)
        Decorate the given response used to get contents.
        Parameters:
        response - response to decorate
        Returns:
        default implementation just returns the response