Clover Coverage Report - Pebble 2.5-SNAPSHOT
Coverage timestamp: Sat Jun 12 2010 09:39:29 EST
../../../../img/srcFileCovDistChart6.png 36% of files have more coverage
9   41   2   4,5
0   20   0,22   2
2     1  
1    
This report was generated with an evaluation server license. Purchase Clover or configure your license.
 
  HtmlDecorator       Line # 13 9 0% 2 5 54,5% 0.54545456
 
  (16)
 
1    package net.sourceforge.pebble.decorator;
2   
3    import net.sourceforge.pebble.api.decorator.ContentDecoratorContext;
4    import net.sourceforge.pebble.domain.Comment;
5    import net.sourceforge.pebble.domain.TrackBack;
6    import net.sourceforge.pebble.util.StringUtils;
7   
8    /**
9    * Decorates blog entries and comments by rendering them as HTML.
10    *
11    * @author Simon Brown
12    */
 
13    public class HtmlDecorator extends ContentDecoratorSupport {
14   
15    /**
16    * Decorates the specified comment.
17    *
18    * @param context the context in which the decoration is running
19    * @param comment the comment to be decorated
20    */
 
21  16 toggle public void decorate(ContentDecoratorContext context, Comment comment) {
22  16 comment.setAuthor(StringUtils.filterHTML(comment.getAuthor()));
23  16 comment.setWebsite(StringUtils.filterHTML(comment.getWebsite()));
24  16 comment.setEmail(StringUtils.filterHTML(comment.getEmail()));
25  16 comment.setTitle(StringUtils.filterHTML(comment.getTitle()));
26  16 comment.setBody(StringUtils.transformToHTMLSubset(StringUtils.transformHTML(comment.getBody())));
27    }
28   
29    /**
30    * Decorates the specified TrackBack.
31    *
32    * @param context the context in which the decoration is running
33    * @param trackBack the TrackBack to be decorated
34    */
 
35  0 toggle public void decorate(ContentDecoratorContext context, TrackBack trackBack) {
36  0 trackBack.setBlogName(StringUtils.filterHTML(trackBack.getBlogName()));
37  0 trackBack.setUrl(StringUtils.filterHTML(trackBack.getUrl()));
38  0 trackBack.setTitle(StringUtils.filterHTML(trackBack.getTitle()));
39  0 trackBack.setExcerpt(StringUtils.transformToHTMLSubset(StringUtils.transformHTML(trackBack.getExcerpt())));
40    }
41    }