com.googlecode.htmlcompressor.taglib
Class HtmlCompressorTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
All Implemented Interfaces:
Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class HtmlCompressorTag
extends javax.servlet.jsp.tagext.BodyTagSupport

JSP tag that compresses an HTML content within <compress:html>. Compression parameters are set by default (no JavaScript and CSS compression).

Author:
Sergiy Kovalchuk
See Also:
HtmlCompressor, Serialized Form

Field Summary
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
HtmlCompressorTag()
           
 
Method Summary
 int doEndTag()
           
 void setClosureOptLevel(String closureOptLevel)
          Sets level of optimization if Google Closure Compiler is used for compressing inline JavaScript.
 void setCompressCss(boolean compressCss)
           
 void setCompressJavaScript(boolean compressJavaScript)
           
 void setEnabled(boolean enabled)
           
 void setJsCompressor(String jsCompressor)
          Sets JavaScript compressor implementation that will be used to compress inline JavaScript in HTML.
 void setPreserveLineBreaks(boolean preserveLineBreaks)
           
 void setRemoveComments(boolean removeComments)
           
 void setRemoveFormAttributes(boolean removeFormAttributes)
           
 void setRemoveHttpProtocol(boolean removeHttpProtocol)
           
 void setRemoveHttpsProtocol(boolean removeHttpsProtocol)
           
 void setRemoveInputAttributes(boolean removeInputAttributes)
           
 void setRemoveIntertagSpaces(boolean removeIntertagSpaces)
           
 void setRemoveJavaScriptProtocol(boolean removeJavaScriptProtocol)
           
 void setRemoveLinkAttributes(boolean removeLinkAttributes)
           
 void setRemoveMultiSpaces(boolean removeMultiSpaces)
           
 void setRemoveQuotes(boolean removeQuotes)
           
 void setRemoveScriptAttributes(boolean removeScriptAttributes)
           
 void setRemoveStyleAttributes(boolean removeStyleAttributes)
           
 void setSimpleBooleanAttributes(boolean simpleBooleanAttributes)
           
 void setSimpleDoctype(boolean simpleDoctype)
           
 void setYuiCssLineBreak(int yuiCssLineBreak)
           
 void setYuiJsDisableOptimizations(boolean yuiJsDisableOptimizations)
           
 void setYuiJsLineBreak(int yuiJsLineBreak)
           
 void setYuiJsNoMunge(boolean yuiJsNoMunge)
           
 void setYuiJsPreserveAllSemiColons(boolean yuiJsPreserveAllSemiColons)
           
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, doStartTag, getBodyContent, getPreviousOut, release, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Constructor Detail

HtmlCompressorTag

public HtmlCompressorTag()
Method Detail

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.BodyTagSupport
Throws:
javax.servlet.jsp.JspException

setCompressJavaScript

public void setCompressJavaScript(boolean compressJavaScript)
See Also:
HtmlCompressor.setCompressJavaScript(boolean)

setCompressCss

public void setCompressCss(boolean compressCss)
See Also:
HtmlCompressor.setCompressCss(boolean)

setYuiJsNoMunge

public void setYuiJsNoMunge(boolean yuiJsNoMunge)
See Also:
HtmlCompressor.setYuiJsNoMunge(boolean)

setYuiJsPreserveAllSemiColons

public void setYuiJsPreserveAllSemiColons(boolean yuiJsPreserveAllSemiColons)
See Also:
HtmlCompressor.setYuiJsPreserveAllSemiColons(boolean)

setYuiJsDisableOptimizations

public void setYuiJsDisableOptimizations(boolean yuiJsDisableOptimizations)
See Also:
HtmlCompressor.setYuiJsDisableOptimizations(boolean)

setYuiJsLineBreak

public void setYuiJsLineBreak(int yuiJsLineBreak)
See Also:
HtmlCompressor.setYuiJsLineBreak(int)

setYuiCssLineBreak

