/** * Perform this function for each {@link WindupVertexFrame} returned by the "when" clause. */ public void perform(GraphRewrite event, EvaluationContext context, PAYLOADTYPE payload) { Document doc = payload.asDocument(); if(doc == null) { LOG.warning("Document is null."); return; } perform(event, context, payload, doc); }
/** * if this is a maven file, checks to see if "version" tags match the discovered text; if the discovered text does match something in a version * tag, it is likely a version, not an IP address * * @param context * @param model * @return */ private boolean isMavenVersionTag(GraphContext context, FileLocationModel model) { if (isMavenFile(context, model)) { Document doc = ((XmlFileModel) model.getFile()).asDocument(); for (Element elm : $(doc).find("version")) { String text = StringUtils.trim($(elm).text()); if (StringUtils.equals(text, model.getSourceSnippit())) { return true; } } } return false; }
/** * if this is a maven file, checks to see if "version" tags match the discovered text; if the discovered text does match something in a version * tag, it is likely a version, not an IP address * * @param context * @param model * @return */ private boolean isMavenVersionTag(GraphContext context, FileLocationModel model) { if (isMavenFile(context, model)) { Document doc = ((XmlFileModel) model.getFile()).asDocument(); for (Element elm : $(doc).find("version")) { String text = StringUtils.trim($(elm).text()); if (StringUtils.equals(text, model.getSourceSnippit())) { return true; } } } return false; }
Source xmlSource = new DOMSource(payload.asDocument()); Result xmlResult = new StreamResult(resultPath.toFile());
Source xmlSource = new DOMSource(payload.asDocument()); Result xmlResult = new StreamResult(resultPath.toFile()); try
Document parsedDocument = file.asDocument();
public MavenProjectModel extractMavenProjectModel(GraphRewrite event, XmlFileModel xmlResourceModel) Document document = xmlResourceModel.asDocument();
if($(payload.asDocument()).find("start-state").isEmpty()) { LOG.warning("Found process-definition, but no start-state."); return; Document doc = payload.asDocument();
if($(payload.asDocument()).find("start-state").isEmpty()) { LOG.warning("Found process-definition, but no start-state."); return; Document doc = payload.asDocument();