1 package org.exoplatform.services.xml.querying.impl.xtas.object;2 3 import org.exoplatform.services.xml.querying.object.ObjectMappingException;4 import org.exoplatform.services.xml.querying.object.ObjectMarshalException;5 import org.w3c.dom.Document ;6 import java.util.Collection ;7 8 /**9 * Abstract Java-Object/ XML marshaller/unmarshaller10 * Every concrete marshaller must implement this.11 * @version $Id: ObjectMarshaller.java 566 2005-01-25 12:50:49Z kravchuk $ */12 public interface ObjectMarshaller13 {14 15 /**16 * Loads mapping for marshalling/unmarshalling.17 * As it is does not be realised for now constraints for 18 * mapping's format - incoming object is ANY subclass 19 * of Java Object20 */21 void loadMapping(Object source) throws ObjectMappingException ;22 23 /**24 * Unmarshals XML (as DOM Document) to Collection of Objects using loaded mapping25 * Note: the loadMapping() must be called first26 */27 Collection unmarshal(Document source) throws ObjectMarshalException, ObjectMappingException;28 29 /**30 * Marshals Object to XML (as DOM Document) using loaded mapping31 * Note: the loadMapping() must be called first32 */33 Document marshal(Object obj) throws ObjectMarshalException, ObjectMappingException;34 35 }36