Class SimpleJavadocToPod

  extended by com.cleancode.format.SimpleJavadocToPod

public class SimpleJavadocToPod
extends Object

Converts Javadoc comments in a Java file to pod comments. After running this filter, copy each pod section into the appropriate spot in your Perl file. You should need only minor cleanup.


CleanCode 0.9
$Revision: 9 $
Michael Sorens

Nested Class Summary
static class SimpleJavadocToPod.Test
          A standalone test class.
Field Summary
static String VERSION
          Current version of this class.
Constructor Summary
          Construct a SimpleJavadocToPod object.
Method Summary
 String convert(String content)
          Convert javadoc text to pod text.
static void main(String[] args)
          Main program for standalone mode.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


public static final String VERSION
Current version of this class.

Constructor Detail


public SimpleJavadocToPod()
Construct a SimpleJavadocToPod object.

Method Detail


public String convert(String content)
Convert javadoc text to pod text. A series of regular expression substitutions is performed on the input to do the conversion. This involves simply feeding a list of regular expressions to an REConverter object. The only special handling required is for tables. We actually want two copies of each table in the output, one in a =begin text ... =end bracket and one in a =begin html ... =end bracket. This is achieved by copying all tables, doing the javadoc to pod conversion (which creates the text version of the tables), restoring the html tables where we've left markers, and doing any final conversions of the entire text.

content - a String containing the javadoc input
a String representing the pod text


public static void main(String[] args)
                 throws IOException
Main program for standalone mode. Converts the specified file to text and prints the results to stdout.

Usage: SimpleJavadocToPod filename

args - filename to convert
IOException - if any problem reading file.

CleanCode Java Libraries Copyright © 2001-2012 Michael Sorens - Revised 2012.12.10 Get CleanCode at Fast, secure and Free Open Source software downloads