com.cleancode.format
Class SimpleJavadocToPod

java.lang.Object
  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.

Notes:

Since:
CleanCode 0.9
Version:
$Revision: 9 $
Author:
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
SimpleJavadocToPod()
          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

VERSION

public static final String VERSION
Current version of this class.

Constructor Detail

SimpleJavadocToPod

public SimpleJavadocToPod()
Construct a SimpleJavadocToPod object.

Method Detail

convert

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.

Parameters:
content - a String containing the javadoc input
Returns:
a String representing the pod text

main

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

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


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