/** * Loads and parses the provided XML file. This will quietly fail (not throwing an {@link Exception}) and return * null if it is unable to parse the provided {@link XmlFileModel}. A {@link ClassificationModel} will be created to * indicate that this file failed to parse. * * @return Returns either the parsed {@link Document} or null if the {@link Document} could not be parsed */ public Document loadDocumentQuiet(GraphRewrite event, EvaluationContext context, XmlFileModel model) { try { return loadDocument(event, context, model); } catch(Exception ex) { return null; } }
public void perform(GraphRewrite event, EvaluationContext context, NamespaceMetaModel payload) { for (XmlFileModel xml : payload.getXmlResources()) { if (!StringUtils.equals(xml.getRootTagName(), "persistence")) continue; try { Document doc = new XmlFileService(event.getGraphContext()).loadDocument(event, context, xml); extractMetadata(event.getGraphContext(), xml, doc); } catch (Exception ex) { xml.setParseError("Failed to parse JPA configuration: " + ex.getMessage()); } } }
public void perform(GraphRewrite event, EvaluationContext context, NamespaceMetaModel payload) { for (XmlFileModel xml : payload.getXmlResources()) { if (!StringUtils.equals(xml.getRootTagName(), "persistence")) continue; try { Document doc = new XmlFileService(event.getGraphContext()).loadDocument(event, context, xml); extractMetadata(event.getGraphContext(), xml, doc); } catch (Exception ex) { xml.setParseError("Failed to parse JPA configuration: " + ex.getMessage()); } } }
try document = new XmlFileService(event.getGraphContext()).loadDocument(event, context, xmlFileModel);
try document = new XmlFileService(event.getGraphContext()).loadDocument(event, context, xmlFileModel);