org.wicketstuff.htmlcompressor
Class HtmlCompressingMarkupFactory

java.lang.Object
  extended by org.apache.wicket.markup.MarkupFactory
      extended by 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 Summary
HtmlCompressingMarkupFactory()
          Constructor.
HtmlCompressingMarkupFactory(com.googlecode.htmlcompressor.compressor.HtmlCompressor compressor)
          Constructor.
 
Method Summary
 com.googlecode.htmlcompressor.compressor.HtmlCompressor getCompressor()
          Getter for the html compressor.
protected  IXmlPullParser newXmlPullParser()
           
 
Methods inherited from class org.apache.wicket.markup.MarkupFactory
checkMarkupType, get, getContainerClass, getMarkup, getMarkup, getMarkupCache, getMarkupLoader, getMarkupResourceStream, getMarkupResourceStreamProvider, hasMarkupCache, loadMarkup, newMarkupParser, onAppendMarkupFilter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlCompressingMarkupFactory

public HtmlCompressingMarkupFactory()
Constructor.


HtmlCompressingMarkupFactory

public HtmlCompressingMarkupFactory(com.googlecode.htmlcompressor.compressor.HtmlCompressor compressor)
Constructor.

Parameters:
compressor - used for markup compressing, can be null
Method Detail

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


Copyright © 2012. All Rights Reserved.