Clover Coverage Report - Pebble 2.5-SNAPSHOT
Coverage timestamp: Sat Jun 12 2010 09:39:29 EST
../../../../img/srcFileCovDistChart0.png 48% of files have more coverage
12   38   6   6
6   28   0,5   2
2     3  
1    
This report was generated with an evaluation server license. Purchase Clover or configure your license.
 
  PlainTextPluginConfigType       Line # 11 12 0% 6 20 0% 0.0
 
No Tests
 
1    package net.sourceforge.pebble.plugins;
2   
3    import org.apache.commons.lang.StringEscapeUtils;
4   
5    import javax.servlet.jsp.JspWriter;
6    import java.io.IOException;
7   
8    /**
9    * @author James Roper
10    */
 
11    public class PlainTextPluginConfigType implements PluginConfigType {
12   
13    public static final PlainTextPluginConfigType INSTANCE = new PlainTextPluginConfigType();
14   
 
15  0 toggle public void render(JspWriter writer, PluginConfig pluginConfig, String value) throws IOException {
16  0 writer.print("<input type=\"text\" name=\"");
17  0 writer.print(PLUGIN_PROPERTY_NAME_PREFIX);
18  0 writer.print(pluginConfig.getKey());
19  0 writer.print("\" value=\"");
20  0 if (value != null) {
21  0 writer.print(StringEscapeUtils.escapeHtml(value));
22    }
23  0 writer.print("\"/>");
24    }
25   
 
26  0 toggle public String validate(PluginConfig pluginConfig, String value) {
27  0 String regex = pluginConfig.getProperties().getProperty("regex");
28  0 if (regex != null && value != null)
29    {
30  0 if (!value.matches(regex))
31    {
32  0 return "Property " + pluginConfig.getName() + " must match regular expression " + regex;
33    }
34    }
35    // Success
36  0 return null;
37    }
38    }