org.xwiki.xml.internal.html
Class DefaultHTMLCleaner
java.lang.Object
org.xwiki.xml.internal.html.DefaultHTMLCleaner
- All Implemented Interfaces:
- Initializable, HTMLCleaner
@Component
@Singleton
public class DefaultHTMLCleaner
- extends Object
- implements HTMLCleaner, Initializable
Default implementation for HTMLCleaner using the
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultHTMLCleaner
public DefaultHTMLCleaner()
initialize
public void initialize()
throws InitializationException
-
- Specified by:
initialize in interface Initializable
- Throws:
InitializationException- See Also:
Initializable.initialize()
clean
public Document clean(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 Document clean(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.