1 package org.snipsnap.serialization; 2 3 import java.io.Writer ; 4 import java.util.Properties ; 5 import org.snipsnap.snip.Snip; 6 7 public abstract class Serializer { 8 9 public Serializer(int outputFormat) { 10 m_outputFormat = outputFormat; 11 m_labelSerializerFactory = new LabelSerializerFactory(outputFormat); 12 m_props = new Properties (); 13 } 14 15 public void configure(Properties props) { 16 m_props = props; 17 } 18 19 24 public abstract void serialize(Snip snip, Writer writer); 25 26 32 public abstract void serialize(Snip snip, Writer writer, int depth); 33 34 public int getOutputFormat() { 35 return m_outputFormat; 36 } 37 38 protected LabelSerializerFactory getLabelSerializerFactory() { 39 return m_labelSerializerFactory; 40 } 41 42 private LabelSerializerFactory m_labelSerializerFactory; 43 private int m_outputFormat; 44 protected Properties m_props; 45 } 46 | Popular Tags |