Package org.apache.tika.parser.html
Class DefaultHtmlMapper
- java.lang.Object
- 
- org.apache.tika.parser.html.DefaultHtmlMapper
 
- 
- All Implemented Interfaces:
- HtmlMapper
 
 public class DefaultHtmlMapper extends Object implements HtmlMapper The default HTML mapping rules in Tika.- Since:
- Apache Tika 0.6
 
- 
- 
Field SummaryFields Modifier and Type Field Description static HtmlMapperINSTANCE
 - 
Constructor SummaryConstructors Constructor Description DefaultHtmlMapper()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisDiscardElement(String name)Checks whether all content within the given HTML element should be discarded instead of including it in the parse output.StringmapSafeAttribute(String elementName, String attributeName)Normalizes an attribute name.StringmapSafeElement(String name)Maps "safe" HTML element names to semantic XHTML equivalents.
 
- 
- 
- 
Field Detail- 
INSTANCEpublic static final HtmlMapper INSTANCE - Since:
- Apache Tika 0.8
 
 
- 
 - 
Method Detail- 
mapSafeElementpublic String mapSafeElement(String name) Description copied from interface:HtmlMapperMaps "safe" HTML element names to semantic XHTML equivalents. If the given element is unknown or deemed unsafe for inclusion in the parse output, then this method returnsnulland the element will be ignored but the content inside it is still processed. See theHtmlMapper.isDiscardElement(String)method for a way to discard the entire contents of an element.- Specified by:
- mapSafeElementin interface- HtmlMapper
- Parameters:
- name- HTML element name (upper case)
- Returns:
- XHTML element name (lower case), or
 nullif the element is unsafe
 
 - 
mapSafeAttributepublic String mapSafeAttribute(String elementName, String attributeName) Normalizes an attribute name. Assumes that the element name is valid and normalized- Specified by:
- mapSafeAttributein interface- HtmlMapper
- Parameters:
- elementName- HTML element name (lower case)
- attributeName- HTML attribute name (lower case)
- Returns:
- XHTML attribute name (lower case), or
 nullif the element is unsafe
 
 - 
isDiscardElementpublic boolean isDiscardElement(String name) Description copied from interface:HtmlMapperChecks whether all content within the given HTML element should be discarded instead of including it in the parse output.- Specified by:
- isDiscardElementin interface- HtmlMapper
- Parameters:
- name- HTML element name (upper case)
- Returns:
- trueif content inside the named element should be ignored,- falseotherwise
 
 
- 
 
-