private Branch top() { return (Branch)getCurrent(); } }
protected Object createNode(final String name) { final Element element = documentFactory.createElement(encodeNode(name)); final Branch top = top(); if (top != null) { top().add(element); } return element; }
public void addAttribute(final String key, final String value) { ((Element)top()).addAttribute(encodeAttribute(key), value); }
public void setValue(final String text) { top().setText(text); }
protected Object createNode(final String name) { final Element element = documentFactory.createElement(escapeXmlName(name)); final Branch top = top(); if (top != null) { top().add(element); } return element; }
public static Document writeToDom4JDoc(Object obj) { // dom4JDriver produces a Dom4JXmlWriter, which cannot write mixedContent. // dom4jDriver.setOutputFormat(dom4jOutputFormat); XStream xstream = new XStream(); Document targetDoc = DocumentHelper.createDocument(); //BehaviorDataLoader.initBehaviorXStream(xstream); Dom4JWriter d4jWriter = new Dom4JWriter(targetDoc); xstream.marshal(obj, d4jWriter); return targetDoc; } public static OutputFormat getPrettyDom4jOutputFormat() {
@Override public void setValue(final String text) { top().setText(text); }
public void addAttribute(final String key, final String value) { ((Element)top()).addAttribute(escapeXmlName(key), value); }
public static VersionedDocument fromBean(@Nullable Object bean) { Document dom = DocumentHelper.createDocument(); AppLoader.getInstance(XStream.class).marshal(bean, new Dom4JWriter(dom)); VersionedDocument versionedDom = new VersionedDocument(dom); if (bean != null) { versionedDom.setVersion(MigrationHelper.getVersion(ClassUtils.unproxy(bean.getClass()))); } return versionedDom; }
@Override protected Element createNode(final String name) { final Element element = documentFactory.createElement(encodeNode(name)); final Branch top = top(); if (top != null) { top().add(element); } return element; }
@Override public void addAttribute(final String key, final String value) { ((Element)top()).addAttribute(encodeAttribute(key), value); }
private Branch top() { return (Branch)getCurrent(); } }
public void setValue(final String text) { top().setText(text); }
public void addAttribute(final String key, final String value) { ((Element)top()).addAttribute(escapeXmlName(key), value); }
protected Object createNode(final String name) { final Element element = documentFactory.createElement(encodeNode(name)); final Branch top = top(); if (top != null) { top().add(element); } return element; }
public void addAttribute(final String key, final String value) { ((Element)top()).addAttribute(encodeAttribute(key), value); }
private Branch top() { return getCurrent(); } }
public void setValue(final String text) { top().setText(text); }
protected Object createNode(final String name) { final Element element = documentFactory.createElement(escapeXmlName(name)); final Branch top = top(); if (top != null) { top().add(element); } return element; }
protected Object createNode(final String name) { final Element element = documentFactory.createElement(encodeNode(name)); final Branch top = top(); if (top != null) { top().add(element); } return element; }