KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > saxon > event > Sink


1 package net.sf.saxon.event;
2
3 import net.sf.saxon.trans.XPathException;
4
5 /**
6  * A Sink is an Receiver that discards all information passed to it
7  */

8
9 public class Sink implements Receiver {
10     private PipelineConfiguration pipe;
11     private String JavaDoc systemId;
12
13     public void setSystemId(String JavaDoc systemId) {
14         this.systemId = systemId;
15     }
16
17     public String JavaDoc getSystemId() {
18         return systemId;
19     }
20
21     /**
22      * Set the pipeline configuration
23      */

24
25     public void setPipelineConfiguration(PipelineConfiguration pipe) {
26         this.pipe = pipe;
27     }
28
29     /**
30      * Get the pipeline configuration
31      */

32
33     public PipelineConfiguration getPipelineConfiguration() {
34         return pipe;
35     }
36
37     /**
38      * Start of event stream
39      */

40
41     public void open() throws XPathException {
42     }
43
44     /**
45      * End of event stream
46      */

47
48     public void close() throws XPathException {
49     }
50
51     /**
52      * Start of a document node.
53      */

54
55     public void startDocument(int properties) throws XPathException {
56     }
57
58     /**
59      * Notify the end of a document node
60      */

61
62     public void endDocument() throws XPathException {
63     }
64
65     /**
66      * Notify the start of an element
67      *
68      * @param nameCode integer code identifying the name of the element within the name pool.
69      * @param typeCode integer code identifying the element's type within the name pool.
70      * @param properties for future use. Should be set to zero.
71      */

72
73     public void startElement(int nameCode, int typeCode, int locationId, int properties)
74             throws XPathException {
75     }
76
77     /**
78      * Notify a namespace. Namespaces are notified <b>after</b> the startElement event, and before
79      * any children for the element. The namespaces that are reported are only required
80      * to include those that are different from the parent element; however, duplicates may be reported.
81      * A namespace must not conflict with any namespaces already used for element or attribute names.
82      *
83      * @param namespaceCode an integer: the top half is a prefix code, the bottom half a URI code.
84      * These may be translated into an actual prefix and URI using the name pool. A prefix code of
85      * zero represents the empty prefix (that is, the default namespace). A URI code of zero represents
86      * a URI of "", that is, a namespace undeclaration.
87      * @throws java.lang.IllegalStateException:
88      * attempt to output a namespace when there is no open element
89      * start tag
90      */

91
92     public void namespace(int namespaceCode, int properties) throws XPathException {
93
94     }
95
96     /**
97      * Notify an attribute. Attributes are notified after the startElement event, and before any
98      * children. Namespaces and attributes may be intermingled.
99      *
100      * @param nameCode The name of the attribute, as held in the name pool
101      * @param typeCode The type of the attribute, as held in the name pool
102      * @param properties Bit significant value. The following bits are defined:
103      * <dd>DISABLE_ESCAPING</dd> <dt>Disable escaping for this attribute</dt>
104      * <dd>NO_SPECIAL_CHARACTERS</dd> <dt>Attribute value contains no special characters</dt>
105      * @throws java.lang.IllegalStateException:
106      * attempt to output an attribute when there is no open element
107      * start tag
108      */

109
110     public void attribute(int nameCode, int typeCode, CharSequence JavaDoc value, int locationId, int properties)
111             throws XPathException {
112     }
113
114     /**
115      * Notify the start of the content, that is, the completion of all attributes and namespaces.
116      * Note that the initial receiver of output from XSLT instructions will not receive this event,
117      * it has to detect it itself. Note that this event is reported for every element even if it has
118      * no attributes, no namespaces, and no content.
119      */

120
121
122     public void startContent() throws XPathException {
123     }
124
125     /**
126      * End of element
127      */

128
129     public void endElement() throws XPathException {
130     }
131
132     /**
133      * Character data
134      */

135
136     public void characters(CharSequence JavaDoc chars, int locationId, int properties) throws XPathException {
137     }
138
139
140     /**
141      * Processing Instruction
142      */

143
144     public void processingInstruction(String JavaDoc target, CharSequence JavaDoc data, int locationId, int properties) throws XPathException {
145     }
146
147     /**
148      * Output a comment
149      */

150
151     public void comment(CharSequence JavaDoc chars, int locationId, int properties) throws XPathException {
152     }
153
154
155     /**
156      * Set the URI for an unparsed entity in the document.
157      */

158
159     public void setUnparsedEntity(String JavaDoc name, String JavaDoc uri, String JavaDoc publicId) throws XPathException {
160     }
161
162 }
163
164 //
165
// The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
166
// you may not use this file except in compliance with the License. You may obtain a copy of the
167
// License at http://www.mozilla.org/MPL/
168
//
169
// Software distributed under the License is distributed on an "AS IS" basis,
170
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
171
// See the License for the specific language governing rights and limitations under the License.
172
//
173
// The Original Code is: all this file.
174
//
175
// The Initial Developer of the Original Code is Michael H. Kay
176
//
177
// Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
178
//
179
// Contributor(s): none.
180
//
181
Popular Tags