public String format ( Comment comment ) { if ( comment == null ) { return "" ; } StringBuilder sb = new StringBuilder ( ) ; for ( CommentElement e : comment ) { if ( e instanceof CommentText ) { sb . append ( renderText ( ( CommentText ) e ) ) ; } else if ( e instanceof InlineLink ) { sb . append ( renderLink ( ( InlineLink ) e ) ) ; } else if ( e instanceof InlineValue ) { sb . append ( renderValue ( ( InlineValue ) e ) ) ; } else if ( e instanceof InlineTag ) { sb . append ( renderTag ( ( InlineTag ) e ) ) ; } else { sb . append ( renderUnrecognized ( e ) ) ; } } return sb . toString ( ) ; }
Render the comment as an HTML String .