Coverage Report - com.ctrip.framework.apollo.internals.XmlConfigFile
 
Classes in this File Line Coverage Branch Coverage Complexity
XmlConfigFile
100%
9/9
100%
4/4
2
 
 1  
 package com.ctrip.framework.apollo.internals;
 2  
 
 3  
 import com.ctrip.framework.apollo.core.ConfigConsts;
 4  
 import com.ctrip.framework.apollo.core.enums.ConfigFileFormat;
 5  
 
 6  
 /**
 7  
  * @author Jason Song(song_s@ctrip.com)
 8  
  */
 9  
 public class XmlConfigFile extends AbstractConfigFile {
 10  
   public XmlConfigFile(String namespace,
 11  
                        ConfigRepository configRepository) {
 12  6
     super(namespace, configRepository);
 13  6
   }
 14  
 
 15  
   @Override
 16  
   public String getContent() {
 17  7
     if (m_configProperties.get() == null) {
 18  3
       return null;
 19  
     }
 20  4
     return m_configProperties.get().getProperty(ConfigConsts.CONFIG_FILE_CONTENT_KEY);
 21  
   }
 22  
 
 23  
   @Override
 24  
   public boolean hasContent() {
 25  5
     if (m_configProperties.get() == null) {
 26  3
       return false;
 27  
     }
 28  2
     return m_configProperties.get().containsKey(ConfigConsts.CONFIG_FILE_CONTENT_KEY);
 29  
 
 30  
   }
 31  
 
 32  
   @Override
 33  
   public ConfigFileFormat getConfigFileFormat() {
 34  1
     return ConfigFileFormat.XML;
 35  
   }
 36  
 }