01: /*
02: * $Id: SAXResult.java,v 1.5 2001/11/02 22:07:45 db Exp $
03: * Copyright (C) 2001 Andrew Selkirk
04: *
05: * This file is part of GNU JAXP, a library.
06: *
07: * GNU JAXP is free software; you can redistribute it and/or modify
08: * it under the terms of the GNU General Public License as published by
09: * the Free Software Foundation; either version 2 of the License, or
10: * (at your option) any later version.
11: *
12: * GNU JAXP is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: * GNU General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public License
18: * along with this program; if not, write to the Free Software
19: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20: *
21: * As a special exception, if you link this library with other files to
22: * produce an executable, this library does not by itself cause the
23: * resulting executable to be covered by the GNU General Public License.
24: * This exception does not however invalidate any other reasons why the
25: * executable file might be covered by the GNU General Public License.
26: */
27: package javax.xml.transform.sax;
28:
29: // Imports
30: import org.xml.sax.ContentHandler;
31: import org.xml.sax.ext.LexicalHandler;
32: import javax.xml.transform.Result;
33:
34: /**
35: * Collects the result of a SAX transform.
36: * @author Andrew Selkirk, David Brownell
37: * @version 1.0
38: */
39: public class SAXResult implements Result {
40: /**
41: * Used with <em>TransformerFactory.getFeature()</em> to determine
42: * whether the transformers it produces support SAXResult objects
43: * as outputs.
44: */
45: public static final String FEATURE = "http://javax.xml.transform.sax.SAXResult/feature";
46:
47: private ContentHandler handler = null;
48: private LexicalHandler lexhandler = null;
49: private String systemId = null;
50:
51: //-------------------------------------------------------------
52: // Initialization ---------------------------------------------
53: //-------------------------------------------------------------
54:
55: public SAXResult() {
56: } // SAXResult()
57:
58: public SAXResult(ContentHandler handler) {
59: this .handler = handler;
60: } // SAXResult()
61:
62: //-------------------------------------------------------------
63: // Methods ----------------------------------------------------
64: //-------------------------------------------------------------
65:
66: public ContentHandler getHandler() {
67: return handler;
68: }
69:
70: public String getSystemId() {
71: return systemId;
72: }
73:
74: public LexicalHandler getLexicalHandler() {
75: return lexhandler;
76: }
77:
78: public void setHandler(ContentHandler handler) {
79: this .handler = handler;
80: }
81:
82: public void setSystemId(String systemID) {
83: this .systemId = systemID;
84: }
85:
86: public void setLexicalHandler(LexicalHandler lexHandler) {
87: this.lexhandler = lexHandler;
88: }
89: }
|