Coverage Report - org.naftulin.configmgr.content.PropertyRecordImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
PropertyRecordImpl
100%
10/10
N/A
1
 
 1  
 package org.naftulin.configmgr.content;
 2  
 
 3  
 import org.naftulin.configmgr.parsers.ConfigEntryParser;
 4  
 import org.naftulin.configmgr.parsers.PropertyFileParserImpl;
 5  
 import org.apache.commons.lang.builder.ToStringBuilder;
 6  
 
 7  
 
 8  5
 public class PropertyRecordImpl extends AbstractRecordImpl {
 9  5
         private static final ConfigEntryParser PARSER = new PropertyFileParserImpl();
 10  
 
 11  
         /**
 12  
          * Constructs a record without specifying the key or file name.
 13  
          */
 14  
         public PropertyRecordImpl() {
 15  90
                 super();
 16  90
         }
 17  
 
 18  
         /**
 19  
          * Constructs a record with the key and file name specified.
 20  
          * @param key the key associated with the record.
 21  
          * @param fileName the file name associated with the record.
 22  
          */
 23  
         public PropertyRecordImpl(final String key, final String fileName) {
 24  10
                 super(key, fileName);
 25  10
         }
 26  
 
 27  
         /**
 28  
          * Returns an instance of  {@link org.naftulin.configmgr.parsers.PropertyFileParserImpl parser} 
 29  
          * that parses a property file and stores it as {@link java.util.Properties properties}.
 30  
          * @return the parser that can parse the file to extract the configuration.
 31  
          */
 32  
         public ConfigEntryParser getParser() {
 33  195
                 return PARSER;
 34  
         }
 35  
 
 36  
         /**
 37  
          * Returns the string representation of the property record.
 38  
          * @return the string representation of the property record.
 39  
          */
 40  
         public String toString() {
 41  315
                 return new ToStringBuilder(this).append("key", this.getKey()).append(
 42  315
                                 "fileName", this.getFileName()).append("parser",
 43  210
                                 this.getParser()).toString();
 44  
         }
 45  
         
 46  
         
 47  
 }