org.xwiki.xml.internal.html
Class DefaultHTMLCleaner

java.lang.Object
  extended by org.xwiki.xml.internal.html.DefaultHTMLCleaner
All Implemented Interfaces:
Initializable, HTMLCleaner

@Component
@Singleton
public class DefaultHTMLCleaner
extends java.lang.Object
implements HTMLCleaner, Initializable

Default implementation for HTMLCleaner using the

Constructor Summary
DefaultHTMLCleaner()
           
 
Method Summary
 org.w3c.dom.Document clean(java.io.Reader originalHtmlContent)
          Transforms any HTML content into valid XHTML that can be fed to the XHTML Parser for example.
 org.w3c.dom.Document clean(java.io.Reader originalHtmlContent, HTMLCleanerConfiguration configuration)
          Transforms any HTML content into valid XHTML.
 HTMLCleanerConfiguration getDefaultConfiguration()
          Allows getting the default configuration that will be used thus allowing the user to configure it like adding some more filters before or after or even remove some filters to completely control what filters will be executed.
 void initialize()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultHTMLCleaner

public DefaultHTMLCleaner()
Method Detail

initialize

public void initialize()
                throws InitializationException

Specified by:
initialize in interface Initializable
Throws:
InitializationException
See Also:
Initializable.initialize()

clean

public org.w3c.dom.Document clean(java.io.Reader originalHtmlContent)
Transforms any HTML content into valid XHTML that can be fed to the XHTML Parser for example. A default configuration is applied for cleaning the original HTML (see HTMLCleaner.getDefaultConfiguration()).

Specified by:
clean in interface HTMLCleaner
Parameters:
originalHtmlContent - the original content (HTML) to clean
Returns:
the cleaned HTML as a w3c DOM (this allows further transformations if needed)
See Also:
HTMLCleaner.clean(java.io.Reader)

clean

public org.w3c.dom.Document clean(java.io.Reader originalHtmlContent,
                                  HTMLCleanerConfiguration configuration)
Transforms any HTML content into valid XHTML. A specific cleaning configuration can be passed to control the cleaning process.

Specified by:
clean in interface HTMLCleaner
Parameters:
originalHtmlContent - the original HTML content to be cleaned.
configuration - the configuration to use for cleaning the HTML content
Returns:
the cleaned HTML as a w3c DOM
Since:
1.8.1
See Also:
HTMLCleaner.clean(Reader, HTMLCleanerConfiguration)

getDefaultConfiguration

public HTMLCleanerConfiguration getDefaultConfiguration()
Allows getting the default configuration that will be used thus allowing the user to configure it like adding some more filters before or after or even remove some filters to completely control what filters will be executed. This is to be used for very specific use cases. In the majority of cases you should instead use the clean API that doesn't require passing a configuration.

Specified by:
getDefaultConfiguration in interface HTMLCleaner
Returns:
the default configuration that will be used to clean the original HTML
Since:
1.8.1
See Also:
HTMLCleaner.getDefaultConfiguration()


Copyright © 2004-2011 XWiki. All Rights Reserved.