private static boolean isAttachProjectDirToLibraries(Element rootElement) { Element goProjectSettings = JDomSerializationUtil.findComponent(rootElement, "GoProjectSettings"); if (goProjectSettings != null) { for (Element option : goProjectSettings.getChildren("option")) { if ("prependGoPath".equals(option.getAttributeValue("name"))) { goProjectSettings.detach(); return "true".equalsIgnoreCase(option.getAttributeValue("value")); } } goProjectSettings.detach(); } return false; }
@Override public void process(@NotNull RunManagerSettings settings) throws CannotConvertException { for (Element element : settings.getRunConfigurations()) { String confType = element.getAttributeValue("type"); if ("GaeLocalAppEngineServer".equals(confType) || "GoTestConfiguration".equals(confType)) { element.detach(); } } } }
@Override public void preProcessingFinished() throws CannotConvertException { File oldSettingsFile = getGoBuildFlagsFile(); if (oldSettingsFile.exists()) { Element oldSettingsRoot = JDomConvertingUtil.loadDocument(oldSettingsFile).getRootElement(); Element buildFlagsSettings = JDomSerializationUtil.findComponent(oldSettingsRoot, "GoBuildFlags"); if (buildFlagsSettings != null) { newSettings = XmlSerializer.deserialize(buildFlagsSettings, GoBuildTargetSettings.class); buildFlagsSettings.detach(); //noinspection ResultOfMethodCallIgnored oldSettingsFile.delete(); } } }
public Content detach() { return element.detach(); }
private static org.jdom.Element merge (final org.jdom.Element eWi1, final org.jdom.Element eWi2) { final org.jdom.Element eLastExpressionId1 = eWi1.getChild("last-expression-id"); final org.jdom.Element eLastExpressionId2 = eWi2.getChild("last-expression-id"); eLastExpressionId1.detach(); eLastExpressionId2.detach(); eWi2.addContent(eLastExpressionId1); return eWi2; }
/** * Return the full spec element */ public Element getDefinitionSpec() { Element def = (Element)this.definitionElement.clone(); def.detach(); Element spec = new Element("workflow",XScufl.XScuflNS); spec.addContent(def); return spec; }
private static Element parseFile(File file) throws GNLibException { try{ SAXBuilder builder = new SAXBuilder(); Document doc = builder.build(file); return (Element)doc.getRootElement().detach(); } catch (Exception ex) { LOGGER.warn("Error parsing input file " + file); throw new GNLibException("Error parsing input file " + file, ex); } } }
private static Element parse(String s) throws GNLibException { try{ SAXBuilder builder = new SAXBuilder(); s = s.trim(); Document doc = builder.build(new StringReader(s)); return (Element)doc.getRootElement().detach(); } catch (Exception ex) { LOGGER.warn("Error parsing input string: >>>" + s +"<<<"); throw new GNLibException("Error parsing input string", ex); } } }
private static Element parseFile(File file) throws GNLibException { try{ SAXBuilder builder = new SAXBuilder(); Document doc = builder.build(file); return (Element)doc.getRootElement().detach(); } catch (Exception ex) { LOGGER.warn("Error parsing input file " + file); throw new GNLibException("Error parsing input file " + file, ex); } }
private static Element parseFile(File file) throws GNLibException { try{ SAXBuilder builder = new SAXBuilder(); Document doc = builder.build(file); return (Element)doc.getRootElement().detach(); } catch (Exception ex) { LOGGER.warn("Error parsing input file " + file); throw new GNLibException("Error parsing input file " + file, ex); } }
/** * Constructor. * * @param tag the tag type * @param element element to clone */ public DescriptorElement(DescriptorTag tag, Element element) { this.tag = tag; this.addContent(element.detach()); }
/** * Constructor. * @param tag Web Xml Tag Definition * @param element XML Element */ public WebXmlElement(WebXmlTag tag, Element element) { super(tag, element); this.addContent(element.detach()); }
private static Element parse(String s) throws GNLibException { try{ SAXBuilder builder = new SAXBuilder(); s = s.trim(); Document doc = builder.build(new StringReader(s)); return (Element)doc.getRootElement().detach(); } catch (Exception ex) { LOGGER.warn("Error parsing input string: >>>" + s +"<<<"); throw new GNLibException("Error parsing input string", ex); } } }
/** * Constructor. * * @param tag the tag type * @param element element to clone */ public DescriptorElement(DescriptorTag tag, Element element) { this.tag = tag; this.addContent(element.detach()); }
/** * Constructor. * @param tag Web Xml Tag Definition * @param element XML Element */ public WebXmlElement(WebXmlTag tag, Element element) { super(tag, element); this.addContent(element.detach()); }
/** * Saving an XML element to a file. */ public static void save (final String fileName, final org.jdom.Element elt) throws java.io.IOException { elt.detach(); final org.jdom.Document doc = new org.jdom.Document(elt); save(fileName, doc); }
/** Detach each xml element */ @Override public void processElement(Wrapper<Element> elementWrapper) { Element content = elementWrapper.getContent(); content.detach(); content.removeContent(); }
/** Detach each xml element */ @Override public void processElement(Wrapper<Element> elementWrapper) { Element content = elementWrapper.getContent(); content.detach(); content.removeContent(); }
/** * Turns a detached JDOM element into a byte array (makes sure it comes back * detached afterwards). */ public static byte[] toByteArray (final org.jdom.Element elt) throws OpenWfeException { final byte[] result = toByteArray(new org.jdom.Document(elt)); elt.detach(); return result; }
private static GeoCoding createGeoCodingFromElement(Product product, Element element) { final Content content = element.detach(); final GeoCoding[] geoCodings = createGeoCoding(new Document().addContent(content), product); if (geoCodings == null) { return null; } return geoCodings[0]; }