
package qms.messages;
import java.io.*;
import qms.util.*;
import org.w3c.dom.*;
/**
 * Concentra la decodifica di Messaggi da stream o da stringa XML
 * @author  Enrico
 */
public abstract class MessageFactory {
    
        public static Message decodeMessage(InputStream input) throws IOException {
            Document doc = DOMUtils.parseStream(input);	    
            return new Message(doc);            
        }        
        public static Message decodeMessage(String xml) throws IOException {
            ByteArrayInputStream in = new ByteArrayInputStream(xml.getBytes());
            return decodeMessage(in);
        }        
}
