Element () { final Element e = new Element("injection"); e.setAttribute("language", myInjectedLanguageId); e.setAttribute("injector-id", mySupportId); e.addContent(withValueOrContent("display-name", getDisplayName())); if (StringUtil.isNotEmpty(myPrefix)) { e.addContent(withValueOrContent("prefix", myPrefix)); } if (StringUtil.isNotEmpty(mySuffix)) { e.addContent(withValueOrContent("suffix", mySuffix)); } if (StringUtil.isNotEmpty(myValuePattern)) { e.addContent(withValueOrContent("value-pattern", myValuePattern)); } if (StringUtil.isNotEmpty(myIgnorePattern)) { e.addContent(withValueOrContent("ignore-pattern", myIgnorePattern)); } e.addContent(new Element("single-file").setAttribute("value", mySingleFile ? "true" : "false")); Arrays.sort(myPlaces, (o1, o2) -> Comparing.compare(o1.getText(), o2.getText())); for (InjectionPlace place : myPlaces) { final Element child = new Element("place").setContent(new CDATA(place.getText())); if (!place.isEnabled()) child.setAttribute("disabled", "true"); e.addContent(child); } writeExternalImpl(e); return e; }