01: /*
02: * This file is part of the WfMOpen project.
03: * Copyright (C) 2001-2003 Danet GmbH (www.danet.de), GS-AN.
04: * All rights reserved.
05: *
06: * This program is free software; you can redistribute it and/or modify
07: * it under the terms of the GNU General Public License as published by
08: * the Free Software Foundation; either version 2 of the License, or
09: * (at your option) any later version.
10: *
11: * This program is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU General Public License for more details.
15: *
16: * You should have received a copy of the GNU General Public License
17: * along with this program; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19: *
20: * $Id: SAXEventBuffer.java,v 1.2 2006/09/29 12:32:07 drmlipp Exp $
21: *
22: * $Log: SAXEventBuffer.java,v $
23: * Revision 1.2 2006/09/29 12:32:07 drmlipp
24: * Consistently using WfMOpen as projct name now.
25: *
26: * Revision 1.1.1.1 2003/06/30 20:05:13 drmlipp
27: * Initial import
28: *
29: * Revision 1.2 2003/06/27 08:51:46 lipp
30: * Fixed copyright/license information.
31: *
32: * Revision 1.1 2003/04/22 16:35:25 lipp
33: * Made SAXEventBuffer outer class.
34: *
35: */
36: package de.danet.an.workflow.api;
37:
38: import org.xml.sax.ContentHandler;
39: import org.xml.sax.SAXException;
40:
41: /**
42: * This interface is implemented by classes that can provide XML
43: * content by emitting SAX events.<P>
44: *
45: * Applications that use XML at their interfaces can sometimes not
46: * avoid using XML like data structures for internal data
47: * representation. Holding this data as XML is not very time
48: * efficient, because it must be parsed in order to be processed
49: * (although parsing time for XML is often overestimated).<P>
50: *
51: * Holding the data in either W3C DOM or JDOM representations is not
52: * very memory efficient. Depending on the implementation, DOM
53: * representations use a factor of 6 to 10 compared with the file
54: * space of the same description.<P>
55: *
56: * A SAX event buffer is a compromise. It stores the events generated
57: * by a SAX parser using as little space as possible while providing
58: * the data very quickly to a content Handler.
59: */
60: public interface SAXEventBuffer {
61:
62: /**
63: * Emits the events to the given <code>ContentHandler</code>.
64: *
65: * @param contentHandler the content handler that is to
66: * receive the events.
67: * @exception SAXException any SAX exception, possibly
68: * wrapping another exception.
69: */
70: void emit(ContentHandler contentHandler) throws SAXException;
71: }
|