KickJava   Java API By Example, From Geeks To Geeks.

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


1 package net.sf.saxon.event;
2 import net.sf.saxon.Configuration;
3 import net.sf.saxon.om.Item;
4 import net.sf.saxon.om.NamePool;
5 import net.sf.saxon.trans.XPathException;
6
7 /**
8   * SequenceReceiver: this extension of the Receiver interface is used when processing
9   * a sequence constructor. It differs from the Receiver in allowing items (atomic values or
10   * nodes) to be added to the sequence, not just tree-building events.
11   */

12
13 public abstract class SequenceReceiver implements Receiver {
14
15     protected boolean previousAtomic = false;
16
17     protected PipelineConfiguration pipelineConfiguration;
18
19     public SequenceReceiver(){}
20
21     public PipelineConfiguration getPipelineConfiguration() {
22         return pipelineConfiguration;
23     }
24
25     public void setPipelineConfiguration(PipelineConfiguration pipelineConfiguration) {
26         this.pipelineConfiguration = pipelineConfiguration;
27     }
28
29     public Configuration getConfiguration() {
30         return pipelineConfiguration.getConfiguration();
31     }
32
33     public void setSystemId(String JavaDoc systemId) {}
34
35     public String JavaDoc getSystemId() {
36         return null;
37     }
38
39     public void setUnparsedEntity(String JavaDoc name, String JavaDoc systemId, String JavaDoc publicId) throws XPathException {}
40
41     /**
42     * Start the output process
43     */

44
45     public void open() throws XPathException {
46         previousAtomic = false;
47     }
48
49     /**
50     * Output an item (atomic value or node) to the sequence
51     */

52
53     public void append(Item item, int locationId, int copyNamespaces) throws XPathException {
54         throw new UnsupportedOperationException JavaDoc("append() method not supported in " + this.getClass());
55     }
56
57     /**
58     * Get the name pool
59     * @return the Name Pool that was supplied using the setConfiguration() method
60     */

61
62     public NamePool getNamePool() {
63         return getConfiguration().getNamePool();
64     }
65 }
66
67 //
68
// The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
69
// you may not use this file except in compliance with the License. You may obtain a copy of the
70
// License at http://www.mozilla.org/MPL/
71
//
72
// Software distributed under the License is distributed on an "AS IS" basis,
73
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
74
// See the License for the specific language governing rights and limitations under the License.
75
//
76
// The Original Code is: all this file.
77
//
78
// The Initial Developer of the Original Code is Michael H. Kay
79
//
80
// Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
81
//
82
// Contributor(s): none.
83
//
84
Popular Tags