private StringBuilder extractJavaDoc ( final String source ) { int docStart = source . indexOf ( "/**" ) ; int docEnd = source . indexOf ( "*/" , docStart ) ; int classStart = source . indexOf ( "public class" ) ; int author = source . indexOf ( "@author" ) ; int since = source . indexOf ( "@since" ) ; if ( classStart == - 1 ) { classStart = docEnd ; } if ( docEnd == - 1 || classStart < docStart ) { return new StringBuilder ( "No JavaDoc provided" ) ; } if ( author != - 1 && author < docEnd ) { docEnd = author ; } if ( since != - 1 && since < docEnd ) { docEnd = since ; } return new StringBuilder ( source . substring ( docStart + 3 , docEnd ) . trim ( ) ) ; }
extracts the javadoc . It assumes that the java doc for the class is the first javadoc in the file .