KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > dom > util > DocumentFactory


1 /*
2
3    Copyright 2000-2001,2003 The Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16
17  */

18 package org.apache.batik.dom.util;
19
20 import java.io.IOException JavaDoc;
21 import java.io.InputStream JavaDoc;
22 import java.io.Reader JavaDoc;
23
24 import org.w3c.dom.Document JavaDoc;
25
26 import org.xml.sax.XMLReader JavaDoc;
27
28 /**
29  * This interface represents an object which can build a Document.
30  *
31  * @author <a HREF="mailto:stephane@hillion.org">Stephane Hillion</a>
32  * @version $Id: DocumentFactory.java,v 1.11 2004/08/18 07:13:37 vhardy Exp $
33  */

34 public interface DocumentFactory {
35
36     /**
37      * Sets whether or not the XML stream has to be validate, depending on the
38      * specified parameter.
39      *
40      * @param isValidating true implies the XML stream will be validated
41      */

42     void setValidating(boolean isValidating);
43
44     /**
45      * Returns true if the XML stream has to be validated, false otherwise.
46      */

47     boolean isValidating();
48
49     /**
50      * Creates a Document instance.
51      * @param ns The namespace URI of the root element of the document.
52      * @param root The name of the root element of the document.
53      * @param uri The document URI.
54      * @exception IOException if an error occured while reading the document.
55      */

56     Document JavaDoc createDocument(String JavaDoc ns, String JavaDoc root, String JavaDoc uri) throws IOException JavaDoc;
57
58     /**
59      * Creates a Document instance.
60      * @param ns The namespace URI of the root element of the document.
61      * @param root The name of the root element of the document.
62      * @param uri The document URI.
63      * @param is The document input stream.
64      * @exception IOException if an error occured while reading the document.
65      */

66     Document JavaDoc createDocument(String JavaDoc ns, String JavaDoc root, String JavaDoc uri, InputStream JavaDoc is)
67         throws IOException JavaDoc;
68
69     /**
70      * Creates a Document instance.
71      * @param ns The namespace URI of the root element of the document.
72      * @param root The name of the root element of the document.
73      * @param uri The document URI.
74      * @param r An XMLReader instance
75      * @exception IOException if an error occured while reading the document.
76      */

77     Document JavaDoc createDocument(String JavaDoc ns, String JavaDoc root, String JavaDoc uri, XMLReader JavaDoc r)
78         throws IOException JavaDoc;
79
80     /**
81      * Creates a Document instance.
82      * @param ns The namespace URI of the root element of the document.
83      * @param root The name of the root element of the document.
84      * @param uri The document URI.
85      * @param r The document reader.
86      * @exception IOException if an error occured while reading the document.
87      */

88     Document JavaDoc createDocument(String JavaDoc ns, String JavaDoc root, String JavaDoc uri, Reader JavaDoc r)
89         throws IOException JavaDoc;
90
91     /**
92      * Returns the document descriptor associated with the latest created
93      * document.
94      * @return null if no document or descriptor was previously generated.
95      */

96     DocumentDescriptor getDocumentDescriptor();
97 }
98
Popular Tags