KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > saxon > pull > PullPushCopier


1 package net.sf.saxon.pull;
2
3 import net.sf.saxon.event.Receiver;
4 import net.sf.saxon.trans.XPathException;
5
6 /**
7  * This class copies a document by using the pull interface to read the input document,
8  * and the push interface to write the output document.
9  */

10 public class PullPushCopier {
11
12     private PullProvider in;
13     private Receiver out;
14
15     public PullPushCopier(PullProvider in, Receiver out) {
16         this.out = out;
17         this.in = in;
18     }
19
20     /**
21      * Copy the input to the output
22      * @throws XPathException
23      */

24
25     public void copy() throws XPathException {
26         PullPushTee tee = new PullPushTee(in, out);
27         new PullConsumer(tee).consume();
28     }
29 }
30
31 //
32
// The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
33
// you may not use this file except in compliance with the License. You may obtain a copy of the
34
// License at http://www.mozilla.org/MPL/
35
//
36
// Software distributed under the License is distributed on an "AS IS" basis,
37
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
38
// See the License for the specific language governing rights and limitations under the License.
39
//
40
// The Original Code is: all this file.
41
//
42
// The Initial Developer of the Original Code is Michael H. Kay.
43
//
44
// Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
45
//
46
// Contributor(s): none.
47
//
48
Popular Tags