KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opencms > template > I_CmsXmlParser


1 /*
2 * File : $Source: /usr/local/cvs/opencms/src-modules/com/opencms/template/I_CmsXmlParser.java,v $
3 * Date : $Date: 2005/06/27 23:22:20 $
4 * Version: $Revision: 1.2 $
5 *
6 * This library is part of OpenCms -
7 * the Open Source Content Mananagement System
8 *
9 * Copyright (C) 2001 The OpenCms Group
10 *
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
20 *
21 * For further information about OpenCms, please see the
22 * OpenCms Website: http://www.opencms.org
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this library; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 */

28
29
30 package com.opencms.template;
31
32 import java.io.InputStream JavaDoc;
33 import java.io.OutputStream JavaDoc;
34 import java.io.Reader JavaDoc;
35 import java.io.Writer JavaDoc;
36
37 import org.w3c.dom.Document JavaDoc;
38 import org.w3c.dom.Node JavaDoc;
39
40 /**
41  * Common interface for OpenCms XML parsers.
42  * Classes and interfaces for each customized parser type
43  * have to be implemtented.
44  *
45  * @author Alexander Kandzior
46  * @author Alexander Lucas
47  * @version $Revision: 1.2 $ $Date: 2005/06/27 23:22:20 $
48  *
49  * @deprecated Will not be supported past the OpenCms 6 release.
50  */

51 public interface I_CmsXmlParser {
52     
53     /** Line width used for XML documents */
54     public final static int C_XML_LINE_WIDTH = 80;
55     
56     /**
57      * Creates an empty DOM XML document.
58      * @return Empty document.
59      */

60     public Document JavaDoc createEmptyDocument(String JavaDoc docNod) throws Exception JavaDoc;
61     
62     /**
63      * Calls a XML printer for converting a XML DOM document
64      * to a String.
65      * @param doc Document to be printed.
66      * @param out OutputStream to print to.
67      * @param encoding the character encoding to be used while serializing
68      * document, if null - original or default encoding will be used
69      */

70     public void getXmlText(Document JavaDoc doc, OutputStream JavaDoc out, String JavaDoc encoding);
71
72     /**
73      * Calls a XML printer for converting a XML DOM document
74      * to a String.
75      * @param doc Document to be printed.
76      * @param out Writer to print to.
77      * @param encoding the character encoding to be used while serializing
78      */

79     public void getXmlText(Document JavaDoc doc, Writer JavaDoc out, String JavaDoc encoding);
80         
81     /**
82      * Calls a XML printer for converting a XML DOM document
83      * to a String.
84      * @param doc Document to be printed.
85      * @param out Writer to print to.
86      */

87     public void getXmlText(Document JavaDoc doc, Writer JavaDoc out);
88     
89     /**
90      * Used to import a node from a foreign document.
91      * @param doc Destination document that should import the node.
92      * @param node Node to be imported.
93      * @return New node that belongs to the document <code>doc</code>
94      */

95     public Node JavaDoc importNode(Document JavaDoc doc, Node JavaDoc node);
96     
97     /**
98      * Parses the given text.
99      * @param in Reader with the input text.
100      * @return Parsed text as DOM document.
101      * @throws Exception
102      */

103     public Document JavaDoc parse(Reader JavaDoc in) throws Exception JavaDoc;
104
105     public Document JavaDoc parse(InputStream JavaDoc in) throws Exception JavaDoc;
106
107     public String JavaDoc getOriginalEncoding(Document JavaDoc doc);
108
109     /**
110      * Gets a description of the parser.
111      * @return Parser description.
112      */

113     public String JavaDoc toString();
114 }
115
Popular Tags