KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sape > carbon > core > config > format > ConfigurationDataFormatService


1 /*
2  * The contents of this file are subject to the Sapient Public License
3  * Version 1.0 (the "License"); you may not use this file except in compliance
4  * with the License. You may obtain a copy of the License at
5  * http://carbon.sf.net/License.html.
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9  * the specific language governing rights and limitations under the License.
10  *
11  * The Original Code is The Carbon Component Framework.
12  *
13  * The Initial Developer of the Original Code is Sapient Corporation
14  *
15  * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.
16  */

17
18 package org.sape.carbon.core.config.format;
19
20
21 import java.io.InputStream JavaDoc;
22 import java.io.OutputStream JavaDoc;
23
24
25 /**
26  * <P>Implmentations of this interface will provide persistance mechanisms
27  * for <code>org.jdom.Document</code> objects to and from their native
28  * raw formats.
29  * </P>
30  *
31  * Copyright 2002 Sapient
32  * @since carbon 1.0
33  * @author Greg Hinkle, January 2002
34  * @version $Revision: 1.6 $($Author: dvoet $ / $Date: 2003/05/05 21:21:16 $)
35  */

36 public interface ConfigurationDataFormatService {
37
38     /**
39      * <P>Loads a <code>CCLNode</code> object from the given
40      * <code>InputStream</code>. This node object will represent
41      * the full object-graph depiction of a live configuration.</P>
42      *
43      * @param name The name of the configuration node
44      * @param in the {@link java.io.InputStream} from which
45      * the configuration will be read
46      * @throws ConfigurationFormatException when there is a formatting error
47      * with the input stream
48      * @return The CCLNode object representing a live
49      * object graph of the data from the input stream
50      */

51     org.jdom.Document readConfigurationStreamToData(
52         String JavaDoc name,
53         InputStream JavaDoc in)
54         throws ConfigurationFormatException ;
55
56     /**
57      * <P>Stores the raw version of the provided <code>CCLNode</code>
58      * object in the format that this format service implementation
59      * understands.</P>
60      *
61      * @param out The output stream to which the raw configuration
62      * data should be written
63      * @param document The Configuration object to be stored; may be any
64      * subclass of Configuration
65      * @throws ConfigurationFormatException When unable to write a
66      * node's raw format to the output stream
67      */

68     void writeConfigurationStreamToData(
69         org.jdom.Document document,
70         OutputStream JavaDoc out)
71         throws ConfigurationFormatException;
72 }
Popular Tags