}
else {
// resource exists => parse it
// Store all pc classes specified in this resource in this
// JDOModel instance => pass this to the handler
JDOHandler handler = new JDOHandlerImpl(this);
JDOParser parser = new JDOParser(handler);
try {
if (debug)
xmlLogger.debug(" XML " + resource + //NOI18N
" found, start parsing ..."); //NOI18N
parser.parse(new InputSource(new InputStreamReader(stream)));
}
catch (SAXException ex) {
throw new ModelFatalException(
msg.msg("EXC_XMLError", resource), ex); //NOI18N
}
catch (ParserConfigurationException ex) {
throw new ModelFatalException(
msg.msg("EXC_XMLError", resource), ex); //NOI18N
}
catch (IOException ex) {
throw new ModelFatalException(
msg.msg("EXC_XMLError", resource), ex); //NOI18N
}
finally {
try { stream.close(); }
catch (IOException ex) {
// ignore close exception, stream will be nullified anyway
}
}
stream = null;
// post process loaded JDOClasses
Collection newJDOClasses = handler.handledJDOClasses();
if (debug)
xmlLogger.debug(" XML " + resource + //NOI18N
" has JDO metadata for class(es) " + //NOI18N
newJDOClasses);
for (Iterator i = newJDOClasses.iterator(); i.hasNext();) {