public void setYuiCssLineBreak(int yuiCssLineBreak)
See Also:
HtmlCompressor.setYuiCssLineBreak(int)

setRemoveQuotes

public void setRemoveQuotes(boolean removeQuotes)
See Also:
HtmlCompressor.setRemoveQuotes(boolean)

setPreserveLineBreaks

public void setPreserveLineBreaks(boolean preserveLineBreaks)
See Also:
HtmlCompressor.setPreserveLineBreaks(boolean)

setEnabled

public void setEnabled(boolean enabled)
See Also:
HtmlCompressor.setEnabled(boolean)

setRemoveComments

public void setRemoveComments(boolean removeComments)
See Also:
HtmlCompressor.setRemoveComments(boolean)

setRemoveMultiSpaces

public void setRemoveMultiSpaces(boolean removeMultiSpaces)
See Also:
HtmlCompressor.setRemoveMultiSpaces(boolean)

setRemoveIntertagSpaces

public void setRemoveIntertagSpaces(boolean removeIntertagSpaces)
See Also:
HtmlCompressor.setRemoveIntertagSpaces(boolean)

setJsCompressor

public void setJsCompressor(String jsCompressor)
Sets JavaScript compressor implementation that will be used to compress inline JavaScript in HTML.

Parameters:
jsCompressor - Could be either "yui" for using YuiJavaScriptCompressor (used by default if none provided) or "closure" for using ClosureJavaScriptCompressor
See Also:
YuiJavaScriptCompressor, ClosureJavaScriptCompressor, Yahoo YUI Compressor, Google Closure Compiler

setClosureOptLevel

public void setClosureOptLevel(String closureOptLevel)
Sets level of optimization if Google Closure Compiler is used for compressing inline JavaScript.

Parameters:
closureOptLevel - Could be either "simple" (used by default), "whitespace" or "advanced"
See Also:
ClosureJavaScriptCompressor.setCompilationLevel(CompilationLevel)

setSimpleDoctype

public void setSimpleDoctype(boolean simpleDoctype)
See Also:
HtmlCompressor.setSimpleDoctype(boolean)

setRemoveScriptAttributes

public void setRemoveScriptAttributes(boolean removeScriptAttributes)
See Also:
HtmlCompressor.setRemoveScriptAttributes(boolean)

setRemoveStyleAttributes

public void setRemoveStyleAttributes(boolean removeStyleAttributes)
See Also:
HtmlCompressor.setRemoveStyleAttributes(boolean)

setRemoveLinkAttributes

public void setRemoveLinkAttributes(boolean removeLinkAttributes)
See Also:
HtmlCompressor.setRemoveLinkAttributes(boolean)

setRemoveFormAttributes

public void setRemoveFormAttributes(boolean removeFormAttributes)
See Also:
HtmlCompressor.setRemoveFormAttributes(boolean)

setRemoveInputAttributes

public void setRemoveInputAttributes(boolean removeInputAttributes)
See Also:
HtmlCompressor.setRemoveInputAttributes(boolean)

setSimpleBooleanAttributes

public void setSimpleBooleanAttributes(boolean simpleBooleanAttributes)
See Also:
HtmlCompressor.setSimpleBooleanAttributes(boolean)

setRemoveJavaScriptProtocol

public void setRemoveJavaScriptProtocol(boolean removeJavaScriptProtocol)
See Also:
HtmlCompressor.setRemoveJavaScriptProtocol(boolean)

setRemoveHttpProtocol

public void setRemoveHttpProtocol(boolean removeHttpProtocol)
See Also:
HtmlCompressor.setRemoveHttpProtocol(boolean)

setRemoveHttpsProtocol

public void setRemoveHttpsProtocol(boolean removeHttpsProtocol)
See Also:
HtmlCompressor.setRemoveHttpsProtocol(boolean)


Copyright © 2009-2012 Sergiy Kovalchuk. All Rights Reserved.