com.overzealous.remark.convert
Class AbstractNodeHandler

java.lang.Object
  extended by 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
AbstractNodeHandler()
           
 
Method Summary
 void handleIgnoredHTMLElement(Element node, DocumentConverter converter)
          Handle an ignored HTMLElement.
 void handleTextNode(TextNode node, DocumentConverter converter)
          Handle a child text node.
protected  void prependAndRecurse(String prepend, 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
 

Constructor Detail

AbstractNodeHandler

public AbstractNodeHandler()
Method Detail

handleTextNode

public void handleTextNode(TextNode node,
                           DocumentConverter converter)
Handle a child text node. The default method, implemented here, is to simply write the cleaned text directly.

Specified by:
handleTextNode in interface NodeHandler
Parameters:
node - Node to handle
converter - Parent converter for this object.

handleIgnoredHTMLElement

public void handleIgnoredHTMLElement(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:
handleIgnoredHTMLElement in interface NodeHandler
Parameters:
node - Node to handle
converter - Parent converter for this object.

prependAndRecurse

protected void prependAndRecurse(String prepend,
                                 Element node,
                                 DocumentConverter converter,
                                 Map<String,NodeHandler> nodes)
Recursively processes child nodes, and prepends the given string to the output.

Parameters:
prepend - String to prepend
node - Starting Node
converter - Parent document converter
nodes - Map of valid nodes


© 2011 OverZealous Creations, LLC - BitBucket Repository