org.naftulin.configmgr.parsers
Class MasterRecordParser

java.lang.Object
  extended by org.naftulin.configmgr.parsers.AbstractConfigEntryParser
      extended by org.naftulin.configmgr.parsers.MasterRecordParser
All Implemented Interfaces:
ConfigEntryParser

public class MasterRecordParser
extends AbstractConfigEntryParser

Parses master configuration file to create a configuration entry.

Version:
1.0
Author:
Henry Naftulin

Constructor Summary
MasterRecordParser()
           
 
Method Summary
 MasterRecordImpl digestMasterRecord(java.lang.String fileName)
          Returns master record based on the configuration file passed in.
 ConfigurationManagementEntry getConfigurationManagementEntry(java.lang.String key, java.net.URL fileUrl)
          Retrurns a configuration managment entry by reading the master record file passed in, and storing it's content.
 org.apache.commons.digester.Digester getDigester()
           
 java.lang.String toString()
          Returns a string representation of this parser.
 
Methods inherited from class org.naftulin.configmgr.parsers.AbstractConfigEntryParser
readStreamContentAsString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MasterRecordParser

public MasterRecordParser()
Method Detail

getConfigurationManagementEntry

public ConfigurationManagementEntry getConfigurationManagementEntry(java.lang.String key,
                                                                    java.net.URL fileUrl)
                                                             throws ConfigurationManagerException
Retrurns a configuration managment entry by reading the master record file passed in, and storing it's content.

Parameters:
key - the key configuration entry will be assigned
fileUrl - the file URL to be parsed.
Returns:
a configuration managment with content of master configuration file.
Throws:
ConfigurationManagerException - if an error occurs while parsing an entry.

toString

public java.lang.String toString()
Returns a string representation of this parser.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this parser.

digestMasterRecord

public MasterRecordImpl digestMasterRecord(java.lang.String fileName)
                                    throws ConfigurationManagerException
Returns master record based on the configuration file passed in. Parses the passed in file based on the digester rules defined in MASTER_RECORD_RULES_XML and uses commons digester to create master record object based on it.

Parameters:
fileName - xml file that describe the configuration.
Returns:
master record.
Throws:
ConfigurationManagerException - if a master record cannot be parsed.

getDigester

public org.apache.commons.digester.Digester getDigester()
                                                 throws ConfigurationManagerException
Throws:
ConfigurationManagerException


Copyright © 2009. All Rights Reserved.