1 24 package org.riotfamily.components.property; 25 26 import org.riotfamily.common.xml.XmlUtils; 27 import org.springframework.util.Assert; 28 import org.w3c.dom.Node ; 29 30 public class XmlPropertyProcessor extends AbstractSinglePropertyProcessor { 31 32 public XmlPropertyProcessor() { 33 } 34 35 public XmlPropertyProcessor(String property) { 36 setProperty(property); 37 } 38 39 protected String convertToString(Object object) { 40 if (object == null) { 41 return null; 42 } 43 Assert.isInstanceOf(Node .class, object); 44 return XmlUtils.serialize((Node ) object); 45 } 46 47 protected Object resolveString(String s) { 48 if (s == null) { 49 return null; 50 } 51 return XmlUtils.parse(s).getDocumentElement(); 52 } 53 54 } 55 | Popular Tags |