public ModuleNodeFactory(InputStream in) throws IOException {
this();
final ConfigDescriptionModel model = new ConfigDescriptionModel();
try
{
model.load(in);
}
catch (SAXException saxException)
{
final String error = ModuleNodeFactory.messages.getErrorString("ModuleNodeFactory.ERROR_0001_PARSE_FAILURE", saxException.getMessage()); //$NON-NLS-1$
ModuleNodeFactory.logger.error(error, saxException);
throw new IOException(error);
}
catch (ParserConfigurationException pE)
{
final String error = ModuleNodeFactory.messages.getErrorString("ModuleNodeFactory.ERROR_0002_PARSER_CONFIG_ERROR", pE.getMessage()); //$NON-NLS-1$
ModuleNodeFactory.logger.error(error, pE);
throw new IOException(error);
}
final ConfigDescriptionEntry[] entries = model.toArray();
for (int i = 0; i < entries.length; i++)
{
//Log.debug ("Entry: " + entries[i].getKeyName() + " registered");
configEntryLookup.put(entries[i].getKeyName(), entries[i]);
}
}
Creates a new module node factory and initializes the factory from the given input
stream. The stream will be used to build a ConfigDescription model and should contain
suitable XML content. Parameters:
in - the input stream from where to read the model content.
Throws:
IOException - if an error occured while reading the stream.
|