Class HtmlCompressingMarkupFactory

java.lang.Object
org.apache.wicket.markup.MarkupFactory
org.wicketstuff.htmlcompressor.HtmlCompressingMarkupFactory

public class HtmlCompressingMarkupFactory extends MarkupFactory

This markup factory can be used to compress (minify) html markup.

To use it do the followings in your wicket Application:

 
        @Override
        protected void init()
        {
                super.init();
                getMarkupSettings().setMarkupFactory(new HtmlCompressingMarkupFactory());
        }
 
 

Or if we want to preconfigure the compressor used:

 
        @Override
        protected void init()
        {
                super.init();
                HtmlCompressor compressor = new HtmlCompressor();
                compressor.setPreserveLineBreaks(true);
                getMarkupSettings().setMarkupFactory(new HtmlCompressingMarkupFactory(compressor));
        }
 
 
Overrides newXmlPullParser() to use HtmlCompressingXmlPullParser.
Author:
akiraly
  • Constructor Details

    • HtmlCompressingMarkupFactory

      public HtmlCompressingMarkupFactory()
      Constructor.
    • HtmlCompressingMarkupFactory

      public HtmlCompressingMarkupFactory(com.googlecode.htmlcompressor.compressor.HtmlCompressor compressor)
      Constructor.
      Parameters:
      compressor - used for markup compressing, can be null
  • Method Details

    • newXmlPullParser

      protected IXmlPullParser newXmlPullParser()
      Overrides:
      newXmlPullParser in class MarkupFactory
    • getCompressor

      public com.googlecode.htmlcompressor.compressor.HtmlCompressor getCompressor()
      Getter for the html compressor.
      Returns:
      html compressor, not null