1 package spoon.reflect; 2 3 import java.io.IOException; 4 import java.io.InputStream; 5 import java.io.OutputStream; 6 7 8 9 /** 10 * This interface defines the protocol to save and load a factory and it's 11 * associated model through ouput and input streams. 12 */ 13 public interface ModelStreamer { 14 15 /** 16 * Saves a factory (and all its associated Java program elements). 17 * 18 * @param f 19 * the factory to be save 20 * @param out 21 * the used output stream 22 * @throws IOException 23 * if some IO error occurs 24 */ 25 void save(Factory f, OutputStream out) throws IOException; 26 27 /** 28 * Loads a factory (and all its associated Java program elements). 29 * 30 * @param in 31 * the used input stream 32 * @return the loaded factory 33 * @throws IOException 34 * if some IO error occurs 35 */ 36 Factory load(InputStream in) throws IOException; 37 38 }