|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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 compressionpublic boolean isRemoveComments()
true
if all XML comments will be removed.
true
if all XML comments will be removedpublic void setRemoveComments(boolean removeComments)
true
all XML comments will be removed.
Default is true
.
removeComments
- set true
to remove all XML commentspublic 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 |