org.naftulin.configmgr.parsers
Class MasterRecordParser
java.lang.Object
org.naftulin.configmgr.parsers.AbstractConfigEntryParser
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
MasterRecordParser
public MasterRecordParser()
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 assignedfileUrl
- 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.