Class TextTemplateDecorator

  • All Implemented Interfaces:
    Closeable, Serializable, AutoCloseable, org.apache.wicket.util.io.IClusterable, org.apache.wicket.util.resource.IResourceStream, org.apache.wicket.util.resource.IStringResourceStream, org.apache.wicket.util.watch.IModifiable
    Direct Known Subclasses:
    CssTemplate, JavaScriptTemplate

    public abstract class TextTemplateDecorator
    extends TextTemplate
    Provides the ability to 'decorate' the actual template contents before it is contributed to the header. For example, to embed it inside a JavaScript tag pair.
    Since:
    1.2.6
    Author:
    Eelco Hillenius
    See Also:
    Serialized Form
    • Field Detail

      • decorated

        protected final TextTemplate decorated
        The decorated TextTemplate.
    • Constructor Detail

      • TextTemplateDecorator

        public TextTemplateDecorator​(TextTemplate textTemplate)
        Constructor.
        Parameters:
        textTemplate - a TextTemplate to decorate
    • Method Detail

      • getBeforeTemplateContents

        public abstract String getBeforeTemplateContents()
        Retrieves the String to put before the actual template contents, for example:
            <script type="text/javascript">
         
        Returns:
        the String to put before the actual template contents
      • getAfterTemplateContents

        public abstract String getAfterTemplateContents()
        Retrieves the String to put after the actual template contents, for example:
            </script>
         
        Returns:
        the String to put after the actual template contents
      • close

        public void close()
                   throws IOException
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Specified by:
        close in interface org.apache.wicket.util.resource.IResourceStream
        Overrides:
        close in class org.apache.wicket.util.resource.AbstractStringResourceStream
        Throws:
        IOException
        See Also:
        AbstractStringResourceStream.close()
      • getContentType

        public String getContentType()
        Specified by:
        getContentType in interface org.apache.wicket.util.resource.IResourceStream
        Overrides:
        getContentType in class org.apache.wicket.util.resource.AbstractStringResourceStream
        See Also:
        AbstractStringResourceStream.getContentType()
      • getInputStream

        public InputStream getInputStream()
                                   throws org.apache.wicket.util.resource.ResourceStreamNotFoundException
        Specified by:
        getInputStream in interface org.apache.wicket.util.resource.IResourceStream
        Overrides:
        getInputStream in class org.apache.wicket.util.resource.AbstractStringResourceStream
        Throws:
        org.apache.wicket.util.resource.ResourceStreamNotFoundException
        See Also:
        AbstractStringResourceStream.getInputStream()
      • getLocale

        public Locale getLocale()
        Specified by:
        getLocale in interface org.apache.wicket.util.resource.IResourceStream
        Overrides:
        getLocale in class org.apache.wicket.util.resource.AbstractResourceStream
        See Also:
        AbstractResourceStream.getLocale()
      • lastModifiedTime

        public Instant lastModifiedTime()
        Specified by:
        lastModifiedTime in interface org.apache.wicket.util.watch.IModifiable
        Overrides:
        lastModifiedTime in class org.apache.wicket.util.resource.AbstractStringResourceStream
        See Also:
        AbstractStringResourceStream.lastModifiedTime()
      • setCharset

        public void setCharset​(Charset charset)
        Specified by:
        setCharset in interface org.apache.wicket.util.resource.IStringResourceStream
        Overrides:
        setCharset in class org.apache.wicket.util.resource.AbstractStringResourceStream
        See Also:
        org.apache.wicket.util.resource.AbstractResourceStream#setCharset(java.nio.charset.Charset)
      • setLastModified

        public void setLastModified​(Instant lastModified)
        Overrides:
        setLastModified in class org.apache.wicket.util.resource.AbstractStringResourceStream
        See Also:
        org.apache.wicket.util.resource.AbstractStringResourceStream#setLastModified(org.apache.wicket.util.time.Time)
      • setLocale

        public void setLocale​(Locale locale)
        Specified by:
        setLocale in interface org.apache.wicket.util.resource.IResourceStream
        Overrides:
        setLocale in class org.apache.wicket.util.resource.AbstractResourceStream
        See Also:
        AbstractResourceStream.setLocale(java.util.Locale)