KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > remoting > marshal > Marshaller


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.remoting.marshal;
8
9 import java.io.IOException JavaDoc;
10 import java.io.OutputStream JavaDoc;
11 import java.io.Serializable JavaDoc;
12
13 /**
14  * Interface that all data marshallers must implements.
15  * Requires them to take Java data objects and convert
16  * primitive java data types (i.e. byte[]) and write
17  * to output provided.
18  * <p/>
19  * Since the Marshaller is only responsible for doing
20  * the conversion to primitive type, does not make sense
21  * that would be supplied any type of object output to
22  * write to, as this implies that the object that it
23  * writes would be converted to bytes at some other
24  * point external to the marshaller.
25  *
26  * @author <a HREF="mailto:tom@jboss.org">Tom Elrod</a>
27  */

28 public interface Marshaller extends Serializable JavaDoc
29 {
30    /**
31     * Marshaller will need to take the dataObject and convert
32     * into primitive java data types and write to the
33     * given output.
34     *
35     * @param dataObject Object to be writen to output
36     * @param output The data output to write the object
37     * data to.
38     */

39    public void write(Object JavaDoc dataObject, OutputStream JavaDoc output) throws IOException JavaDoc;
40
41    public Marshaller cloneMarshaller() throws CloneNotSupportedException JavaDoc;
42
43 }
Popular Tags