diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..3efbea3 --- /dev/null +++ b/README.txt @@ -0,0 +1,35 @@ +HtmlCompressor v.${project.version} +http://code.google.com/p/htmlcompressor/ + +Small, fast and very easy to use Java library that minifies given HTML or XML source by removing extra whitespaces, comments and other unneeded characters without breaking the content structure. As a result pages become smaller in size and load faster. A command-line version of the compressor is also available. + + +PACKAGE CONTENT: + /bin - contains main ${project.artifactId}-${project.version}.jar binary, + as well as several extra jars (could be useful for IDE integration) + /doc - javadocs + /src - sources + /lib - dependencies (for using with a command line compressor or non-Maven projects) + pom.xml - Maven POM file + build.bat - Maven build launcher for Win + build.sh - Maven build launcher for *nix + + +USAGE: + For java projects add ${project.artifactId}-${project.version}.jar library to your project's classpath + For a command line usage run: + java -jar ${project.artifactId}-${project.version}.jar -h + to get a brief description of available parameters. + + Please refer to http://code.google.com/p/htmlcompressor/ for the detailed documentation. + + +PROJECT BUILD: + - Install JDK v.5+ (http://www.oracle.com/technetwork/java/javase/downloads/index.html) + - Install Maven v.2+ (http://maven.apache.org/download.html) + - Run build.bat or build.sh + - Compiled binaries will be placed in /target subdirectory + + +CHANGELOG: + http://code.google.com/p/htmlcompressor/wiki/Changelog diff --git a/build-local.bat b/build-local.bat new file mode 100644 index 0000000..97b653f --- /dev/null +++ b/build-local.bat @@ -0,0 +1 @@ +mvn clean package javadoc:jar javadoc:test-jar source:jar source:test-jar site:jar assembly:single install \ No newline at end of file diff --git a/build-local.sh b/build-local.sh new file mode 100644 index 0000000..de14f01 --- /dev/null +++ b/build-local.sh @@ -0,0 +1,2 @@ +#!/bin/sh +mvn clean package javadoc:jar javadoc:test-jar source:jar source:test-jar site:jar assembly:single install \ No newline at end of file diff --git a/build-release.bat b/build-release.bat new file mode 100644 index 0000000..070dac3 --- /dev/null +++ b/build-release.bat @@ -0,0 +1 @@ +mvn clean package javadoc:jar javadoc:test-jar source:jar source:test-jar site:jar assembly:single release:clean release:prepare release:perform \ No newline at end of file diff --git a/build-release.sh b/build-release.sh new file mode 100644 index 0000000..7ff7db9 --- /dev/null +++ b/build-release.sh @@ -0,0 +1,2 @@ +#!/bin/sh +mvn clean package javadoc:jar javadoc:test-jar source:jar source:test-jar site:jar assembly:single release:clean release:prepare release:perform \ No newline at end of file diff --git a/build-snapshot.bat b/build-snapshot.bat new file mode 100644 index 0000000..d9ca6f3 --- /dev/null +++ b/build-snapshot.bat @@ -0,0 +1 @@ +mvn clean package javadoc:jar javadoc:test-jar source:jar source:test-jar site:jar assembly:single deploy \ No newline at end of file diff --git a/build-snapshot.sh b/build-snapshot.sh new file mode 100644 index 0000000..3a3ed01 --- /dev/null +++ b/build-snapshot.sh @@ -0,0 +1,2 @@ +#!/bin/sh +mvn clean package javadoc:jar javadoc:test-jar source:jar source:test-jar site:jar assembly:single deploy \ No newline at end of file diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..814205f --- /dev/null +++ b/build.bat @@ -0,0 +1 @@ +mvn clean package javadoc:jar javadoc:test-jar source:jar source:test-jar site:jar assembly:single -P doc-folder-generation \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..4a0ec5d --- /dev/null +++ b/build.sh @@ -0,0 +1,2 @@ +#!/bin/sh +mvn clean package javadoc:jar javadoc:test-jar source:jar source:test-jar site:jar assembly:single -P doc-folder-generation \ No newline at end of file diff --git a/doc/allclasses-frame.html b/doc/allclasses-frame.html new file mode 100644 index 0000000..a178690 --- /dev/null +++ b/doc/allclasses-frame.html @@ -0,0 +1,66 @@ + + + +
+ +
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + com.googlecode.htmlcompressor.CmdLineCompressor ++
public class CmdLineCompressor
+Wrapper for HTML and XML compressor classes that allows using them from a command line. + +
Usage: java -jar htmlcompressor.jar [options] [input]
+
To view a list of all available parameters please run with -?
option:
+
java -jar htmlcompressor.jar -?
+
+ +
+
+Constructor Summary | +|
---|---|
CmdLineCompressor(String[] args)
+
++ |
+
+Method Summary | +|
---|---|
+static void |
+main(String[] args)
+
++ |
+
+ void |
+process(String[] args)
+
++ |
+
Methods inherited from class java.lang.Object | +
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
---|
+public CmdLineCompressor(String[] args)+
+Method Detail | +
---|
+public static void main(String[] args)+
+public void process(String[] args)+
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + com.googlecode.htmlcompressor.DefaultErrorReporter ++
YuiJavaScriptCompressor.DefaultErrorReporter
++
@Deprecated +public class DefaultErrorReporter
+Default ErrorReporter
implementation that uses System.err
+ stream for error reporting. Used by YUI Compressor to log errors during JavaScript compression.
+
+ +
+
+Constructor Summary | +|
---|---|
DefaultErrorReporter()
+
++ Deprecated. |
+
+Method Summary | +|
---|---|
+ void |
+error(java.lang.String message,
+ java.lang.String sourceName,
+ int line,
+ java.lang.String lineSource,
+ int lineOffset)
+
++ Deprecated. |
+
+ org.mozilla.javascript.EvaluatorException |
+runtimeError(java.lang.String message,
+ java.lang.String sourceName,
+ int line,
+ java.lang.String lineSource,
+ int lineOffset)
+
++ Deprecated. |
+
+ void |
+warning(java.lang.String message,
+ java.lang.String sourceName,
+ int line,
+ java.lang.String lineSource,
+ int lineOffset)
+
++ Deprecated. |
+
Methods inherited from class java.lang.Object | +
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
---|
+public DefaultErrorReporter()+
+Method Detail | +
---|
+public void warning(java.lang.String message, + java.lang.String sourceName, + int line, + java.lang.String lineSource, + int lineOffset)+
warning
in interface org.mozilla.javascript.ErrorReporter
+public void error(java.lang.String message, + java.lang.String sourceName, + int line, + java.lang.String lineSource, + int lineOffset)+
error
in interface org.mozilla.javascript.ErrorReporter
+public org.mozilla.javascript.EvaluatorException runtimeError(java.lang.String message, + java.lang.String sourceName, + int line, + java.lang.String lineSource, + int lineOffset)+
runtimeError
in interface org.mozilla.javascript.ErrorReporter
+
+
|
++ + | +||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + com.googlecode.htmlcompressor.analyzer.HtmlAnalyzer ++
public class HtmlAnalyzer
+Class that compresses provided source with different compression + settings and displays page size gains in a report +
+ +
+
+Constructor Summary | +|
---|---|
HtmlAnalyzer()
+
++ |
+|
HtmlAnalyzer(String jsCompressor)
+
++ |
+
+Method Summary | +|
---|---|
+ void |
+analyze(String source)
+
++ |
+
Methods inherited from class java.lang.Object | +
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
---|
+public HtmlAnalyzer()+
+public HtmlAnalyzer(String jsCompressor)+
+Method Detail | +
---|
+public void analyze(String source)+
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+Classes
+
+ +HtmlAnalyzer |
+
+
+
|
++ + | +|||||||||
+ PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +
+Class Summary | +|
---|---|
HtmlAnalyzer | +Class that compresses provided source with different compression + settings and displays page size gains in a report | +
+
+
+
|
++ + | +|||||||||
+ PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + com.googlecode.htmlcompressor.compressor.ClosureJavaScriptCompressor ++
public class ClosureJavaScriptCompressor
+Basic JavaScript compressor implementation using Google Closure Compiler
+ that could be used by HtmlCompressor
for inline JavaScript compression.
+
+ +
+
HtmlCompressor.setJavaScriptCompressor(Compressor)
,
+Google Closure Compiler+Field Summary | +|
---|---|
+static String |
+COMPILATION_LEVEL_ADVANCED
+
++ |
+
+static String |
+COMPILATION_LEVEL_SIMPLE
+
++ |
+
+static String |
+COMPILATION_LEVEL_WHITESPACE
+
++ |
+
+Constructor Summary | +|
---|---|
ClosureJavaScriptCompressor()
+
++ |
+|
ClosureJavaScriptCompressor(com.google.javascript.jscomp.CompilationLevel compilationLevel)
+
++ |
+
+Method Summary | +|
---|---|
+ String |
+compress(String source)
+
++ The main method that compresses the given source and returns a compressed result. |
+
+ com.google.javascript.jscomp.CompilationLevel |
+getCompilationLevel()
+
++ Returns level of optimization that is applied when compiling JavaScript code. |
+
+ com.google.javascript.jscomp.CompilerOptions |
+getCompilerOptions()
+
++ Returns options that are used by the Closure compiler. |
+
+ List<com.google.javascript.jscomp.JSSourceFile> |
+getExterns()
+
++ Returns JSSourceFile used as a reference during the compression
+ at CompilationLevel.ADVANCED_OPTIMIZATIONS level. |
+
+ Level |
+getLoggingLevel()
+
++ Returns logging level used by the Closure compiler. |
+
+ com.google.javascript.jscomp.WarningLevel |
+getWarningLevel()
+
++ Returns WarningLevel used by the Closure compiler |
+
+ boolean |
+isCustomExternsOnly()
+
++ Returns true if default externs defined inside Closure's jar are ignored
+ and only user defined ones are used. |
+
+ void |
+setCompilationLevel(com.google.javascript.jscomp.CompilationLevel compilationLevel)
+
++ Sets level of optimization that should be applied when compiling JavaScript code. |
+
+ void |
+setCompilerOptions(com.google.javascript.jscomp.CompilerOptions compilerOptions)
+
++ Sets options that will be used by the Closure compiler. |
+
+ void |
+setCustomExternsOnly(boolean customExternsOnly)
+
++ If set to true , default externs defined inside Closure's jar will be ignored
+ and only user defined ones will be used. |
+
+ void |
+setExterns(List<com.google.javascript.jscomp.JSSourceFile> externs)
+
++ Sets external JavaScript files that are used as a reference for function declarations if + CompilationLevel.ADVANCED_OPTIMIZATIONS compression level is used. |
+
+ void |
+setLoggingLevel(Level loggingLevel)
+
++ Sets logging level for the Closure compiler. |
+
+ void |
+setWarningLevel(com.google.javascript.jscomp.WarningLevel warningLevel)
+
++ Indicates the amount of information you want from the compiler about possible problems in your code. |
+
Methods inherited from class java.lang.Object | +
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Field Detail | +
---|
+public static final String COMPILATION_LEVEL_SIMPLE+
+public static final String COMPILATION_LEVEL_ADVANCED+
+public static final String COMPILATION_LEVEL_WHITESPACE+
+Constructor Detail | +
---|
+public ClosureJavaScriptCompressor()+
+public ClosureJavaScriptCompressor(com.google.javascript.jscomp.CompilationLevel compilationLevel)+
+Method Detail | +
---|
+public String compress(String source)+
Compressor
+
compress
in interface Compressor
source
- The source to compress.
++public com.google.javascript.jscomp.CompilationLevel getCompilationLevel()+
+
CompilationLevel
that is applied when compiling JavaScript code.+public void setCompilationLevel(com.google.javascript.jscomp.CompilationLevel compilationLevel)+
CompilationLevel.SIMPLE_OPTIMIZATIONS
will be used by default.
+
+ Warning: Using CompilationLevel.ADVANCED_OPTIMIZATIONS
could
+ break inline JavaScript if externs are not set properly.
+
+
compilationLevel
- Optimization level to use, could be set to CompilationLevel.ADVANCED_OPTIMIZATIONS
, CompilationLevel.SIMPLE_OPTIMIZATIONS
, CompilationLevel.WHITESPACE_ONLY
+public com.google.javascript.jscomp.CompilerOptions getCompilerOptions()+
+
CompilerOptions
that are used by the compiler+public void setCompilerOptions(com.google.javascript.jscomp.CompilerOptions compilerOptions)+
new CompilerOptions()
.
++
compilerOptions
- CompilerOptions
that will be used by the compiler+public Level getLoggingLevel()+
+
Level
of logging used by the Closure compiler+public void setLoggingLevel(Level loggingLevel)+
+
loggingLevel
- logging level for the Closure compiler.Level
+public List<com.google.javascript.jscomp.JSSourceFile> getExterns()+
JSSourceFile
used as a reference during the compression
+ at CompilationLevel.ADVANCED_OPTIMIZATIONS
level.
++
JSSourceFile
used as a reference during compression+public void setExterns(List<com.google.javascript.jscomp.JSSourceFile> externs)+
CompilationLevel.ADVANCED_OPTIMIZATIONS
compression level is used.
+
+ A number of default externs defined inside Closure's jar will be used besides user defined ones,
+ to use only user defined externs set setCustomExternsOnly(true)
+
+
Warning: Using CompilationLevel.ADVANCED_OPTIMIZATIONS
could
+ break inline JavaScript if externs are not set properly.
+
+
externs
- JSSourceFile
to use as a reference during compressionsetCompilationLevel(CompilationLevel)
,
+setCustomExternsOnly(boolean)
,
+Advanced Compilation and Externs,
+JSSourceFile+public com.google.javascript.jscomp.WarningLevel getWarningLevel()+
WarningLevel
used by the Closure compiler
++
WarningLevel
used by the Closure compiler+public void setWarningLevel(com.google.javascript.jscomp.WarningLevel warningLevel)+
+
warningLevel
- WarningLevel
to use+public boolean isCustomExternsOnly()+
true
if default externs defined inside Closure's jar are ignored
+ and only user defined ones are used.
++
true
if default externs defined inside Closure's jar are ignored
+ and only user defined ones are used+public void setCustomExternsOnly(boolean customExternsOnly)+
true
, default externs defined inside Closure's jar will be ignored
+ and only user defined ones will be used.
++
customExternsOnly
- true
to skip default externs and use only user defined onessetExterns(List)
,
+setCompilationLevel(CompilationLevel)
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
public interface Compressor
+Interface describing compressor classes. +
+ +
+
+Method Summary | +|
---|---|
+ String |
+compress(String source)
+
++ The main method that compresses the given source and returns a compressed result. |
+
+Method Detail | +
---|
+String compress(String source)+
+
source
- The source to compress.
+
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + com.googlecode.htmlcompressor.compressor.HtmlCompressor ++
public class HtmlCompressor
+Class that compresses given HTML source by removing comments, extra spaces and + line breaks while preserving content within <pre>, <textarea>, <script> + and <style> tags. +
Blocks that should be additionally preserved could be marked with:
+ <!-- {{{ -->
+
+
...
+
<!-- }}} -->
or any number of user defined patterns.
+
Content inside <script> or <style> tags could be optionally compressed using + Yahoo YUI Compressor or Google Closure Compiler + libraries. +
+ +
+
+Field Summary | +|
---|---|
+static String |
+ALL_TAGS
+
++ Could be passed to setRemoveSurroundingSpaces method
+ to remove all surrounding spaces (not recommended). |
+
+static String |
+BLOCK_TAGS_MAX
+
++ Predefined list of tags that are block-level by default, excluding <div> and <li> tags. |
+
+static String |
+BLOCK_TAGS_MIN
+
++ Predefined list of tags that are very likely to be block-level. |
+
+static String |
+JS_COMPRESSOR_CLOSURE
+
++ |
+
+static String |
+JS_COMPRESSOR_YUI
+
++ |
+
+static Pattern |
+PHP_TAG_PATTERN
+
++ Predefined pattern that matches <?php ... |
+
+static Pattern |
+SERVER_SCRIPT_TAG_PATTERN
+
++ Predefined pattern that matches <% ... |
+
+static Pattern |
+SERVER_SIDE_INCLUDE_PATTERN
+
++ Predefined pattern that matches <--# ... |
+
+Constructor Summary | +|
---|---|
HtmlCompressor()
+
++ |
+
+Method Summary | +|
---|---|
+ String |
+compress(String html)
+
++ The main method that compresses given HTML source and returns compressed + result. |
+
+ Compressor |
+getCssCompressor()
+
++ Returns CSS compressor implementation that will be used + to compress inline CSS in HTML. |
+
+ Compressor |
+getJavaScriptCompressor()
+
++ Returns JavaScript compressor implementation that will be used + to compress inline JavaScript in HTML. |
+
+ List<Pattern> |
+getPreservePatterns()
+
++ Returns a list of Patterns defining custom preserving block rules |
+
+ String |
+getRemoveSurroundingSpaces()
+
++ Returns a comma separated list of tags around which spaces will be removed. |
+
+ HtmlCompressorStatistics |
+getStatistics()
+
++ Returns HtmlCompressorStatistics object containing statistics of the last HTML compression, if enabled. |
+
+ int |
+getYuiCssLineBreak()
+
++ Returns number of symbols per line Yahoo YUI Compressor + will use during CSS compression. |
+
+ org.mozilla.javascript.ErrorReporter |
+getYuiErrorReporter()
+
++ Returns ErrorReporter used by YUI Compressor to log error messages
+ during JavasSript compression |
+
+ int |
+getYuiJsLineBreak()
+
++ Returns number of symbols per line Yahoo YUI Compressor + will use during JavaScript compression. |
+
+ boolean |
+isCompressCss()
+
++ Returns true if CSS compression is enabled. |
+
+ boolean |
+isCompressJavaScript()
+
++ Returns true if JavaScript compression is enabled. |
+
+ boolean |
+isEnabled()
+
++ Returns true if compression is enabled. |
+
+ boolean |
+isGenerateStatistics()
+
++ Returns true if HTML compression statistics is generated |
+
+ boolean |
+isPreserveLineBreaks()
+
++ Returns true if line breaks will be preserved. |
+
+ boolean |
+isRemoveComments()
+
++ Returns true if all HTML comments will be removed. |
+
+ boolean |
+isRemoveFormAttributes()
+
++ Returns true if method="get" attributes will be removed from <form> tags |
+
+ boolean |
+isRemoveHttpProtocol()
+
++ Returns true if HTTP protocol will be removed from href , src , cite , and action tag attributes. |
+
+ boolean |
+isRemoveHttpsProtocol()
+
++ Returns true if HTTPS protocol will be removed from href , src , cite , and action tag attributes. |
+
+ boolean |
+isRemoveInputAttributes()
+
++ Returns true if type="text" attributes will be removed from <input> tags |
+
+ boolean |
+isRemoveIntertagSpaces()
+
++ Returns true if all inter-tag whitespace characters will be removed. |
+
+ boolean |
+isRemoveJavaScriptProtocol()
+
++ Returns true if javascript: pseudo-protocol will be removed from inline event handlers. |
+
+ boolean |
+isRemoveLinkAttributes()
+
++ Returns true if unnecessary attributes will be removed from <link> tags |
+
+ boolean |
+isRemoveMultiSpaces()
+
++ Returns true if all multiple whitespace characters will be replaced with single spaces. |
+
+ boolean |
+isRemoveQuotes()
+
++ Returns true if all unnecessary quotes will be removed
+ from tag attributes. |
+
+ boolean |
+isRemoveScriptAttributes()
+
++ Returns true if unnecessary attributes wil be removed from <script> tags |
+
+ boolean |
+isRemoveStyleAttributes()
+
++ Returns true if type="text/style" attributes will be removed from <style> tags |
+
+ boolean |
+isSimpleBooleanAttributes()
+
++ Returns true if boolean attributes will be simplified |
+
+ boolean |
+isSimpleDoctype()
+
++ Returns true if existing DOCTYPE declaration will be replaced with simple declaration. |
+
+ boolean |
+isYuiJsDisableOptimizations()
+
++ Returns true if Yahoo YUI Compressor
+ will disable all the built-in micro optimizations during JavaScript compression. |
+
+ boolean |
+isYuiJsNoMunge()
+
++ Returns true if Yahoo YUI Compressor
+ will only minify javascript without obfuscating local symbols. |
+
+ boolean |
+isYuiJsPreserveAllSemiColons()
+
++ Returns true if Yahoo YUI Compressor
+ will preserve unnecessary semicolons during JavaScript compression. |
+
+ void |
+setCompressCss(boolean compressCss)
+
++ Enables CSS compression within <style> tags using + Yahoo YUI Compressor + if set to true . |
+
+ void |
+setCompressJavaScript(boolean compressJavaScript)
+
++ Enables JavaScript compression within <script> tags using + Yahoo YUI Compressor + if set to true . |
+
+ void |
+setCssCompressor(Compressor cssCompressor)
+
++ Sets CSS compressor implementation that will be used + to compress inline CSS in HTML. |
+
+ void |
+setEnabled(boolean enabled)
+
++ If set to false all compression will be bypassed. |
+
+ void |
+setGenerateStatistics(boolean generateStatistics)
+
++ If set to true , HTML compression statistics will be generated. |
+
+ void |
+setJavaScriptCompressor(Compressor javaScriptCompressor)
+
++ Sets JavaScript compressor implementation that will be used + to compress inline JavaScript in HTML. |
+
+ void |
+setPreserveLineBreaks(boolean preserveLineBreaks)
+
++ If set to true , line breaks will be preserved. |
+
+ void |
+setPreservePatterns(List<Pattern> preservePatterns)
+
++ This method allows setting custom block preservation rules defined by regular + expression patterns. |
+
+ void |
+setRemoveComments(boolean removeComments)
+
++ If set to true all HTML comments will be removed. |
+
+ void |
+setRemoveFormAttributes(boolean removeFormAttributes)
+
++ If set to true , method="get" attributes will be removed from <form> tags. |
+
+ void |
+setRemoveHttpProtocol(boolean removeHttpProtocol)
+
++ If set to true , HTTP protocol will be removed from href , src , cite , and action tag attributes. |
+
+ void |
+setRemoveHttpsProtocol(boolean removeHttpsProtocol)
+
++ If set to true , HTTPS protocol will be removed from href , src , cite , and action tag attributes. |
+
+ void |
+setRemoveInputAttributes(boolean removeInputAttributes)
+
++ If set to true , type="text" attributes will be removed from <input> tags. |
+
+ void |
+setRemoveIntertagSpaces(boolean removeIntertagSpaces)
+
++ If set to true all inter-tag whitespace characters will be removed. |
+
+ void |
+setRemoveJavaScriptProtocol(boolean removeJavaScriptProtocol)
+
++ If set to true , javascript: pseudo-protocol will be removed from inline event handlers. |
+
+ void |
+setRemoveLinkAttributes(boolean removeLinkAttributes)
+
++ If set to true , following attributes will be removed from <link rel="stylesheet"> and <link rel="alternate stylesheet"> tags:
+
+ type="text/css"
+ type="text/plain"
+ |
+
+ void |
+setRemoveMultiSpaces(boolean removeMultiSpaces)
+
++ If set to true all multiple whitespace characters will be replaced with single spaces. |
+
+ void |
+setRemoveQuotes(boolean removeQuotes)
+
++ If set to true all unnecessary quotes will be removed
+ from tag attributes. |
+
+ void |
+setRemoveScriptAttributes(boolean removeScriptAttributes)
+
++ If set to true , following attributes will be removed from <script> tags:
+
+ type="text/javascript"
+ type="application/javascript"
+ language="javascript"
+ |
+
+ void |
+setRemoveStyleAttributes(boolean removeStyleAttributes)
+
++ If set to true , type="text/style" attributes will be removed from <style> tags. |
+
+ void |
+setRemoveSurroundingSpaces(String tagList)
+
++ Enables surrounding spaces removal around provided comma separated list of tags. |
+
+ void |
+setSimpleBooleanAttributes(boolean simpleBooleanAttributes)
+
++ If set to true , any values of following boolean attributes will be removed:
+
+ checked
+ selected
+ disabled
+ readonly
+ |
+
+ void |
+setSimpleDoctype(boolean simpleDoctype)
+
++ If set to true , existing DOCTYPE declaration will be replaced with simple <!DOCTYPE html> declaration. |
+
+ void |
+setYuiCssLineBreak(int yuiCssLineBreak)
+
++ Tells Yahoo YUI Compressor to break lines after the specified number of symbols + during CSS compression. |
+
+ void |
+setYuiErrorReporter(org.mozilla.javascript.ErrorReporter yuiErrorReporter)
+
++ Sets ErrorReporter that YUI Compressor will use for reporting errors during
+ JavaScript compression. |
+
+ void |
+setYuiJsDisableOptimizations(boolean yuiJsDisableOptimizations)
+
++ Tells Yahoo YUI Compressor to disable all the built-in micro optimizations + during JavaScript compression. |
+
+ void |
+setYuiJsLineBreak(int yuiJsLineBreak)
+
++ Tells Yahoo YUI Compressor to break lines after the specified number of symbols + during JavaScript compression. |
+
+ void |
+setYuiJsNoMunge(boolean yuiJsNoMunge)
+
++ Tells Yahoo YUI Compressor to only minify javascript without obfuscating + local symbols. |
+
+ void |
+setYuiJsPreserveAllSemiColons(boolean yuiJsPreserveAllSemiColons)
+
++ Tells Yahoo YUI Compressor to preserve unnecessary semicolons + during JavaScript compression. |
+
Methods inherited from class java.lang.Object | +
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Field Detail | +
---|
+public static final String JS_COMPRESSOR_YUI+
+public static final String JS_COMPRESSOR_CLOSURE+
+public static final Pattern PHP_TAG_PATTERN+
<?php ... ?>
tags.
+ Could be passed inside a list to setPreservePatterns
method.
++
+public static final Pattern SERVER_SCRIPT_TAG_PATTERN+
<% ... %>
tags.
+ Could be passed inside a list to setPreservePatterns
method.
++
+public static final Pattern SERVER_SIDE_INCLUDE_PATTERN+
<--# ... -->
tags.
+ Could be passed inside a list to setPreservePatterns
method.
++
+public static final String BLOCK_TAGS_MIN+
setRemoveSurroundingSpaces
method.
++
+public static final String BLOCK_TAGS_MAX+
<div>
and <li>
tags.
+ Table tags are also included.
+ Could be passed to setRemoveSurroundingSpaces
method.
++
+public static final String ALL_TAGS+
setRemoveSurroundingSpaces
method
+ to remove all surrounding spaces (not recommended).
++
+Constructor Detail | +
---|
+public HtmlCompressor()+
+Method Detail | +
---|
+public String compress(String html)+
+
compress
in interface Compressor
html
- HTML content to compress
++public boolean isCompressJavaScript()+
true
if JavaScript compression is enabled.
++
+public void setCompressJavaScript(boolean compressJavaScript)+
true
. Default is false
for performance reasons.
+
+ Note: Compressing JavaScript is not recommended if pages are + compressed dynamically on-the-fly because of performance impact. + You should consider putting JavaScript into a separate file and + compressing it using standalone YUICompressor for example.
++
compressJavaScript
- set true
to enable JavaScript compression.
+ Default is false
+public boolean isCompressCss()+
true
if CSS compression is enabled.
++
+public void setCompressCss(boolean compressCss)+
true
. Default is false
for performance reasons.
+
+ Note: Compressing CSS is not recommended if pages are + compressed dynamically on-the-fly because of performance impact. + You should consider putting CSS into a separate file and + compressing it using standalone YUICompressor for example.
++
compressCss
- set true
to enable CSS compression.
+ Default is false
+public boolean isYuiJsNoMunge()+
true
if Yahoo YUI Compressor
+ will only minify javascript without obfuscating local symbols.
+ This corresponds to --nomunge
command line option.
++
nomunge
parameter value used for JavaScript compression.+public void setYuiJsNoMunge(boolean yuiJsNoMunge)+
--nomunge
command line option.
+ This option has effect only if JavaScript compression is enabled.
+ Default is false
.
++
yuiJsNoMunge
- set true
to enable nomunge
mode+public boolean isYuiJsPreserveAllSemiColons()+
true
if Yahoo YUI Compressor
+ will preserve unnecessary semicolons during JavaScript compression.
+ This corresponds to --preserve-semi
command line option.
++
preserve-semi
parameter value used for JavaScript compression.+public void setYuiJsPreserveAllSemiColons(boolean yuiJsPreserveAllSemiColons)+
--preserve-semi
command line option.
+ This option has effect only if JavaScript compression is enabled.
+ Default is false
.
++
yuiJsPreserveAllSemiColons
- set true to enable preserve-semi
mode- See Also:
- Yahoo YUI Compressor
+public boolean isYuiJsDisableOptimizations()+
true
if Yahoo YUI Compressor
+ will disable all the built-in micro optimizations during JavaScript compression.
+ This corresponds to --disable-optimizations
command line option.
++
disable-optimizations
parameter value used for JavaScript compression.+public void setYuiJsDisableOptimizations(boolean yuiJsDisableOptimizations)+
--disable-optimizations
command line option.
+ This option has effect only if JavaScript compression is enabled.
+ Default is false
.
++
yuiJsDisableOptimizations
- set true to enable
+ disable-optimizations
mode- See Also:
- Yahoo YUI Compressor
+public int getYuiJsLineBreak()+
--line-break
command line option.
++
line-break
parameter value used for JavaScript compression.+public void setYuiJsLineBreak(int yuiJsLineBreak)+
--line-break
command line option.
+ This option has effect only if JavaScript compression is enabled.
+ Default is -1
to disable line breaks.
++
yuiJsLineBreak
- set number of symbols per line+public int getYuiCssLineBreak()+
--line-break
command line option.
++
line-break
parameter value used for CSS compression.+public void setYuiCssLineBreak(int yuiCssLineBreak)+
--line-break
command line option.
+ This option has effect only if CSS compression is enabled.
+ Default is -1
to disable line breaks.
++
yuiCssLineBreak
- set number of symbols per line+public boolean isRemoveQuotes()+
true
if all unnecessary quotes will be removed
+ from tag attributes.
++
+public void setRemoveQuotes(boolean removeQuotes)+
true
all unnecessary quotes will be removed
+ from tag attributes. Default is false
.
+
+ Note: Even though quotes are removed only when it is safe to do so, + it still might break strict HTML validation. Turn this option on only if + a page validation is not very important or to squeeze the most out of the compression. + This option has no performance impact. +
+
removeQuotes
- set true
to remove unnecessary quotes from tag attributes+public boolean isEnabled()+
true
if compression is enabled.
++
true
if compression is enabled.+public void setEnabled(boolean enabled)+
false
all compression will be bypassed. Might be useful for testing purposes.
+ Default is true
.
++
enabled
- set false
to bypass all compression+public boolean isRemoveComments()+
true
if all HTML comments will be removed.
++
true
if all HTML comments will be removed+public void setRemoveComments(boolean removeComments)+
true
all HTML comments will be removed.
+ Default is true
.
++
removeComments
- set true
to remove all HTML comments+public boolean isRemoveMultiSpaces()+
true
if all multiple whitespace characters will be replaced with single spaces.
++
true
if all multiple whitespace characters will be replaced with single spaces.+public void setRemoveMultiSpaces(boolean removeMultiSpaces)+
true
all multiple whitespace characters will be replaced with single spaces.
+ Default is true
.
++
removeMultiSpaces
- set true
to replace all multiple whitespace characters
+ will single spaces.+public boolean isRemoveIntertagSpaces()+
true
if all inter-tag whitespace characters will be removed.
++
true
if all inter-tag whitespace characters will be removed.+public void setRemoveIntertagSpaces(boolean removeIntertagSpaces)+
true
all inter-tag whitespace characters will be removed.
+ Default is false
.
+
+ Note: It is fairly safe to turn this option on unless you
+ rely on spaces for page formatting. Even if you do, you can always preserve
+ required spaces with
. This option has no performance impact.
+
+
removeIntertagSpaces
- set true
to remove all inter-tag whitespace characters+public List<Pattern> getPreservePatterns()+
+
Pattern
objects defining rules for preserving block rules+public void setPreservePatterns(List<Pattern> preservePatterns)+
Custom preservation rules have higher priority than default rules. + Priority between custom rules are defined by their position in a list + (beginning of a list has higher priority). + +
Besides custom patterns, you can use 3 predefined patterns:
+ PHP_TAG_PATTERN
,
+ SERVER_SCRIPT_TAG_PATTERN
,
+ SERVER_SIDE_INCLUDE_PATTERN
.
+
+
preservePatterns
- List of Pattern
objects that will be
+ used to skip matched blocks during compression+public org.mozilla.javascript.ErrorReporter getYuiErrorReporter()+
ErrorReporter
used by YUI Compressor to log error messages
+ during JavasSript compression
++
ErrorReporter
used by YUI Compressor to log error messages
+ during JavasSript compression+public void setYuiErrorReporter(org.mozilla.javascript.ErrorReporter yuiErrorReporter)+
ErrorReporter
that YUI Compressor will use for reporting errors during
+ JavaScript compression. If no ErrorReporter
was provided
+ YuiJavaScriptCompressor.DefaultErrorReporter
will be used
+ which reports errors to System.err
stream.
++
yuiErrorReporter
- ErrorReporter that will be used by YUI Compressor- See Also:
YuiJavaScriptCompressor.DefaultErrorReporter
,
+Yahoo YUI Compressor,
+ErrorReporter Interface
+public Compressor getJavaScriptCompressor()+
+
Compressor
implementation that will be used
+ to compress inline JavaScript in HTML.YuiJavaScriptCompressor
,
+ClosureJavaScriptCompressor
,
+Yahoo YUI Compressor,
+Google Closure Compiler+public void setJavaScriptCompressor(Compressor javaScriptCompressor)+
HtmlCompressor currently
+ comes with basic implementations for Yahoo YUI Compressor (called YuiJavaScriptCompressor
)
+ and Google Closure Compiler (called ClosureJavaScriptCompressor
) that should be enough for most cases,
+ but users can also create their own JavaScript compressors for custom needs.
+
+
If no compressor is set YuiJavaScriptCompressor
will be used by default.
+
+
javaScriptCompressor
- Compressor
implementation that will be used for inline JavaScript compressionYuiJavaScriptCompressor
,
+ClosureJavaScriptCompressor
,
+Yahoo YUI Compressor,
+Google Closure Compiler+public Compressor getCssCompressor()+
+
Compressor
implementation that will be used
+ to compress inline CSS in HTML.YuiCssCompressor
,
+Yahoo YUI Compressor+public void setCssCompressor(Compressor cssCompressor)+
HtmlCompressor currently
+ comes with basic implementation for Yahoo YUI Compressor (called YuiCssCompressor
),
+ but users can also create their own CSS compressors for custom needs.
+
+
If no compressor is set YuiCssCompressor
will be used by default.
+
+
cssCompressor
- Compressor
implementation that will be used for inline CSS compressionYuiCssCompressor
,
+Yahoo YUI Compressor+public boolean isSimpleDoctype()+
true
if existing DOCTYPE declaration will be replaced with simple
declaration.
++
true
if existing DOCTYPE declaration will be replaced with simple
declaration.+public void setSimpleDoctype(boolean simpleDoctype)+
true
, existing DOCTYPE declaration will be replaced with simple <!DOCTYPE html>
declaration.
+ Default is false
.
++
simpleDoctype
- set true
to replace existing DOCTYPE declaration with <!DOCTYPE html>
+public boolean isRemoveScriptAttributes()+
true
if unnecessary attributes wil be removed from <script>
tags
++
true
if unnecessary attributes wil be removed from <script>
tags+public void setRemoveScriptAttributes(boolean removeScriptAttributes)+
true
, following attributes will be removed from <script>
tags:
+ Default is false
.
+
+
removeScriptAttributes
- set true
to remove unnecessary attributes from <script>
tags+public boolean isRemoveStyleAttributes()+
true
if type="text/style"
attributes will be removed from <style>
tags
++
true
if type="text/style"
attributes will be removed from <style>
tags+public void setRemoveStyleAttributes(boolean removeStyleAttributes)+
true
, type="text/style"
attributes will be removed from <style>
tags. Default is false
.
++
removeStyleAttributes
- set true
to remove type="text/style"
attributes from <style>
tags+public boolean isRemoveLinkAttributes()+
true
if unnecessary attributes will be removed from <link>
tags
++
true
if unnecessary attributes will be removed from <link>
tags+public void setRemoveLinkAttributes(boolean removeLinkAttributes)+
true
, following attributes will be removed from <link rel="stylesheet">
and <link rel="alternate stylesheet">
tags:
+ Default is false
.
+
+
removeLinkAttributes
- set true
to remove unnecessary attributes from <link>
tags+public boolean isRemoveFormAttributes()+
true
if method="get"
attributes will be removed from <form>
tags
++
true
if method="get"
attributes will be removed from <form>
tags+public void setRemoveFormAttributes(boolean removeFormAttributes)+
true
, method="get"
attributes will be removed from <form>
tags. Default is false
.
++
removeFormAttributes
- set true
to remove method="get"
attributes from <form>
tags+public boolean isRemoveInputAttributes()+
true
if type="text"
attributes will be removed from <input>
tags
++
true
if type="text"
attributes will be removed from <input>
tags+public void setRemoveInputAttributes(boolean removeInputAttributes)+
true
, type="text"
attributes will be removed from <input>
tags. Default is false
.
++
removeInputAttributes
- set true
to remove type="text"
attributes from <input>
tags+public boolean isSimpleBooleanAttributes()+
true
if boolean attributes will be simplified
++
true
if boolean attributes will be simplified+public void setSimpleBooleanAttributes(boolean simpleBooleanAttributes)+
true
, any values of following boolean attributes will be removed:
+ For example, <input readonly="readonly">
would become <input readonly>
+
+
Default is false
.
+
+
simpleBooleanAttributes
- set true
to simplify boolean attributes+public boolean isRemoveJavaScriptProtocol()+
true
if javascript:
pseudo-protocol will be removed from inline event handlers.
++
true
if javascript:
pseudo-protocol will be removed from inline event handlers.+public void setRemoveJavaScriptProtocol(boolean removeJavaScriptProtocol)+
true
, javascript:
pseudo-protocol will be removed from inline event handlers.
+
+ For example, <a onclick="javascript:alert()">
would become <a onclick="alert()">
+
+
Default is false
.
+
+
removeJavaScriptProtocol
- set true
to remove javascript:
pseudo-protocol from inline event handlers.+public boolean isRemoveHttpProtocol()+
true
if HTTP
protocol will be removed from href
, src
, cite
, and action
tag attributes.
++
true
if HTTP
protocol will be removed from href
, src
, cite
, and action
tag attributes.+public void setRemoveHttpProtocol(boolean removeHttpProtocol)+
true
, HTTP
protocol will be removed from href
, src
, cite
, and action
tag attributes.
+ URL without a protocol would make a browser use document's current protocol instead.
+
+ Tags marked with rel="external"
will be skipped.
+
+
For example: +
<a href="http://example.com"> <script src="http://google.com/js.js" rel="external">
+
would become: +
<a href="//example.com"> <script src="http://google.com/js.js" rel="external">
+
+
Default is false
.
+
+
removeHttpProtocol
- set true
to remove HTTP
protocol from tag attributes+public boolean isRemoveHttpsProtocol()+
true
if HTTPS
protocol will be removed from href
, src
, cite
, and action
tag attributes.
++
true
if HTTPS
protocol will be removed from href
, src
, cite
, and action
tag attributes.+public void setRemoveHttpsProtocol(boolean removeHttpsProtocol)+
true
, HTTPS
protocol will be removed from href
, src
, cite
, and action
tag attributes.
+ URL without a protocol would make a browser use document's current protocol instead.
+
+ Tags marked with rel="external"
will be skipped.
+
+
For example: +
<a href="https://example.com"> <script src="https://google.com/js.js" rel="external">
+
would become: +
<a href="//example.com"> <script src="https://google.com/js.js" rel="external">
+
+
Default is false
.
+
+
removeHttpsProtocol
- set true
to remove HTTP
protocol from tag attributes+public boolean isGenerateStatistics()+
true
if HTML compression statistics is generated
++
true
if HTML compression statistics is generated+public void setGenerateStatistics(boolean generateStatistics)+
true
, HTML compression statistics will be generated.
+
+ Important: Enabling statistics makes HTML compressor not thread safe. + +
Default is false
.
+
+
generateStatistics
- set true
to generate HTML compression statisticsgetStatistics()
+public HtmlCompressorStatistics getStatistics()+
HtmlCompressorStatistics
object containing statistics of the last HTML compression, if enabled.
+ Should be called after compress(String)
++
HtmlCompressorStatistics
object containing last HTML compression statisticsHtmlCompressorStatistics
,
+setGenerateStatistics(boolean)
+public boolean isPreserveLineBreaks()+
true
if line breaks will be preserved.
++
true
if line breaks will be preserved.+public void setPreserveLineBreaks(boolean preserveLineBreaks)+
true
, line breaks will be preserved.
+
+ Default is false
.
+
+
preserveLineBreaks
- set true
to preserve line breaks+public String getRemoveSurroundingSpaces()+
+
+public void setRemoveSurroundingSpaces(String tagList)+
Besides custom defined lists, you can pass one of 3 predefined lists of tags:
+ BLOCK_TAGS_MIN
,
+ BLOCK_TAGS_MAX
,
+ ALL_TAGS
.
+
+
tagList
- a comma separated list of tags around which spaces will be removed
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + com.googlecode.htmlcompressor.compressor.HtmlCompressorStatistics ++
public class HtmlCompressorStatistics
+Class that stores HTML compression statistics +
+ +
+
HtmlCompressor.getStatistics()
+Constructor Summary | +|
---|---|
HtmlCompressorStatistics()
+
++ |
+
+Method Summary | +|
---|---|
+ HtmlMetrics |
+getCompressedMetrics()
+
++ Returns metrics of a compressed document |
+
+ HtmlMetrics |
+getOriginalMetrics()
+
++ Returns metrics of an uncompressed document |
+
+ int |
+getPreservedSize()
+
++ Returns total size of blocks that were skipped by the compressor + (for example content inside <pre> tags or inside
+ <script> tags with disabled javascript compression) |
+
+ long |
+getTime()
+
++ Returns total compression time. |
+
+ void |
+setCompressedMetrics(HtmlMetrics compressedMetrics)
+
++ |
+
+ void |
+setOriginalMetrics(HtmlMetrics originalMetrics)
+
++ |
+
+ void |
+setPreservedSize(int preservedSize)
+
++ |
+
+ void |
+setTime(long time)
+
++ |
+
+ String |
+toString()
+
++ |
+
Methods inherited from class java.lang.Object | +
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
+Constructor Detail | +
---|
+public HtmlCompressorStatistics()+
+Method Detail | +
---|
+public HtmlMetrics getOriginalMetrics()+
+
HtmlMetrics
+public void setOriginalMetrics(HtmlMetrics originalMetrics)+
originalMetrics
- the originalMetrics to set+public HtmlMetrics getCompressedMetrics()+
+
HtmlMetrics
+public void setCompressedMetrics(HtmlMetrics compressedMetrics)+
compressedMetrics
- the compressedMetrics to set+public long getTime()+
Please note that compression performance varies very significantly depending on whether it was + a cold run or not (specifics of Java VM), so for accurate real world results it is recommended + to take measurements accordingly. +
+
+public void setTime(long time)+
time
- the time to set+public int getPreservedSize()+
<pre>
tags or inside
+ <script>
tags with disabled javascript compression)
++
+public void setPreservedSize(int preservedSize)+
preservedSize
- the preservedSize to set+public String toString()+
toString
in class Object
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + com.googlecode.htmlcompressor.compressor.HtmlMetrics ++
public class HtmlMetrics
+Class that stores metrics about HTML documents. +
+ +
+
+Constructor Summary | +|
---|---|
HtmlMetrics()
+
++ |
+
+Method Summary | +|
---|---|
+ int |
+getEmptyChars()
+
++ Returns number of empty characters (spaces, tabs, end of lines) in a document |
+
+ int |
+getFilesize()
+
++ Returns total filesize of a document |
+
+ int |
+getInlineEventSize()
+
++ Returns total size of inline event handlers ( onclick , etc) |
+
+ int |
+getInlineScriptSize()
+
++ Returns total size of inline <script> tags |
+
+ int |
+getInlineStyleSize()
+
++ Returns total size of inline <style> tags |
+
+ void |
+setEmptyChars(int emptyChars)
+
++ |
+
+ void |
+setFilesize(int filesize)
+
++ |
+
+ void |
+setInlineEventSize(int inlineEventSize)
+
++ |
+
+ void |
+setInlineScriptSize(int inlineScriptSize)
+
++ |
+
+ void |
+setInlineStyleSize(int inlineStyleSize)
+
++ |
+
+ String |
+toString()
+
++ |
+
Methods inherited from class java.lang.Object | +
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
+Constructor Detail | +
---|
+public HtmlMetrics()+
+Method Detail | +
---|
+public int getFilesize()+
+
+public void setFilesize(int filesize)+
filesize
- the filesize to set+public int getEmptyChars()+
+
+public void setEmptyChars(int emptyChars)+
emptyChars
- the emptyChars to set+public int getInlineScriptSize()+
<script>
tags
++
<script>
tags, in bytes+public void setInlineScriptSize(int inlineScriptSize)+
inlineScriptSize
- the inlineScriptSize to set+public int getInlineStyleSize()+
<style>
tags
++
<style>
tags, in bytes+public void setInlineStyleSize(int inlineStyleSize)+
inlineStyleSize
- the inlineStyleSize to set+public int getInlineEventSize()+
onclick
, etc)
++
+public void setInlineEventSize(int inlineEventSize)+
inlineEventSize
- the inlineEventSize to set+public String toString()+
toString
in class Object
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + com.googlecode.htmlcompressor.compressor.XmlCompressor ++
public class XmlCompressor
+Class that compresses given XML source by removing comments, extra spaces and + line breaks while preserving content within CDATA blocks. +
+ +
+
+Constructor Summary | +|
---|---|
XmlCompressor()
+
++ |
+
+Method Summary | +|
---|---|
+ String |
+compress(String xml)
+
++ The main method that compresses given XML source and returns compressed result. |
+
+ boolean |
+isEnabled()
+
++ Returns true if compression is enabled. |
+
+ boolean |
+isRemoveComments()
+
++ Returns true if all XML comments will be removed. |
+
+ boolean |
+isRemoveIntertagSpaces()
+
++ Returns true if all inter-tag whitespace characters will be removed. |
+
+ void |
+setEnabled(boolean enabled)
+
++ If set to false all compression will be bypassed. |
+
+ void |
+setRemoveComments(boolean removeComments)
+
++ If set to true all XML comments will be removed. |
+
+ void |
+setRemoveIntertagSpaces(boolean removeIntertagSpaces)
+
++ If set to true all inter-tag whitespace characters will be removed. |
+
Methods inherited from class java.lang.Object | +
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
---|
+public XmlCompressor()+
+Method Detail | +
---|
+public String compress(String xml)+
+
compress
in interface Compressor
xml
- XML content to compress
++public boolean isEnabled()+
true
if compression is enabled.
++
true
if compression is enabled.+public void setEnabled(boolean enabled)+
false
all compression will be bypassed. Might be useful for testing purposes.
+ Default is true
.
++
enabled
- set false
to bypass all compression+public boolean isRemoveComments()+
true
if all XML comments will be removed.
++
true
if all XML comments will be removed+public void setRemoveComments(boolean removeComments)+
true
all XML comments will be removed.
+ Default is true
.
++
removeComments
- set true
to remove all XML comments+public boolean isRemoveIntertagSpaces()+
true
if all inter-tag whitespace characters will be removed.
++
true
if all inter-tag whitespace characters will be removed.+public void setRemoveIntertagSpaces(boolean removeIntertagSpaces)+
true
all inter-tag whitespace characters will be removed.
+ Default is true
.
++
removeIntertagSpaces
- set true
to remove all inter-tag whitespace characters
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + com.googlecode.htmlcompressor.compressor.YuiCssCompressor ++
public class YuiCssCompressor
+Basic CSS compressor implementation using Yahoo YUI Compressor
+ that could be used by HtmlCompressor
for inline CSS compression.
+
+ +
+
HtmlCompressor.setCssCompressor(Compressor)
,
+Yahoo YUI Compressor+Constructor Summary | +|
---|---|
YuiCssCompressor()
+
++ |
+
+Method Summary | +|
---|---|
+ String |
+compress(String source)
+
++ The main method that compresses the given source and returns a compressed result. |
+
+ int |
+getLineBreak()
+
++ Returns number of symbols per line Yahoo YUI Compressor + will use during CSS compression. |
+
+ void |
+setLineBreak(int lineBreak)
+
++ Tells Yahoo YUI Compressor to break lines after the specified number of symbols + during CSS compression. |
+
Methods inherited from class java.lang.Object | +
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
---|
+public YuiCssCompressor()+
+Method Detail | +
---|
+public String compress(String source)+
Compressor
+
compress
in interface Compressor
source
- The source to compress.
++public int getLineBreak()+
--line-break
command line option.
++
line-break
parameter value used for CSS compression.+public void setLineBreak(int lineBreak)+
--line-break
command line option.
+ This option has effect only if CSS compression is enabled.
+ Default is -1
to disable line breaks.
++
lineBreak
- set number of symbols per line
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + com.googlecode.htmlcompressor.compressor.YuiJavaScriptCompressor.DefaultErrorReporter ++
public static class YuiJavaScriptCompressor.DefaultErrorReporter
+Default ErrorReporter
implementation that uses System.err
+ stream for error reporting. Used by YUI Compressor to log errors during JavaScript compression.
+
+ +
+
+Constructor Summary | +|
---|---|
YuiJavaScriptCompressor.DefaultErrorReporter()
+
++ |
+
+Method Summary | +|
---|---|
+ void |
+error(String message,
+ String sourceName,
+ int line,
+ String lineSource,
+ int lineOffset)
+
++ |
+
+ org.mozilla.javascript.EvaluatorException |
+runtimeError(String message,
+ String sourceName,
+ int line,
+ String lineSource,
+ int lineOffset)
+
++ |
+
+ void |
+warning(String message,
+ String sourceName,
+ int line,
+ String lineSource,
+ int lineOffset)
+
++ |
+
Methods inherited from class java.lang.Object | +
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
---|
+public YuiJavaScriptCompressor.DefaultErrorReporter()+
+Method Detail | +
---|
+public void warning(String message, + String sourceName, + int line, + String lineSource, + int lineOffset)+
warning
in interface org.mozilla.javascript.ErrorReporter
+public void error(String message, + String sourceName, + int line, + String lineSource, + int lineOffset)+
error
in interface org.mozilla.javascript.ErrorReporter
+public org.mozilla.javascript.EvaluatorException runtimeError(String message, + String sourceName, + int line, + String lineSource, + int lineOffset)+
runtimeError
in interface org.mozilla.javascript.ErrorReporter
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + com.googlecode.htmlcompressor.compressor.YuiJavaScriptCompressor ++
public class YuiJavaScriptCompressor
+Basic JavaScript compressor implementation using Yahoo YUI Compressor
+ that could be used by HtmlCompressor
for inline JavaScript compression.
+
+ +
+
HtmlCompressor.setJavaScriptCompressor(Compressor)
,
+Yahoo YUI Compressor+Nested Class Summary | +|
---|---|
+static class |
+YuiJavaScriptCompressor.DefaultErrorReporter
+
++ Default ErrorReporter implementation that uses System.err
+ stream for error reporting. |
+
+Constructor Summary | +|
---|---|
YuiJavaScriptCompressor()
+
++ |
+
+Method Summary | +|
---|---|
+ String |
+compress(String source)
+
++ The main method that compresses the given source and returns a compressed result. |
+
+ org.mozilla.javascript.ErrorReporter |
+getErrorReporter()
+
++ Returns ErrorReporter used by YUI Compressor to log error messages
+ during JavasSript compression |
+
+ int |
+getLineBreak()
+
++ Returns number of symbols per line Yahoo YUI Compressor + will use during JavaScript compression. |
+
+ boolean |
+isDisableOptimizations()
+
++ Returns true if Yahoo YUI Compressor
+ will disable all the built-in micro optimizations during JavaScript compression. |
+
+ boolean |
+isNoMunge()
+
++ Returns true if Yahoo YUI Compressor
+ will only minify javascript without obfuscating local symbols. |
+
+ boolean |
+isPreserveAllSemiColons()
+
++ Returns true if Yahoo YUI Compressor
+ will preserve unnecessary semicolons during JavaScript compression. |
+
+ void |
+setDisableOptimizations(boolean disableOptimizations)
+
++ Tells Yahoo YUI Compressor to disable all the built-in micro optimizations + during JavaScript compression. |
+
+ void |
+setErrorReporter(org.mozilla.javascript.ErrorReporter errorReporter)
+
++ Sets ErrorReporter that YUI Compressor will use for reporting errors during
+ JavaScript compression. |
+
+ void |
+setLineBreak(int lineBreak)
+
++ Tells Yahoo YUI Compressor to break lines after the specified number of symbols + during JavaScript compression. |
+
+ void |
+setNoMunge(boolean noMunge)
+
++ Tells Yahoo YUI Compressor to only minify javascript without obfuscating + local symbols. |
+
+ void |
+setPreserveAllSemiColons(boolean preserveAllSemiColons)
+
++ Tells Yahoo YUI Compressor to preserve unnecessary semicolons + during JavaScript compression. |
+
Methods inherited from class java.lang.Object | +
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
---|
+public YuiJavaScriptCompressor()+
+Method Detail | +
---|
+public String compress(String source)+
Compressor
+
compress
in interface Compressor
source
- The source to compress.
++public boolean isNoMunge()+
true
if Yahoo YUI Compressor
+ will only minify javascript without obfuscating local symbols.
+ This corresponds to --nomunge
command line option.
++
nomunge
parameter value used for JavaScript compression.+public void setNoMunge(boolean noMunge)+
--nomunge
command line option.
+ This option has effect only if JavaScript compression is enabled.
+ Default is false
.
++
noMunge
- set true to enable nomunge
mode- See Also:
- Yahoo YUI Compressor
+public boolean isPreserveAllSemiColons()+
true
if Yahoo YUI Compressor
+ will preserve unnecessary semicolons during JavaScript compression.
+ This corresponds to --preserve-semi
command line option.
++
preserve-semi
parameter value used for JavaScript compression.+public void setPreserveAllSemiColons(boolean preserveAllSemiColons)+
--preserve-semi
command line option.
+ This option has effect only if JavaScript compression is enabled.
+ Default is false
.
++
preserveAllSemiColons
- set true to enable preserve-semi
mode- See Also:
- Yahoo YUI Compressor
+public boolean isDisableOptimizations()+
true
if Yahoo YUI Compressor
+ will disable all the built-in micro optimizations during JavaScript compression.
+ This corresponds to --disable-optimizations
command line option.
++
disable-optimizations
parameter value used for JavaScript compression.+public void setDisableOptimizations(boolean disableOptimizations)+
--disable-optimizations
command line option.
+ This option has effect only if JavaScript compression is enabled.
+ Default is false
.
++
disableOptimizations
- set true to enable
+ disable-optimizations
mode- See Also:
- Yahoo YUI Compressor
+public int getLineBreak()+
--line-break
command line option.
++
line-break
parameter value used for JavaScript compression.+public void setLineBreak(int lineBreak)+
--line-break
command line option.
+ This option has effect only if JavaScript compression is enabled.
+ Default is -1
to disable line breaks.
++
lineBreak
- set number of symbols per line+public org.mozilla.javascript.ErrorReporter getErrorReporter()+
ErrorReporter
used by YUI Compressor to log error messages
+ during JavasSript compression
++
ErrorReporter
used by YUI Compressor to log error messages
+ during JavasSript compression+public void setErrorReporter(org.mozilla.javascript.ErrorReporter errorReporter)+
ErrorReporter
that YUI Compressor will use for reporting errors during
+ JavaScript compression. If no ErrorReporter
was provided
+ YuiJavaScriptCompressor.DefaultErrorReporter
will be used
+ which reports errors to System.err
stream.
++
errorReporter
- ErrorReporter that will be used by YUI Compressor- See Also:
YuiJavaScriptCompressor.DefaultErrorReporter
,
+Yahoo YUI Compressor,
+ErrorReporter Interface
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+Packages that use Compressor | +|
---|---|
com.googlecode.htmlcompressor.compressor | ++ |
+Uses of Compressor in com.googlecode.htmlcompressor.compressor | +
---|
+ +
Classes in com.googlecode.htmlcompressor.compressor that implement Compressor | +|
---|---|
+ class |
+ClosureJavaScriptCompressor
+
++ Basic JavaScript compressor implementation using Google Closure Compiler + that could be used by HtmlCompressor for inline JavaScript compression. |
+
+ class |
+HtmlCompressor
+
++ Class that compresses given HTML source by removing comments, extra spaces and + line breaks while preserving content within <pre>, <textarea>, <script> + and <style> tags. |
+
+ class |
+XmlCompressor
+
++ Class that compresses given XML source by removing comments, extra spaces and + line breaks while preserving content within CDATA blocks. |
+
+ class |
+YuiCssCompressor
+
++ Basic CSS compressor implementation using Yahoo YUI Compressor + that could be used by HtmlCompressor for inline CSS compression. |
+
+ class |
+YuiJavaScriptCompressor
+
++ Basic JavaScript compressor implementation using Yahoo YUI Compressor + that could be used by HtmlCompressor for inline JavaScript compression. |
+
+ +
Methods in com.googlecode.htmlcompressor.compressor that return Compressor | +|
---|---|
+ Compressor |
+HtmlCompressor.getCssCompressor()
+
++ Returns CSS compressor implementation that will be used + to compress inline CSS in HTML. |
+
+ Compressor |
+HtmlCompressor.getJavaScriptCompressor()
+
++ Returns JavaScript compressor implementation that will be used + to compress inline JavaScript in HTML. |
+
+ +
Methods in com.googlecode.htmlcompressor.compressor with parameters of type Compressor | +|
---|---|
+ void |
+HtmlCompressor.setCssCompressor(Compressor cssCompressor)
+
++ Sets CSS compressor implementation that will be used + to compress inline CSS in HTML. |
+
+ void |
+HtmlCompressor.setJavaScriptCompressor(Compressor javaScriptCompressor)
+
++ Sets JavaScript compressor implementation that will be used + to compress inline JavaScript in HTML. |
+
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+Packages that use HtmlCompressorStatistics | +|
---|---|
com.googlecode.htmlcompressor.compressor | ++ |
+Uses of HtmlCompressorStatistics in com.googlecode.htmlcompressor.compressor | +
---|
+ +
Methods in com.googlecode.htmlcompressor.compressor that return HtmlCompressorStatistics | +|
---|---|
+ HtmlCompressorStatistics |
+HtmlCompressor.getStatistics()
+
++ Returns HtmlCompressorStatistics object containing statistics of the last HTML compression, if enabled. |
+
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+Packages that use HtmlMetrics | +|
---|---|
com.googlecode.htmlcompressor.compressor | ++ |
+Uses of HtmlMetrics in com.googlecode.htmlcompressor.compressor | +
---|
+ +
Methods in com.googlecode.htmlcompressor.compressor that return HtmlMetrics | +|
---|---|
+ HtmlMetrics |
+HtmlCompressorStatistics.getCompressedMetrics()
+
++ Returns metrics of a compressed document |
+
+ HtmlMetrics |
+HtmlCompressorStatistics.getOriginalMetrics()
+
++ Returns metrics of an uncompressed document |
+
+ +
Methods in com.googlecode.htmlcompressor.compressor with parameters of type HtmlMetrics | +|
---|---|
+ void |
+HtmlCompressorStatistics.setCompressedMetrics(HtmlMetrics compressedMetrics)
+
++ |
+
+ void |
+HtmlCompressorStatistics.setOriginalMetrics(HtmlMetrics originalMetrics)
+
++ |
+
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+Interfaces
+
+ +Compressor |
+
+Classes
+
+ +ClosureJavaScriptCompressor + +HtmlCompressor + +HtmlCompressorStatistics + +HtmlMetrics + +XmlCompressor + +YuiCssCompressor + +YuiJavaScriptCompressor + +YuiJavaScriptCompressor.DefaultErrorReporter |
+
+
+
|
++ + | +|||||||||
+ PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +
+Interface Summary | +|
---|---|
Compressor | +Interface describing compressor classes. | +
+ +
+Class Summary | +|
---|---|
ClosureJavaScriptCompressor | +Basic JavaScript compressor implementation using Google Closure Compiler
+ that could be used by HtmlCompressor for inline JavaScript compression. |
+
HtmlCompressor | +Class that compresses given HTML source by removing comments, extra spaces and + line breaks while preserving content within <pre>, <textarea>, <script> + and <style> tags. | +
HtmlCompressorStatistics | +Class that stores HTML compression statistics | +
HtmlMetrics | +Class that stores metrics about HTML documents. | +
XmlCompressor | +Class that compresses given XML source by removing comments, extra spaces and + line breaks while preserving content within CDATA blocks. | +
YuiCssCompressor | +Basic CSS compressor implementation using Yahoo YUI Compressor
+ that could be used by HtmlCompressor for inline CSS compression. |
+
YuiJavaScriptCompressor | +Basic JavaScript compressor implementation using Yahoo YUI Compressor
+ that could be used by HtmlCompressor for inline JavaScript compression. |
+
YuiJavaScriptCompressor.DefaultErrorReporter | +Default ErrorReporter implementation that uses System.err
+ stream for error reporting. |
+
+
+
+
|
++ + | +|||||||||
+ PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+Packages that use com.googlecode.htmlcompressor.compressor | +|
---|---|
com.googlecode.htmlcompressor.compressor | ++ |
+Classes in com.googlecode.htmlcompressor.compressor used by com.googlecode.htmlcompressor.compressor | +|
---|---|
Compressor
+
+ + Interface describing compressor classes. |
+|
HtmlCompressorStatistics
+
+ + Class that stores HTML compression statistics |
+|
HtmlMetrics
+
+ + Class that stores metrics about HTML documents. |
+
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+Classes
+
+ +CmdLineCompressor |
+
+
+
|
++ + | +|||||||||
+ PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +
+Class Summary | +|
---|---|
CmdLineCompressor | +Wrapper for HTML and XML compressor classes that allows using them from a command line. | +
+
+
+
|
++ + | +|||||||||
+ PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + javax.servlet.jsp.tagext.TagSupport + javax.servlet.jsp.tagext.BodyTagSupport + com.googlecode.htmlcompressor.taglib.CssCompressorTag ++
public class CssCompressorTag
+JSP tag that compresses an CSS content within <compress:css> using Yahoo YUI Compressor.
+ All CSS-related properties from HtmlCompressor
are supported.
+
+ +
+
HtmlCompressor
,
+Yahoo YUI Compressor,
+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 | +|
---|---|
CssCompressorTag()
+
++ |
+
+Method Summary | +|
---|---|
+ int |
+doEndTag()
+
++ |
+
+ void |
+setEnabled(boolean enabled)
+
++ |
+
+ void |
+setYuiCssLineBreak(int yuiCssLineBreak)
+
++ |
+
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 | +
---|
+public CssCompressorTag()+
+Method Detail | +
---|
+public int doEndTag() + throws javax.servlet.jsp.JspException+
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
+public void setYuiCssLineBreak(int yuiCssLineBreak)+
HtmlCompressor.setYuiCssLineBreak(int)
+public void setEnabled(boolean enabled)+
HtmlCompressor.setEnabled(boolean)
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + javax.servlet.jsp.tagext.TagSupport + javax.servlet.jsp.tagext.BodyTagSupport + com.googlecode.htmlcompressor.taglib.HtmlCompressorTag ++
public class HtmlCompressorTag
+JSP tag that compresses an HTML content within <compress:html>. + Compression parameters are set by default (no JavaScript and CSS compression). +
+ +
+
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 | +
---|
+public HtmlCompressorTag()+
+Method Detail | +
---|
+public int doEndTag() + throws javax.servlet.jsp.JspException+
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
+public void setCompressJavaScript(boolean compressJavaScript)+
HtmlCompressor.setCompressJavaScript(boolean)
+public void setCompressCss(boolean compressCss)+
HtmlCompressor.setCompressCss(boolean)
+public void setYuiJsNoMunge(boolean yuiJsNoMunge)+
HtmlCompressor.setYuiJsNoMunge(boolean)
+public void setYuiJsPreserveAllSemiColons(boolean yuiJsPreserveAllSemiColons)+
HtmlCompressor.setYuiJsPreserveAllSemiColons(boolean)
+public void setYuiJsDisableOptimizations(boolean yuiJsDisableOptimizations)+
HtmlCompressor.setYuiJsDisableOptimizations(boolean)
+public void setYuiJsLineBreak(int yuiJsLineBreak)+
HtmlCompressor.setYuiJsLineBreak(int)
+public void setYuiCssLineBreak(int yuiCssLineBreak)+
HtmlCompressor.setYuiCssLineBreak(int)
+public void setRemoveQuotes(boolean removeQuotes)+
HtmlCompressor.setRemoveQuotes(boolean)
+public void setPreserveLineBreaks(boolean preserveLineBreaks)+
HtmlCompressor.setPreserveLineBreaks(boolean)
+public void setEnabled(boolean enabled)+
HtmlCompressor.setEnabled(boolean)
+public void setRemoveComments(boolean removeComments)+
HtmlCompressor.setRemoveComments(boolean)
+public void setRemoveMultiSpaces(boolean removeMultiSpaces)+
HtmlCompressor.setRemoveMultiSpaces(boolean)
+public void setRemoveIntertagSpaces(boolean removeIntertagSpaces)+
HtmlCompressor.setRemoveIntertagSpaces(boolean)
+public void setJsCompressor(String jsCompressor)+
+
jsCompressor
- Could be either "yui"
for using YuiJavaScriptCompressor
(used by default if none provided) or
+ "closure"
for using ClosureJavaScriptCompressor
YuiJavaScriptCompressor
,
+ClosureJavaScriptCompressor
,
+Yahoo YUI Compressor,
+Google Closure Compiler+public void setClosureOptLevel(String closureOptLevel)+
+
closureOptLevel
- Could be either "simple"
(used by default), "whitespace"
or "advanced"
ClosureJavaScriptCompressor.setCompilationLevel(CompilationLevel)
+public void setSimpleDoctype(boolean simpleDoctype)+
HtmlCompressor.setSimpleDoctype(boolean)
+public void setRemoveScriptAttributes(boolean removeScriptAttributes)+
HtmlCompressor.setRemoveScriptAttributes(boolean)
+public void setRemoveStyleAttributes(boolean removeStyleAttributes)+
HtmlCompressor.setRemoveStyleAttributes(boolean)
+public void setRemoveLinkAttributes(boolean removeLinkAttributes)+
HtmlCompressor.setRemoveLinkAttributes(boolean)
+public void setRemoveFormAttributes(boolean removeFormAttributes)+
HtmlCompressor.setRemoveFormAttributes(boolean)
+public void setRemoveInputAttributes(boolean removeInputAttributes)+
HtmlCompressor.setRemoveInputAttributes(boolean)
+public void setSimpleBooleanAttributes(boolean simpleBooleanAttributes)+
HtmlCompressor.setSimpleBooleanAttributes(boolean)
+public void setRemoveJavaScriptProtocol(boolean removeJavaScriptProtocol)+
HtmlCompressor.setRemoveJavaScriptProtocol(boolean)
+public void setRemoveHttpProtocol(boolean removeHttpProtocol)+
HtmlCompressor.setRemoveHttpProtocol(boolean)
+public void setRemoveHttpsProtocol(boolean removeHttpsProtocol)+
HtmlCompressor.setRemoveHttpsProtocol(boolean)
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + javax.servlet.jsp.tagext.TagSupport + javax.servlet.jsp.tagext.BodyTagSupport + com.googlecode.htmlcompressor.taglib.JavaScriptCompressorTag ++
public class JavaScriptCompressorTag
+JSP tag that compresses an JavaScript content within <compress:js> tags.
+ All JavaScript-related properties from HtmlCompressor
are supported.
+
+ +
+
HtmlCompressor
,
+Yahoo YUI Compressor,
+Google Closure Compiler,
+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 | +|
---|---|
JavaScriptCompressorTag()
+
++ |
+
+Method Summary | +|
---|---|
+ int |
+doEndTag()
+
++ |
+
+ void |
+setClosureOptLevel(String closureOptLevel)
+
++ Sets level of optimization if Google Closure Compiler is used + for compressing inline JavaScript. |
+
+ void |
+setEnabled(boolean enabled)
+
++ |
+
+ void |
+setJsCompressor(String jsCompressor)
+
++ Sets JavaScript compressor implementation that will be used + to compress inline JavaScript in HTML. |
+
+ 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 | +
---|
+public JavaScriptCompressorTag()+
+Method Detail | +
---|
+public int doEndTag() + throws javax.servlet.jsp.JspException+
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
+public void setYuiJsNoMunge(boolean yuiJsNoMunge)+
HtmlCompressor.setYuiJsNoMunge(boolean)
+public void setYuiJsPreserveAllSemiColons(boolean yuiJsPreserveAllSemiColons)+
HtmlCompressor.setYuiJsPreserveAllSemiColons(boolean)
+public void setYuiJsDisableOptimizations(boolean yuiJsDisableOptimizations)+
HtmlCompressor.setYuiJsDisableOptimizations(boolean)
+public void setYuiJsLineBreak(int yuiJsLineBreak)+
HtmlCompressor.setYuiJsLineBreak(int)
+public void setEnabled(boolean enabled)+
HtmlCompressor.setEnabled(boolean)
+public void setJsCompressor(String jsCompressor)+
+
jsCompressor
- Could be either "yui"
for using YuiJavaScriptCompressor
(used by default if none provided) or
+ "closure"
for using ClosureJavaScriptCompressor
YuiJavaScriptCompressor
,
+ClosureJavaScriptCompressor
,
+Yahoo YUI Compressor,
+Google Closure Compiler+public void setClosureOptLevel(String closureOptLevel)+
+
closureOptLevel
- Could be either "simple"
(used by default), "whitespace"
or "advanced"
ClosureJavaScriptCompressor.setCompilationLevel(CompilationLevel)
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + javax.servlet.jsp.tagext.TagSupport + javax.servlet.jsp.tagext.BodyTagSupport + com.googlecode.htmlcompressor.taglib.XmlCompressorTag ++
public class XmlCompressorTag
+JSP tag that compresses an XML content within <compress:xml>. + Compression parameters are set by default. +
+ +
+
XmlCompressor
,
+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 | +|
---|---|
XmlCompressorTag()
+
++ |
+
+Method Summary | +|
---|---|
+ int |
+doEndTag()
+
++ |
+
+ void |
+setEnabled(boolean enabled)
+
++ |
+
+ void |
+setRemoveComments(boolean removeComments)
+
++ |
+
+ void |
+setRemoveIntertagSpaces(boolean removeIntertagSpaces)
+
++ |
+
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 | +
---|
+public XmlCompressorTag()+
+Method Detail | +
---|
+public int doEndTag() + throws javax.servlet.jsp.JspException+
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
+public void setEnabled(boolean enabled)+
XmlCompressor.setEnabled(boolean)
+public void setRemoveComments(boolean removeComments)+
XmlCompressor.setRemoveComments(boolean)
+public void setRemoveIntertagSpaces(boolean removeIntertagSpaces)+
XmlCompressor.setRemoveIntertagSpaces(boolean)
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+Classes
+
+ +CssCompressorTag + +HtmlCompressorTag + +JavaScriptCompressorTag + +XmlCompressorTag |
+
+
+
|
++ + | +|||||||||
+ PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +
+Class Summary | +|
---|---|
CssCompressorTag | +JSP tag that compresses an CSS content within <compress:css> using Yahoo YUI Compressor. | +
HtmlCompressorTag | +JSP tag that compresses an HTML content within <compress:html>. | +
JavaScriptCompressorTag | +JSP tag that compresses an JavaScript content within <compress:js> tags. | +
XmlCompressorTag | +JSP tag that compresses an XML content within <compress:xml>. | +
+
+
+
|
++ + | +|||||||||
+ PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + org.apache.velocity.runtime.directive.Directive + com.googlecode.htmlcompressor.velocity.CssCompressorDirective ++
public class CssCompressorDirective
+Velocity directive that compresses an CSS content within #compressCss ... #end block.
+ All CSS-related properties from HtmlCompressor
are supported.
+
+ +
+
HtmlCompressor
,
+Yahoo YUI Compressor+Field Summary | +
---|
Fields inherited from interface org.apache.velocity.runtime.directive.DirectiveConstants | +
---|
BLOCK, LINE |
+
+Constructor Summary | +|
---|---|
CssCompressorDirective()
+
++ |
+
+Method Summary | +|
---|---|
+ String |
+getName()
+
++ |
+
+ int |
+getType()
+
++ |
+
+ void |
+init(org.apache.velocity.runtime.RuntimeServices rs,
+ org.apache.velocity.context.InternalContextAdapter context,
+ org.apache.velocity.runtime.parser.node.Node node)
+
++ |
+
+ boolean |
+render(org.apache.velocity.context.InternalContextAdapter context,
+ Writer writer,
+ org.apache.velocity.runtime.parser.node.Node node)
+
++ |
+
Methods inherited from class org.apache.velocity.runtime.directive.Directive | +
---|
getColumn, getLine, getTemplateName, setLocation, setLocation |
+
Methods inherited from class java.lang.Object | +
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
---|
+public CssCompressorDirective()+
+Method Detail | +
---|
+public String getName()+
getName
in class org.apache.velocity.runtime.directive.Directive
+public int getType()+
getType
in class org.apache.velocity.runtime.directive.Directive
+public void init(org.apache.velocity.runtime.RuntimeServices rs, + org.apache.velocity.context.InternalContextAdapter context, + org.apache.velocity.runtime.parser.node.Node node) + throws org.apache.velocity.exception.TemplateInitException+
init
in class org.apache.velocity.runtime.directive.Directive
org.apache.velocity.exception.TemplateInitException
+public boolean render(org.apache.velocity.context.InternalContextAdapter context, + Writer writer, + org.apache.velocity.runtime.parser.node.Node node) + throws IOException, + org.apache.velocity.exception.ResourceNotFoundException, + org.apache.velocity.exception.ParseErrorException, + org.apache.velocity.exception.MethodInvocationException+
render
in class org.apache.velocity.runtime.directive.Directive
IOException
+org.apache.velocity.exception.ResourceNotFoundException
+org.apache.velocity.exception.ParseErrorException
+org.apache.velocity.exception.MethodInvocationException
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + org.apache.velocity.runtime.directive.Directive + com.googlecode.htmlcompressor.velocity.HtmlCompressorDirective ++
public class HtmlCompressorDirective
+Velocity directive that compresses an HTML content within #compressHtml ... #end block. + Compression parameters are set by default (no JavaScript and CSS compression). +
+ +
+
HtmlCompressor
+Field Summary | +
---|
Fields inherited from interface org.apache.velocity.runtime.directive.DirectiveConstants | +
---|
BLOCK, LINE |
+
+Constructor Summary | +|
---|---|
HtmlCompressorDirective()
+
++ |
+
+Method Summary | +|
---|---|
+ String |
+getName()
+
++ |
+
+ int |
+getType()
+
++ |
+
+ void |
+init(org.apache.velocity.runtime.RuntimeServices rs,
+ org.apache.velocity.context.InternalContextAdapter context,
+ org.apache.velocity.runtime.parser.node.Node node)
+
++ |
+
+ boolean |
+render(org.apache.velocity.context.InternalContextAdapter context,
+ Writer writer,
+ org.apache.velocity.runtime.parser.node.Node node)
+
++ |
+
Methods inherited from class org.apache.velocity.runtime.directive.Directive | +
---|
getColumn, getLine, getTemplateName, setLocation, setLocation |
+
Methods inherited from class java.lang.Object | +
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
---|
+public HtmlCompressorDirective()+
+Method Detail | +
---|
+public String getName()+
getName
in class org.apache.velocity.runtime.directive.Directive
+public int getType()+
getType
in class org.apache.velocity.runtime.directive.Directive
+public void init(org.apache.velocity.runtime.RuntimeServices rs, + org.apache.velocity.context.InternalContextAdapter context, + org.apache.velocity.runtime.parser.node.Node node) + throws org.apache.velocity.exception.TemplateInitException+
init
in class org.apache.velocity.runtime.directive.Directive
org.apache.velocity.exception.TemplateInitException
+public boolean render(org.apache.velocity.context.InternalContextAdapter context, + Writer writer, + org.apache.velocity.runtime.parser.node.Node node) + throws IOException, + org.apache.velocity.exception.ResourceNotFoundException, + org.apache.velocity.exception.ParseErrorException, + org.apache.velocity.exception.MethodInvocationException+
render
in class org.apache.velocity.runtime.directive.Directive
IOException
+org.apache.velocity.exception.ResourceNotFoundException
+org.apache.velocity.exception.ParseErrorException
+org.apache.velocity.exception.MethodInvocationException
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + org.apache.velocity.runtime.directive.Directive + com.googlecode.htmlcompressor.velocity.JavaScriptCompressorDirective ++
public class JavaScriptCompressorDirective
+Velocity directive that compresses an JavaScript content within #compressJs ... #end block.
+ All JavaScript-related properties from HtmlCompressor
are supported.
+
+ +
+
HtmlCompressor
,
+Yahoo YUI Compressor,
+Google Closure Compiler+Field Summary | +
---|
Fields inherited from interface org.apache.velocity.runtime.directive.DirectiveConstants | +
---|
BLOCK, LINE |
+
+Constructor Summary | +|
---|---|
JavaScriptCompressorDirective()
+
++ |
+
+Method Summary | +|
---|---|
+ String |
+getName()
+
++ |
+
+ int |
+getType()
+
++ |
+
+ void |
+init(org.apache.velocity.runtime.RuntimeServices rs,
+ org.apache.velocity.context.InternalContextAdapter context,
+ org.apache.velocity.runtime.parser.node.Node node)
+
++ |
+
+ boolean |
+render(org.apache.velocity.context.InternalContextAdapter context,
+ Writer writer,
+ org.apache.velocity.runtime.parser.node.Node node)
+
++ |
+
Methods inherited from class org.apache.velocity.runtime.directive.Directive | +
---|
getColumn, getLine, getTemplateName, setLocation, setLocation |
+
Methods inherited from class java.lang.Object | +
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
---|
+public JavaScriptCompressorDirective()+
+Method Detail | +
---|
+public String getName()+
getName
in class org.apache.velocity.runtime.directive.Directive
+public int getType()+
getType
in class org.apache.velocity.runtime.directive.Directive
+public void init(org.apache.velocity.runtime.RuntimeServices rs, + org.apache.velocity.context.InternalContextAdapter context, + org.apache.velocity.runtime.parser.node.Node node) + throws org.apache.velocity.exception.TemplateInitException+
init
in class org.apache.velocity.runtime.directive.Directive
org.apache.velocity.exception.TemplateInitException
+public boolean render(org.apache.velocity.context.InternalContextAdapter context, + Writer writer, + org.apache.velocity.runtime.parser.node.Node node) + throws IOException, + org.apache.velocity.exception.ResourceNotFoundException, + org.apache.velocity.exception.ParseErrorException, + org.apache.velocity.exception.MethodInvocationException+
render
in class org.apache.velocity.runtime.directive.Directive
IOException
+org.apache.velocity.exception.ResourceNotFoundException
+org.apache.velocity.exception.ParseErrorException
+org.apache.velocity.exception.MethodInvocationException
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + org.apache.velocity.runtime.directive.Directive + com.googlecode.htmlcompressor.velocity.XmlCompressorDirective ++
public class XmlCompressorDirective
+Velocity directive that compresses an XML content within #compressXml ... #end block. + Compression parameters are set by default. +
+ +
+
XmlCompressor
+Field Summary | +
---|
Fields inherited from interface org.apache.velocity.runtime.directive.DirectiveConstants | +
---|
BLOCK, LINE |
+
+Constructor Summary | +|
---|---|
XmlCompressorDirective()
+
++ |
+
+Method Summary | +|
---|---|
+ String |
+getName()
+
++ |
+
+ int |
+getType()
+
++ |
+
+ void |
+init(org.apache.velocity.runtime.RuntimeServices rs,
+ org.apache.velocity.context.InternalContextAdapter context,
+ org.apache.velocity.runtime.parser.node.Node node)
+
++ |
+
+ boolean |
+render(org.apache.velocity.context.InternalContextAdapter context,
+ Writer writer,
+ org.apache.velocity.runtime.parser.node.Node node)
+
++ |
+
Methods inherited from class org.apache.velocity.runtime.directive.Directive | +
---|
getColumn, getLine, getTemplateName, setLocation, setLocation |
+
Methods inherited from class java.lang.Object | +
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
---|
+public XmlCompressorDirective()+
+Method Detail | +
---|
+public String getName()+
getName
in class org.apache.velocity.runtime.directive.Directive
+public int getType()+
getType
in class org.apache.velocity.runtime.directive.Directive
+public void init(org.apache.velocity.runtime.RuntimeServices rs, + org.apache.velocity.context.InternalContextAdapter context, + org.apache.velocity.runtime.parser.node.Node node) + throws org.apache.velocity.exception.TemplateInitException+
init
in class org.apache.velocity.runtime.directive.Directive
org.apache.velocity.exception.TemplateInitException
+public boolean render(org.apache.velocity.context.InternalContextAdapter context, + Writer writer, + org.apache.velocity.runtime.parser.node.Node node) + throws IOException, + org.apache.velocity.exception.ResourceNotFoundException, + org.apache.velocity.exception.ParseErrorException, + org.apache.velocity.exception.MethodInvocationException+
render
in class org.apache.velocity.runtime.directive.Directive
IOException
+org.apache.velocity.exception.ResourceNotFoundException
+org.apache.velocity.exception.ParseErrorException
+org.apache.velocity.exception.MethodInvocationException
+
+
|
++ + | +|||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+Classes
+
+ +CssCompressorDirective + +HtmlCompressorDirective + +JavaScriptCompressorDirective + +XmlCompressorDirective |
+
+
+
|
++ + | +|||||||||
+ PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +
+Class Summary | +|
---|---|
CssCompressorDirective | +Velocity directive that compresses an CSS content within #compressCss ... | +
HtmlCompressorDirective | +Velocity directive that compresses an HTML content within #compressHtml ... | +
JavaScriptCompressorDirective | +Velocity directive that compresses an JavaScript content within #compressJs ... | +
XmlCompressorDirective | +Velocity directive that compresses an XML content within #compressXml ... | +
+
+
+
|
++ + | +|||||||||
+ PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+com.googlecode.* | +
---|
+ +
com.googlecode.htmlcompressor.compressor.ClosureJavaScriptCompressor | +||
---|---|---|
+public static final String |
+COMPILATION_LEVEL_ADVANCED |
+"advanced" |
+
+public static final String |
+COMPILATION_LEVEL_SIMPLE |
+"simple" |
+
+public static final String |
+COMPILATION_LEVEL_WHITESPACE |
+"whitespace" |
+
+ +
+ +
com.googlecode.htmlcompressor.compressor.HtmlCompressor | +||
---|---|---|
+public static final String |
+ALL_TAGS |
+"all" |
+
+public static final String |
+BLOCK_TAGS_MAX |
+"html,head,body,br,p,h1,h2,h3,h4,h5,h6,blockquote,center,dl,fieldset,form,frame,frameset,hr,noframes,ol,table,tbody,tr,td,th,tfoot,thead,ul" |
+
+public static final String |
+BLOCK_TAGS_MIN |
+"html,head,body,br,p" |
+
+public static final String |
+JS_COMPRESSOR_CLOSURE |
+"closure" |
+
+public static final String |
+JS_COMPRESSOR_YUI |
+"yui" |
+
+ +
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+ +++The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.
+ +++Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:
+
+- Interfaces (italic)
- Classes
- Enums
- Exceptions
- Errors
- Annotation Types
+ ++ ++Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
+
+Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.- Class inheritance diagram
- Direct Subclasses
- All Known Subinterfaces
- All Known Implementing Classes
- Class/interface declaration
- Class/interface description +
+
- Nested Class Summary
- Field Summary
- Constructor Summary
- Method Summary +
+
- Field Detail
- Constructor Detail
- Method Detail
+ ++ ++Each annotation type has its own separate page with the following sections:
+
+- Annotation Type declaration
- Annotation Type description
- Required Element Summary
- Optional Element Summary
- Element Detail
+ +++Each enum has its own separate page with the following sections:
+
+- Enum declaration
- Enum description
- Enum Constant Summary
- Enum Constant Detail
+Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.+
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with+java.lang.Object
. The interfaces do not inherit fromjava.lang.Object
.+
+- When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
- When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
+The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.+
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.+
+
+
+
+
+This help file applies to API documentation generated using the standard doclet.
+
+
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
setRemoveSurroundingSpaces
method
+ to remove all surrounding spaces (not recommended).
+<div>
and <li>
tags.
+HtmlCompressor
for inline JavaScript compression.ErrorReporter
used by YUI Compressor to log error messages
+ during JavasSript compression
+JSSourceFile
used as a reference during the compression
+ at CompilationLevel.ADVANCED_OPTIMIZATIONS
level.
+onclick
, etc)
+<script>
tags
+<style>
tags
+<pre>
tags or inside
+ <script>
tags with disabled javascript compression)
+HtmlCompressorStatistics
object containing statistics of the last HTML compression, if enabled.
+WarningLevel
used by the Closure compiler
+ErrorReporter
used by YUI Compressor to log error messages
+ during JavasSript compression
+true
if CSS compression is enabled.
+true
if JavaScript compression is enabled.
+true
if default externs defined inside Closure's jar are ignored
+ and only user defined ones are used.
+true
if Yahoo YUI Compressor
+ will disable all the built-in micro optimizations during JavaScript compression.
+true
if compression is enabled.
+true
if compression is enabled.
+true
if HTML compression statistics is generated
+true
if Yahoo YUI Compressor
+ will only minify javascript without obfuscating local symbols.
+true
if Yahoo YUI Compressor
+ will preserve unnecessary semicolons during JavaScript compression.
+true
if line breaks will be preserved.
+true
if all HTML comments will be removed.
+true
if all XML comments will be removed.
+true
if method="get"
attributes will be removed from <form>
tags
+true
if HTTP
protocol will be removed from href
, src
, cite
, and action
tag attributes.
+true
if HTTPS
protocol will be removed from href
, src
, cite
, and action
tag attributes.
+true
if type="text"
attributes will be removed from <input>
tags
+true
if all inter-tag whitespace characters will be removed.
+true
if all inter-tag whitespace characters will be removed.
+true
if javascript:
pseudo-protocol will be removed from inline event handlers.
+true
if unnecessary attributes will be removed from <link>
tags
+true
if all multiple whitespace characters will be replaced with single spaces.
+true
if all unnecessary quotes will be removed
+ from tag attributes.
+true
if unnecessary attributes wil be removed from <script>
tags
+true
if type="text/style"
attributes will be removed from <style>
tags
+true
if boolean attributes will be simplified
+true
if existing DOCTYPE declaration will be replaced with simple
declaration.
+true
if Yahoo YUI Compressor
+ will disable all the built-in micro optimizations during JavaScript compression.
+true
if Yahoo YUI Compressor
+ will only minify javascript without obfuscating local symbols.
+true
if Yahoo YUI Compressor
+ will preserve unnecessary semicolons during JavaScript compression.
+<?php ...
+- process(String[]) -
+Method in class com.googlecode.htmlcompressor.CmdLineCompressor
+
-
+
<% ...
+- SERVER_SIDE_INCLUDE_PATTERN -
+Static variable in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- Predefined pattern that matches
<--# ...
+- setClosureOptLevel(String) -
+Method in class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
+
- Sets level of optimization if Google Closure Compiler is used
+ for compressing inline JavaScript.
+
- setClosureOptLevel(String) -
+Method in class com.googlecode.htmlcompressor.taglib.JavaScriptCompressorTag
+
- Sets level of optimization if Google Closure Compiler is used
+ for compressing inline JavaScript.
+
- setCompilationLevel(CompilationLevel) -
+Method in class com.googlecode.htmlcompressor.compressor.ClosureJavaScriptCompressor
+
- Sets level of optimization that should be applied when compiling JavaScript code.
+
- setCompilerOptions(CompilerOptions) -
+Method in class com.googlecode.htmlcompressor.compressor.ClosureJavaScriptCompressor
+
- Sets options that will be used by the Closure compiler.
+
- setCompressCss(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- Enables CSS compression within <style> tags using
+ Yahoo YUI Compressor
+ if set to
true
.
+ - setCompressCss(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
+
-
+
- setCompressedMetrics(HtmlMetrics) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressorStatistics
+
-
+
- setCompressJavaScript(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- Enables JavaScript compression within <script> tags using
+ Yahoo YUI Compressor
+ if set to
true
.
+ - setCompressJavaScript(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
+
-
+
- setCssCompressor(Compressor) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- Sets CSS compressor implementation that will be used
+ to compress inline CSS in HTML.
+
- setCustomExternsOnly(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.ClosureJavaScriptCompressor
+
- If set to
true
, default externs defined inside Closure's jar will be ignored
+ and only user defined ones will be used.
+ - setDisableOptimizations(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.YuiJavaScriptCompressor
+
- Tells Yahoo YUI Compressor to disable all the built-in micro optimizations
+ during JavaScript compression.
+
- setEmptyChars(int) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlMetrics
+
-
+
- setEnabled(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- If set to
false
all compression will be bypassed.
+ - setEnabled(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.XmlCompressor
+
- If set to
false
all compression will be bypassed.
+ - setEnabled(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.CssCompressorTag
+
-
+
- setEnabled(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
+
-
+
- setEnabled(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.JavaScriptCompressorTag
+
-
+
- setEnabled(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.XmlCompressorTag
+
-
+
- setErrorReporter(ErrorReporter) -
+Method in class com.googlecode.htmlcompressor.compressor.YuiJavaScriptCompressor
+
- Sets
ErrorReporter
that YUI Compressor will use for reporting errors during
+ JavaScript compression.
+ - setExterns(List<JSSourceFile>) -
+Method in class com.googlecode.htmlcompressor.compressor.ClosureJavaScriptCompressor
+
- Sets external JavaScript files that are used as a reference for function declarations if
+
CompilationLevel.ADVANCED_OPTIMIZATIONS
compression level is used.
+ - setFilesize(int) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlMetrics
+
-
+
- setGenerateStatistics(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- If set to
true
, HTML compression statistics will be generated.
+ - setInlineEventSize(int) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlMetrics
+
-
+
- setInlineScriptSize(int) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlMetrics
+
-
+
- setInlineStyleSize(int) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlMetrics
+
-
+
- setJavaScriptCompressor(Compressor) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- Sets JavaScript compressor implementation that will be used
+ to compress inline JavaScript in HTML.
+
- setJsCompressor(String) -
+Method in class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
+
- Sets JavaScript compressor implementation that will be used
+ to compress inline JavaScript in HTML.
+
- setJsCompressor(String) -
+Method in class com.googlecode.htmlcompressor.taglib.JavaScriptCompressorTag
+
- Sets JavaScript compressor implementation that will be used
+ to compress inline JavaScript in HTML.
+
- setLineBreak(int) -
+Method in class com.googlecode.htmlcompressor.compressor.YuiCssCompressor
+
- Tells Yahoo YUI Compressor to break lines after the specified number of symbols
+ during CSS compression.
+
- setLineBreak(int) -
+Method in class com.googlecode.htmlcompressor.compressor.YuiJavaScriptCompressor
+
- Tells Yahoo YUI Compressor to break lines after the specified number of symbols
+ during JavaScript compression.
+
- setLoggingLevel(Level) -
+Method in class com.googlecode.htmlcompressor.compressor.ClosureJavaScriptCompressor
+
- Sets logging level for the Closure compiler.
+
- setNoMunge(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.YuiJavaScriptCompressor
+
- Tells Yahoo YUI Compressor to only minify javascript without obfuscating
+ local symbols.
+
- setOriginalMetrics(HtmlMetrics) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressorStatistics
+
-
+
- setPreserveAllSemiColons(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.YuiJavaScriptCompressor
+
- Tells Yahoo YUI Compressor to preserve unnecessary semicolons
+ during JavaScript compression.
+
- setPreservedSize(int) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressorStatistics
+
-
+
- setPreserveLineBreaks(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- If set to
true
, line breaks will be preserved.
+ - setPreserveLineBreaks(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
+
-
+
- setPreservePatterns(List<Pattern>) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- This method allows setting custom block preservation rules defined by regular
+ expression patterns.
+
- setRemoveComments(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- If set to
true
all HTML comments will be removed.
+ - setRemoveComments(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.XmlCompressor
+
- If set to
true
all XML comments will be removed.
+ - setRemoveComments(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
+
-
+
- setRemoveComments(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.XmlCompressorTag
+
-
+
- setRemoveFormAttributes(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- If set to
true
, method="get"
attributes will be removed from <form>
tags.
+ - setRemoveFormAttributes(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
+
-
+
- setRemoveHttpProtocol(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- If set to
true
, HTTP
protocol will be removed from href
, src
, cite
, and action
tag attributes.
+ - setRemoveHttpProtocol(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
+
-
+
- setRemoveHttpsProtocol(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- If set to
true
, HTTPS
protocol will be removed from href
, src
, cite
, and action
tag attributes.
+ - setRemoveHttpsProtocol(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
+
-
+
- setRemoveInputAttributes(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- If set to
true
, type="text"
attributes will be removed from <input>
tags.
+ - setRemoveInputAttributes(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
+
-
+
- setRemoveIntertagSpaces(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- If set to
true
all inter-tag whitespace characters will be removed.
+ - setRemoveIntertagSpaces(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.XmlCompressor
+
- If set to
true
all inter-tag whitespace characters will be removed.
+ - setRemoveIntertagSpaces(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
+
-
+
- setRemoveIntertagSpaces(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.XmlCompressorTag
+
-
+
- setRemoveJavaScriptProtocol(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- If set to
true
, javascript:
pseudo-protocol will be removed from inline event handlers.
+ - setRemoveJavaScriptProtocol(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
+
-
+
- setRemoveLinkAttributes(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- If set to
true
, following attributes will be removed from <link rel="stylesheet">
and <link rel="alternate stylesheet">
tags:
+
+ type="text/css"
+ type="text/plain"
+
+ - setRemoveLinkAttributes(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
+
-
+
- setRemoveMultiSpaces(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- If set to
true
all multiple whitespace characters will be replaced with single spaces.
+ - setRemoveMultiSpaces(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
+
-
+
- setRemoveQuotes(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- If set to
true
all unnecessary quotes will be removed
+ from tag attributes.
+ - setRemoveQuotes(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
+
-
+
- setRemoveScriptAttributes(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- If set to
true
, following attributes will be removed from <script>
tags:
+
+ type="text/javascript"
+ type="application/javascript"
+ language="javascript"
+
+ - setRemoveScriptAttributes(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
+
-
+
- setRemoveStyleAttributes(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- If set to
true
, type="text/style"
attributes will be removed from <style>
tags.
+ - setRemoveStyleAttributes(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
+
-
+
- setRemoveSurroundingSpaces(String) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- Enables surrounding spaces removal around provided comma separated list of tags.
+
- setSimpleBooleanAttributes(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- If set to
true
, any values of following boolean attributes will be removed:
+
+ checked
+ selected
+ disabled
+ readonly
+
+ - setSimpleBooleanAttributes(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
+
-
+
- setSimpleDoctype(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- If set to
true
, existing DOCTYPE declaration will be replaced with simple <!DOCTYPE html>
declaration.
+ - setSimpleDoctype(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
+
-
+
- setTime(long) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressorStatistics
+
-
+
- setWarningLevel(WarningLevel) -
+Method in class com.googlecode.htmlcompressor.compressor.ClosureJavaScriptCompressor
+
- Indicates the amount of information you want from the compiler about possible problems in your code.
+
- setYuiCssLineBreak(int) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- Tells Yahoo YUI Compressor to break lines after the specified number of symbols
+ during CSS compression.
+
- setYuiCssLineBreak(int) -
+Method in class com.googlecode.htmlcompressor.taglib.CssCompressorTag
+
-
+
- setYuiCssLineBreak(int) -
+Method in class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
+
-
+
- setYuiErrorReporter(ErrorReporter) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- Sets
ErrorReporter
that YUI Compressor will use for reporting errors during
+ JavaScript compression.
+ - setYuiJsDisableOptimizations(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- Tells Yahoo YUI Compressor to disable all the built-in micro optimizations
+ during JavaScript compression.
+
- setYuiJsDisableOptimizations(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
+
-
+
- setYuiJsDisableOptimizations(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.JavaScriptCompressorTag
+
-
+
- setYuiJsLineBreak(int) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- Tells Yahoo YUI Compressor to break lines after the specified number of symbols
+ during JavaScript compression.
+
- setYuiJsLineBreak(int) -
+Method in class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
+
-
+
- setYuiJsLineBreak(int) -
+Method in class com.googlecode.htmlcompressor.taglib.JavaScriptCompressorTag
+
-
+
- setYuiJsNoMunge(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- Tells Yahoo YUI Compressor to only minify javascript without obfuscating
+ local symbols.
+
- setYuiJsNoMunge(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
+
-
+
- setYuiJsNoMunge(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.JavaScriptCompressorTag
+
-
+
- setYuiJsPreserveAllSemiColons(boolean) -
+Method in class com.googlecode.htmlcompressor.compressor.HtmlCompressor
+
- Tells Yahoo YUI Compressor to preserve unnecessary semicolons
+ during JavaScript compression.
+
- setYuiJsPreserveAllSemiColons(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag
+
-
+
- setYuiJsPreserveAllSemiColons(boolean) -
+Method in class com.googlecode.htmlcompressor.taglib.JavaScriptCompressorTag
+
-
+
HtmlCompressor
for inline CSS compression.HtmlCompressor
for inline JavaScript compression.ErrorReporter
implementation that uses System.err
+ stream for error reporting.
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+ | +
---|
+ + + diff --git a/doc/overview-summary.html b/doc/overview-summary.html new file mode 100644 index 0000000..41f0c40 --- /dev/null +++ b/doc/overview-summary.html @@ -0,0 +1,171 @@ + + + +
+ +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+Packages | +|
---|---|
com.googlecode.htmlcompressor | ++ |
com.googlecode.htmlcompressor.analyzer | ++ |
com.googlecode.htmlcompressor.compressor | ++ |
com.googlecode.htmlcompressor.taglib | ++ |
com.googlecode.htmlcompressor.velocity | ++ |
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
+Package com.googlecode.htmlcompressor.taglib | +
---|
+Class com.googlecode.htmlcompressor.taglib.CssCompressorTag extends javax.servlet.jsp.tagext.BodyTagSupport implements Serializable | +
---|
+Serialized Fields | +
---|
+boolean enabled+
+int yuiCssLineBreak+
+Class com.googlecode.htmlcompressor.taglib.HtmlCompressorTag extends javax.servlet.jsp.tagext.BodyTagSupport implements Serializable | +
---|
+Serialized Fields | +
---|
+boolean enabled+
+boolean removeComments+
+boolean removeMultiSpaces+
+boolean removeIntertagSpaces+
+boolean removeQuotes+
+boolean preserveLineBreaks+
+boolean simpleDoctype+
+boolean removeScriptAttributes+
+boolean removeStyleAttributes+
+boolean removeLinkAttributes+
+boolean removeFormAttributes+
+boolean removeInputAttributes+
+boolean simpleBooleanAttributes+
+boolean removeJavaScriptProtocol+
+boolean removeHttpProtocol+
+boolean removeHttpsProtocol+
+boolean compressJavaScript+
+boolean compressCss+
+String jsCompressor+
+boolean yuiJsNoMunge+
+boolean yuiJsPreserveAllSemiColons+
+boolean yuiJsDisableOptimizations+
+int yuiJsLineBreak+
+int yuiCssLineBreak+
+String closureOptLevel+
+Class com.googlecode.htmlcompressor.taglib.JavaScriptCompressorTag extends javax.servlet.jsp.tagext.BodyTagSupport implements Serializable | +
---|
+Serialized Fields | +
---|
+boolean enabled+
+String jsCompressor+
+boolean yuiJsNoMunge+
+boolean yuiJsPreserveAllSemiColons+
+boolean yuiJsDisableOptimizations+
+int yuiJsLineBreak+
+String closureOptLevel+
+Class com.googlecode.htmlcompressor.taglib.XmlCompressorTag extends javax.servlet.jsp.tagext.BodyTagSupport implements Serializable | +
---|
+Serialized Fields | +
---|
+boolean enabled+
+boolean removeComments+
+boolean removeIntertagSpaces+
+
+
+
|
++ + | +|||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +
Usage: java -jar htmlcompressor.jar [options] [input]
+ *
To view a list of all available parameters please run with -?
option:
+ *
java -jar htmlcompressor.jar -?
+ *
+ * @author Sergiy Kovalchuk
+ */
+public class CmdLineCompressor {
+
+ private static final Pattern urlPattern = Pattern.compile("^https?://.*$", Pattern.CASE_INSENSITIVE);
+
+ private boolean helpOpt;
+ private boolean analyzeOpt;
+ private String charsetOpt;
+ private String outputFilenameOpt;
+ private String patternsFilenameOpt;
+ private String typeOpt;
+ private String filemaskOpt;
+ private boolean recursiveOpt;
+ private boolean preserveCommentsOpt;
+ private boolean preserveIntertagSpacesOpt;
+ private boolean preserveMultiSpacesOpt;
+ private boolean removeIntertagSpacesOpt;
+ private boolean removeQuotesOpt;
+ private String removeSurroundingSpacesOpt;
+ private boolean preserveLineBreaksOpt;
+ private boolean preservePhpTagsOpt;
+ private boolean preserveServerScriptTagsOpt;
+ private boolean preserveSsiTagsOpt;
+ private boolean compressJsOpt;
+ private boolean compressCssOpt;
+ private String jsCompressorOpt;
+
+ private boolean simpleDoctypeOpt;
+ private boolean removeScriptAttributesOpt;
+ private boolean removeStyleAttributesOpt;
+ private boolean removeLinkAttributesOpt;
+ private boolean removeFormAttributesOpt;
+ private boolean removeInputAttributesOpt;
+ private boolean simpleBooleanAttributesOpt;
+ private boolean removeJavaScriptProtocolOpt;
+ private boolean removeHttpProtocolOpt;
+ private boolean removeHttpsProtocolOpt;
+
+ private boolean nomungeOpt;
+ private int linebreakOpt;
+ private boolean preserveSemiOpt;
+ private boolean disableOptimizationsOpt;
+
+ private String closureOptLevelOpt;
+ private boolean closureCustomExternsOnlyOpt;
+ private List
+
+
\ No newline at end of file
diff --git a/src/test/resources/html/testCompressCssResult.html b/src/test/resources/html/testCompressCssResult.html
new file mode 100644
index 0000000..ae54716
--- /dev/null
+++ b/src/test/resources/html/testCompressCssResult.html
@@ -0,0 +1,6 @@
+
+
+
\ No newline at end of file
diff --git a/src/test/resources/html/testCompressJavaScript.html b/src/test/resources/html/testCompressJavaScript.html
new file mode 100644
index 0000000..9993f1b
--- /dev/null
+++ b/src/test/resources/html/testCompressJavaScript.html
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/test/resources/html/testCompressJavaScriptClosureResult.html b/src/test/resources/html/testCompressJavaScriptClosureResult.html
new file mode 100644
index 0000000..dc889fd
--- /dev/null
+++ b/src/test/resources/html/testCompressJavaScriptClosureResult.html
@@ -0,0 +1,7 @@
+
+
+
\ No newline at end of file
diff --git a/src/test/resources/html/testCompressJavaScriptYuiResult.html b/src/test/resources/html/testCompressJavaScriptYuiResult.html
new file mode 100644
index 0000000..d248f97
--- /dev/null
+++ b/src/test/resources/html/testCompressJavaScriptYuiResult.html
@@ -0,0 +1,7 @@
+
+
+
\ No newline at end of file
diff --git a/src/test/resources/html/testCompressResult.html b/src/test/resources/html/testCompressResult.html
new file mode 100644
index 0000000..d8e5308
--- /dev/null
+++ b/src/test/resources/html/testCompressResult.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/test/resources/html/testEnabled.html b/src/test/resources/html/testEnabled.html
new file mode 100644
index 0000000..703f04e
--- /dev/null
+++ b/src/test/resources/html/testEnabled.html
@@ -0,0 +1 @@
+html html
\ No newline at end of file
diff --git a/src/test/resources/html/testEnabledResult.html b/src/test/resources/html/testEnabledResult.html
new file mode 100644
index 0000000..703f04e
--- /dev/null
+++ b/src/test/resources/html/testEnabledResult.html
@@ -0,0 +1 @@
+html html
\ No newline at end of file
diff --git a/src/test/resources/html/testPreserveLineBreaks.html b/src/test/resources/html/testPreserveLineBreaks.html
new file mode 100644
index 0000000..01a7250
--- /dev/null
+++ b/src/test/resources/html/testPreserveLineBreaks.html
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+ aaa bbb
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/test/resources/html/testRemoveCommentsResult.html b/src/test/resources/html/testRemoveCommentsResult.html
new file mode 100644
index 0000000..3ba4ad1
--- /dev/null
+++ b/src/test/resources/html/testRemoveCommentsResult.html
@@ -0,0 +1,4 @@
+ aaa bbb
\ No newline at end of file
diff --git a/src/test/resources/html/testRemoveFormAttributes.html b/src/test/resources/html/testRemoveFormAttributes.html
new file mode 100644
index 0000000..6c25789
--- /dev/null
+++ b/src/test/resources/html/testRemoveFormAttributes.html
@@ -0,0 +1 @@
+