1 17 package org.apache.geronimo.kernel.config.xstream; 18 19 import com.thoughtworks.xstream.converters.MarshallingContext; 20 import com.thoughtworks.xstream.converters.reflection.ReflectionConverter; 21 import com.thoughtworks.xstream.converters.reflection.ReflectionProvider; 22 import com.thoughtworks.xstream.io.HierarchicalStreamWriter; 23 import com.thoughtworks.xstream.mapper.Mapper; 24 import org.apache.geronimo.kernel.config.ConfigurationData; 25 26 29 public class ConfigurationDataConverter extends ReflectionConverter { 30 public ConfigurationDataConverter(ReflectionProvider reflectionProvider, Mapper mapper) { 31 super(mapper, reflectionProvider); 32 } 33 34 public boolean canConvert(Class clazz) { 35 return ConfigurationData.class.isAssignableFrom(clazz); 36 } 37 38 public void marshal(Object object, HierarchicalStreamWriter writer, MarshallingContext marshallingContext) { 39 ConfigurationData configurationData = (ConfigurationData) object; 40 writer.addAttribute("configuration-data-version", "1.1"); 41 super.marshal(configurationData, writer, marshallingContext); 42 } 43 } 44 | Popular Tags |