Package com.overzealous.remark.convert
Class AbstractNodeHandler
- java.lang.Object
-
- com.overzealous.remark.convert.AbstractNodeHandler
-
- All Implemented Interfaces:
NodeHandler
- Direct Known Subclasses:
Abbr,Anchor,BlockQuote,Break,Codeblock,DefaultNodeHandler,Definitions,Header,HorizontalRule,Image,InlineCode,InlineStyle,List,Paragraph,Table
public abstract class AbstractNodeHandler extends Object implements NodeHandler
Contains basic implementations for handling text nodes and ignored HTML elements.- Author:
- Phil DeJarnett
-
-
Constructor Summary
Constructors Constructor Description AbstractNodeHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhandleIgnoredHTMLElement(org.jsoup.nodes.Element node, DocumentConverter converter)Handle an ignored HTMLElement.voidhandleTextNode(org.jsoup.nodes.TextNode node, DocumentConverter converter)Handle a child text node.protected voidprependAndRecurse(String prepend, org.jsoup.nodes.Element node, DocumentConverter converter, Map<String,NodeHandler> nodes)Recursively processes child nodes, and prepends the given string to the output.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.overzealous.remark.convert.NodeHandler
handleNode
-
-
-
-
Method Detail
-
handleTextNode
public void handleTextNode(org.jsoup.nodes.TextNode node, DocumentConverter converter)Handle a child text node. The default method, implemented here, is to simply write the cleaned text directly.- Specified by:
handleTextNodein interfaceNodeHandler- Parameters:
node- Node to handleconverter- Parent converter for this object.
-
handleIgnoredHTMLElement
public void handleIgnoredHTMLElement(org.jsoup.nodes.Element node, DocumentConverter converter)Handle an ignored HTMLElement. The default method here is to either write the HTMLElement as a block if it is a block element, or write it directly if it is not.- Specified by:
handleIgnoredHTMLElementin interfaceNodeHandler- Parameters:
node- Node to handleconverter- Parent converter for this object.
-
prependAndRecurse
protected void prependAndRecurse(String prepend, org.jsoup.nodes.Element node, DocumentConverter converter, Map<String,NodeHandler> nodes)
Recursively processes child nodes, and prepends the given string to the output.- Parameters:
prepend- String to prependnode- Starting Nodeconverter- Parent document converternodes- Map of valid nodes
-
-