org.jibx.schema.generator
Class DocumentFormatter

java.lang.Object
  extended by org.jibx.schema.generator.DocumentFormatter
All Implemented Interfaces:
IDocumentFormatter

public class DocumentFormatter
extends java.lang.Object
implements IDocumentFormatter

Formatter for JavaDoc conversion to XML documentation components.


Field Summary
private  org.w3c.dom.Document m_document
          Document used for constructing DOM components.
 
Fields inherited from interface org.jibx.custom.classes.IDocumentFormatter
DEFAULT_IMPLEMENTATION
 
Constructor Summary
DocumentFormatter()
          Constructor.
 
Method Summary
 java.util.List docToNodes(java.lang.String jdoc)
          Convert JavaDoc text to a list of formatted nodes.
 java.util.List getClassDocumentation(IClass info)
          Get formatted documentation from class, in the form of a list of org.w3c.dom.Node instances.
 java.util.List getItemDocumentation(IClassItem info)
          Get formatted documentation from class item, in the form of a list of org.w3c.dom.Node instances.
protected  org.w3c.dom.Node reformDocSegment(java.lang.String jdoc)
          Reformat a segment of JavaDoc text as either a CDATA section (if it contains embedded HTML tags) or a simple text node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_document

private final org.w3c.dom.Document m_document
Document used for constructing DOM components.

Constructor Detail

DocumentFormatter

public DocumentFormatter()
Constructor.

Method Detail

reformDocSegment

protected org.w3c.dom.Node reformDocSegment(java.lang.String jdoc)
Reformat a segment of JavaDoc text as either a CDATA section (if it contains embedded HTML tags) or a simple text node. This also replaces line breaks with single spaces, so that the output format will not use indenting based on the original supplied text.

Parameters:
jdoc - raw JavaDoc text
Returns:
formatted text

docToNodes

public java.util.List docToNodes(java.lang.String jdoc)
Convert JavaDoc text to a list of formatted nodes.

Specified by:
docToNodes in interface IDocumentFormatter
Parameters:
jdoc - JavaDoc text (may be null)
Returns:
formatted representation (may be null)

getClassDocumentation

public java.util.List getClassDocumentation(IClass info)
Get formatted documentation from class, in the form of a list of org.w3c.dom.Node instances.

Specified by:
getClassDocumentation in interface IDocumentFormatter
Parameters:
info - class information
Returns:
formatted documentation (null if none)

getItemDocumentation

public java.util.List getItemDocumentation(IClassItem info)
Get formatted documentation from class item, in the form of a list of org.w3c.dom.Node instances.

Specified by:
getItemDocumentation in interface IDocumentFormatter
Parameters:
info - item information
Returns:
formatted documentation (null if none)


Project Web Site