public class DefaultHtmlMapper extends Object implements HtmlMapper
Modifier and Type | Field and Description |
---|---|
static HtmlMapper |
INSTANCE |
Constructor and Description |
---|
DefaultHtmlMapper() |
Modifier and Type | Method and Description |
---|---|
boolean |
isDiscardElement(String name)
Checks whether all content within the given HTML element should be
discarded instead of including it in the parse output.
|
String |
mapSafeAttribute(String elementName,
String attributeName)
Normalizes an attribute name.
|
String |
mapSafeElement(String name)
Maps "safe" HTML element names to semantic XHTML equivalents.
|
public static final HtmlMapper INSTANCE
public String mapSafeElement(String name)
HtmlMapper
null
and the element
will be ignored but the content inside it is still processed. See
the HtmlMapper.isDiscardElement(String)
method for a way to discard
the entire contents of an element.mapSafeElement
in interface HtmlMapper
name
- HTML element name (upper case)null
if the element is unsafepublic String mapSafeAttribute(String elementName, String attributeName)
mapSafeAttribute
in interface HtmlMapper
elementName
- HTML element name (lower case)attributeName
- HTML attribute name (lower case)null
if the element is unsafepublic boolean isDiscardElement(String name)
HtmlMapper
isDiscardElement
in interface HtmlMapper
name
- HTML element name (upper case)true
if content inside the named element
should be ignored, false
otherwiseCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.