1 package org.exoplatform.services.portal.skin.converter; 2 3 import java.util.* ; 4 import org.exoplatform.services.portal.skin.model.*; 5 6 import com.thoughtworks.xstream.converters.Converter; 7 import com.thoughtworks.xstream.converters.MarshallingContext; 8 import com.thoughtworks.xstream.converters.UnmarshallingContext; 9 import com.thoughtworks.xstream.io.HierarchicalStreamReader; 10 import com.thoughtworks.xstream.io.HierarchicalStreamWriter; 11 12 15 public class StyleConverter implements Converter { 16 17 public boolean canConvert(Class type) { 18 return type.equals(Style.class) ; 19 } 20 21 public void marshal(Object source, HierarchicalStreamWriter w, MarshallingContext context) { 22 Style style = (Style) source ; 23 } 24 25 public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { 26 Style style = new Style(reader.getAttribute("name"), reader.getAttribute("url")) ; 27 return style ; 28 } 29 } | Popular Tags |