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
    • 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
      • 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
      • 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
      • 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
      • 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
      • 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
      • setLastModified

        public void setLastModified​(Instant lastModified)
        Overrides:
        setLastModified in class org.apache.wicket.util.resource.AbstractStringResourceStream
      • 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