KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > lenya > xml > parser > Parser


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

17
18 /* $Id: Parser.java 42598 2004-03-01 16:18:28Z gregor $ */
19
20 package org.apache.lenya.xml.parser;
21
22 import java.io.InputStream JavaDoc;
23 import java.io.Reader JavaDoc;
24
25 import org.w3c.dom.CDATASection JavaDoc;
26 import org.w3c.dom.Comment JavaDoc;
27 import org.w3c.dom.Document JavaDoc;
28 import org.w3c.dom.Element JavaDoc;
29 import org.w3c.dom.Text JavaDoc;
30
31
32 /**
33  * DOM Parser interface
34  */

35 public interface Parser {
36     /**
37      * DOCUMENT ME!
38      *
39      * @param filename DOCUMENT ME!
40      *
41      * @return DOCUMENT ME!
42      *
43      * @throws Exception DOCUMENT ME!
44      */

45     Document JavaDoc getDocument(String JavaDoc filename) throws Exception JavaDoc;
46
47     /**
48      * DOCUMENT ME!
49      *
50      * Create a document from a reader.
51      * @param is DOCUMENT ME!
52      *
53      * @return DOCUMENT ME!
54      *
55      * @throws Exception DOCUMENT ME!
56      */

57     Document JavaDoc getDocument(Reader JavaDoc reader) throws Exception JavaDoc;
58
59     /**
60      * DOCUMENT ME!
61      *
62      * @param is DOCUMENT ME!
63      *
64      * @return DOCUMENT ME!
65      *
66      * @throws Exception DOCUMENT ME!
67      */

68     Document JavaDoc getDocument(InputStream JavaDoc is) throws Exception JavaDoc;
69
70     /**
71      * DOCUMENT ME!
72      *
73      * @return DOCUMENT ME!
74      */

75     Document JavaDoc getDocument();
76
77     /**
78      * DOCUMENT ME!
79      *
80      * @param document DOCUMENT ME!
81      * @param name DOCUMENT ME!
82      *
83      * @return DOCUMENT ME!
84      */

85     Element JavaDoc newElementNode(Document JavaDoc document, String JavaDoc name);
86
87     /**
88      * Creates an element with namespace support.
89      *
90      * @param document The owner document.
91      * @param namespaceUri The namespace URI of the element.
92      * @param qualifiedName The qualified name of the element.
93      *
94      * @return An element.
95      */

96     Element JavaDoc newElementNSNode(Document JavaDoc document, String JavaDoc namespaceUri, String JavaDoc qualifiedName);
97         
98     /**
99      * DOCUMENT ME!
100      *
101      * @param document DOCUMENT ME!
102      * @param data DOCUMENT ME!
103      *
104      * @return DOCUMENT ME!
105      */

106     Text JavaDoc newTextNode(Document JavaDoc document, String JavaDoc data);
107
108     /**
109      * CDATA
110      *
111      * @param document DOM Document
112      * @param data Text
113      *
114      * @return CDATASection
115      */

116     CDATASection JavaDoc newCDATASection(Document JavaDoc document, String JavaDoc data);
117
118     /**
119      * DOCUMENT ME!
120      *
121      * @param document DOCUMENT ME!
122      * @param data DOCUMENT ME!
123      *
124      * @return DOCUMENT ME!
125      */

126     Comment JavaDoc newCommentNode(Document JavaDoc document, String JavaDoc data);
127 }
128
Popular Tags