1 17 package org.apache.servicemix.jbi.config.spring; 18 19 import org.apache.servicemix.jbi.util.DOMUtil; 20 import org.springframework.beans.factory.support.BeanDefinitionReader; 21 import org.w3c.dom.Element ; 22 import org.w3c.dom.Node ; 23 24 29 public class ElementToValueProcessor extends ElementProcessorSupport implements ElementProcessor { 30 31 public ElementToValueProcessor() { 32 } 33 34 public void processElement(Element element, BeanDefinitionReader beanDefinitionReader) { 35 Node root = element.getParentNode(); 36 root.removeChild(element); 37 38 Element value = addElement((Element ) root, "value"); 39 value.appendChild(value.getOwnerDocument().createTextNode(DOMUtil.getElementText(element))); 40 } 41 42 } 43 | Popular Tags |