1 package net.sourceforge.jparam.output;
2
3 import java.io.PrintStream;
4
5 import net.sourceforge.jparam.JParamException;
6
7 /***
8 * A serializer that can write an object of a specific class into the given
9 * <code>PrintStream</code> using the JParam output format
10 *
11 * This interface will usually not used directly
12 *
13 * @author Ron_Sidi
14 *
15 */
16 public interface ISerializer {
17 /***
18 * Write the string representation of the given object into the given
19 * <code>PrintStream</code>
20 *
21 * @param obj the object to write (must be instanceof
22 * <code>getSupportedClass</code>
23 * @param out the <code>PrintStream</code> to write to
24 * @throws JParamException if there was any problem with the serialization
25 * process, or if the object is not instanceof
26 * <code>getSupportedClass</code>
27 */
28 public void serialize(Object obj, PrintStream out) throws JParamException;
29
30
31 /***
32 * Return the <code>Class</code> that is supported by this seriazlier
33 * @return
34 */
35 public Class getSupportedClass();
36 }