01: package net.sf.saxon.event;
02:
03: import net.sf.saxon.Configuration;
04: import net.sf.saxon.om.Item;
05: import net.sf.saxon.om.NamePool;
06: import net.sf.saxon.trans.XPathException;
07:
08: /**
09: * SequenceReceiver: this extension of the Receiver interface is used when processing
10: * a sequence constructor. It differs from the Receiver in allowing items (atomic values or
11: * nodes) to be added to the sequence, not just tree-building events.
12: */
13:
14: public abstract class SequenceReceiver implements Receiver {
15:
16: protected boolean previousAtomic = false;
17:
18: protected PipelineConfiguration pipelineConfiguration;
19:
20: public SequenceReceiver() {
21: }
22:
23: public PipelineConfiguration getPipelineConfiguration() {
24: return pipelineConfiguration;
25: }
26:
27: public void setPipelineConfiguration(
28: PipelineConfiguration pipelineConfiguration) {
29: this .pipelineConfiguration = pipelineConfiguration;
30: }
31:
32: public Configuration getConfiguration() {
33: return pipelineConfiguration.getConfiguration();
34: }
35:
36: public void setSystemId(String systemId) {
37: }
38:
39: public String getSystemId() {
40: return null;
41: }
42:
43: public void setUnparsedEntity(String name, String systemId,
44: String publicId) throws XPathException {
45: }
46:
47: /**
48: * Start the output process
49: */
50:
51: public void open() throws XPathException {
52: previousAtomic = false;
53: }
54:
55: /**
56: * Output an item (atomic value or node) to the sequence
57: */
58:
59: public void append(Item item, int locationId, int copyNamespaces)
60: throws XPathException {
61: throw new UnsupportedOperationException(
62: "append() method not supported in " + this .getClass());
63: }
64:
65: /**
66: * Get the name pool
67: * @return the Name Pool that was supplied using the setConfiguration() method
68: */
69:
70: public NamePool getNamePool() {
71: return getConfiguration().getNamePool();
72: }
73: }
74:
75: //
76: // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
77: // you may not use this file except in compliance with the License. You may obtain a copy of the
78: // License at http://www.mozilla.org/MPL/
79: //
80: // Software distributed under the License is distributed on an "AS IS" basis,
81: // WITHOUT WARRANTY OF ANY KIND, either express or implied.
82: // See the License for the specific language governing rights and limitations under the License.
83: //
84: // The Original Code is: all this file.
85: //
86: // The Initial Developer of the Original Code is Michael H. Kay
87: //
88: // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
89: //
90: // Contributor(s): none.
91: //
|