|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xml.sax.helpers.XMLFilterImpl
org.xwiki.rendering.wikimodel.xhtml.filter.DefaultXMLFilter
org.xwiki.rendering.wikimodel.xhtml.filter.XHTMLWhitespaceXMLFilter
public class XHTMLWhitespaceXMLFilter
Removes non-semantic whitespaces in XML elements. See http://www.w3.org/TR/html4/struct/text.html#h-9.1 for more details. Possible use cases:
text(sp)(sp)text becomes
text(sp)text
| Field Summary |
|---|
| Fields inherited from class org.xwiki.rendering.wikimodel.xhtml.filter.DefaultXMLFilter |
|---|
SAX_LEXICAL_HANDLER_PROPERTY |
| Constructor Summary | |
|---|---|
XHTMLWhitespaceXMLFilter()
|
|
XHTMLWhitespaceXMLFilter(XMLReader reader)
|
|
| Method Summary | |
|---|---|
protected void |
appendInlineEvent(org.xwiki.rendering.wikimodel.xhtml.filter.XHTMLWhitespaceXMLFilter.Event event)
Append an inline element. |
void |
characters(char[] ch,
int start,
int length)
|
protected void |
cleanContentExtraWhiteSpaces()
UC3: Replace group of white spaces by a single space. |
void |
comment(char[] ch,
int start,
int length)
|
void |
endCDATA()
|
void |
endDocument()
|
void |
endElement(String uri,
String localName,
String qName)
|
protected void |
endEmptyVisibleElement()
|
protected void |
endNonVisibleElement()
Flush previous content and print current one. |
protected void |
flushContent()
Flush previous content and print current one. |
protected void |
flushContent(boolean trimTrailing)
Flush previous content and print current one. |
protected StringBuffer |
getContent()
|
protected boolean |
isSemanticComment(String comment)
We remove spaces around non semantic comments. |
protected void |
sendCharacters(char[] ch)
|
protected void |
sendCharacters(char[] ch,
int start,
int length)
|
protected void |
sendInlineEvent(org.xwiki.rendering.wikimodel.xhtml.filter.XHTMLWhitespaceXMLFilter.Event event)
|
protected void |
sendPreviousContent(boolean trimTrailing)
|
protected boolean |
shouldRemoveWhiteSpaces()
|
void |
startCDATA()
|
void |
startElement(String uri,
String localName,
String qName,
Attributes atts)
|
protected void |
startEmptyVisibleElement()
|
protected void |
startNonVisibleElement()
Append an non visible element. |
protected void |
trimLeadingWhiteSpaces()
|
protected String |
trimLeadingWhiteSpaces(CharSequence content)
|
protected void |
trimTrailingWhiteSpaces()
|
protected String |
trimTrailingWhiteSpaces(CharSequence content)
|
| Methods inherited from class org.xwiki.rendering.wikimodel.xhtml.filter.DefaultXMLFilter |
|---|
endDTD, endEntity, getProperty, parse, setProperty, startDTD, startEntity |
| Methods inherited from class org.xml.sax.helpers.XMLFilterImpl |
|---|
endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, ignorableWhitespace, notationDecl, parse, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XHTMLWhitespaceXMLFilter()
public XHTMLWhitespaceXMLFilter(XMLReader reader)
| Method Detail |
|---|
public void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface ContentHandlercharacters in class org.xml.sax.helpers.XMLFilterImplSAXException
public void startElement(String uri,
String localName,
String qName,
Attributes atts)
throws SAXException
startElement in interface ContentHandlerstartElement in class org.xml.sax.helpers.XMLFilterImplSAXException
public void endElement(String uri,
String localName,
String qName)
throws SAXException
endElement in interface ContentHandlerendElement in class org.xml.sax.helpers.XMLFilterImplSAXException
public void startCDATA()
throws SAXException
startCDATA in interface LexicalHandlerstartCDATA in class DefaultXMLFilterSAXException
public void endCDATA()
throws SAXException
endCDATA in interface LexicalHandlerendCDATA in class DefaultXMLFilterSAXException
public void comment(char[] ch,
int start,
int length)
throws SAXException
comment in interface LexicalHandlercomment in class DefaultXMLFilterSAXException
public void endDocument()
throws SAXException
endDocument in interface ContentHandlerendDocument in class org.xml.sax.helpers.XMLFilterImplSAXExceptionprotected boolean shouldRemoveWhiteSpaces()
protected void sendPreviousContent(boolean trimTrailing)
throws SAXException
SAXException
protected void sendInlineEvent(org.xwiki.rendering.wikimodel.xhtml.filter.XHTMLWhitespaceXMLFilter.Event event)
throws SAXException
SAXException
protected void flushContent()
throws SAXException
SAXException
protected void flushContent(boolean trimTrailing)
throws SAXException
SAXException
protected void appendInlineEvent(org.xwiki.rendering.wikimodel.xhtml.filter.XHTMLWhitespaceXMLFilter.Event event)
throws SAXException
SAXException
protected void startEmptyVisibleElement()
throws SAXException
SAXException
protected void endEmptyVisibleElement()
throws SAXException
SAXException
protected void startNonVisibleElement()
throws SAXException
SAXException
protected void endNonVisibleElement()
throws SAXException
SAXException
protected void sendCharacters(char[] ch)
throws SAXException
SAXException
protected void sendCharacters(char[] ch,
int start,
int length)
throws SAXException
SAXExceptionprotected void cleanContentExtraWhiteSpaces()
protected void trimLeadingWhiteSpaces()
protected String trimLeadingWhiteSpaces(CharSequence content)
protected void trimTrailingWhiteSpaces()
protected String trimTrailingWhiteSpaces(CharSequence content)
protected StringBuffer getContent()
protected boolean isSemanticComment(String comment)
comment - the comment to evaluate
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||