You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by pb...@apache.org on 2002/09/16 06:21:50 UTC
cvs commit: xml-fop/src/org/apache/fop/xml XMLSerialHandler.java
pbwest 2002/09/15 21:21:50
Modified: src/org/apache/fop/xml Tag: FOP_0-20-0_Alt-Design
XMLSerialHandler.java
Log:
Converted from SyncedCircularBuffer to SyncedXmlEventsBuffer.
Derives XMLNamespaces from xmlevents. All constructors of XMLEvents
require an XMLNamespaces argument.
Revision Changes Path
No revision
No revision
1.1.2.2 +19 -16 xml-fop/src/org/apache/fop/xml/Attic/XMLSerialHandler.java
Index: XMLSerialHandler.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/xml/Attic/XMLSerialHandler.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- XMLSerialHandler.java 7 May 2002 16:40:46 -0000 1.1.2.1
+++ XMLSerialHandler.java 16 Sep 2002 04:21:50 -0000 1.1.2.2
@@ -1,7 +1,7 @@
-
package org.apache.fop.xml;
-import org.apache.fop.datastructs.SyncedCircularBuffer;
+import org.apache.fop.xml.XMLNamespaces;
+import org.apache.fop.xml.SyncedXmlEventsBuffer;
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.Driver;
import org.apache.fop.configuration.Configuration;
@@ -17,9 +17,7 @@
import java.util.NoSuchElementException;
/*
- * XMLSerialHandler.java
- * Created: Thu Nov 8 15:41:40 2001
- *
+ * $Id$
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -34,8 +32,12 @@
public class XMLSerialHandler extends DefaultHandler implements Runnable {
- private SyncedCircularBuffer events;
+ private static final String tag = "$Name$";
+ private static final String revision = "$Revision$";
+
+ private SyncedXmlEventsBuffer events;
private XMLReader parser;
+ private XMLNamespaces namespaces;
private InputSource source;
private Thread foThread;
private boolean errorDump;
@@ -46,10 +48,11 @@
* @param source the parser input source.
*/
public XMLSerialHandler
- (SyncedCircularBuffer events, XMLReader parser, InputSource source) {
+ (SyncedXmlEventsBuffer events, XMLReader parser, InputSource source) {
this.events = events;
this.parser = parser;
this.source = source;
+ namespaces = events.getNamespaces();
parser.setContentHandler(this);
errorDump = Configuration.getBooleanValue("debugMode").booleanValue();
}
@@ -79,7 +82,7 @@
/**
* Utility routine for the callback methods. It captures the
* <tt>InterruptedException</tt> that is possible from the <i>put</i>
- * method of a <tt>SyncedCircularBuffer</tt>.
+ * method of a <tt>SyncedXmlEventsBuffer</tt>.
*/
public void putEvent(XMLEvent event) throws NoSuchElementException {
synchronized (events) {
@@ -97,7 +100,7 @@
*/
public void startDocument() throws NoSuchElementException {
synchronized (events) {
- XMLEvent event = new XMLEvent();
+ XMLEvent event = new XMLEvent(namespaces);
//System.out.println("StartDocument thread "
// + Thread.currentThread().getName());
event.type = XMLEvent.STARTDOCUMENT;
@@ -111,7 +114,7 @@
*/
public void endDocument() throws NoSuchElementException {
synchronized (events) {
- XMLEvent event = new XMLEvent();
+ XMLEvent event = new XMLEvent(namespaces);
//System.out.println("EndDocument thread "
// + Thread.currentThread().getName());
event.type = XMLEvent.ENDDOCUMENT;
@@ -134,11 +137,11 @@
throws NoSuchElementException
{
synchronized (events) {
- XMLEvent event = new XMLEvent();
+ XMLEvent event = new XMLEvent(namespaces);
//System.out.println("StartElement thread "
// + Thread.currentThread().getName());
event.type = XMLEvent.STARTELEMENT;
- event.uriIndex = XMLEvent.getURIIndex(uri);
+ event.uriIndex = namespaces.getURIIndex(uri);
event.localName = localName;
event.qName = qName;
event.attributes = new AttributesImpl(attributes);
@@ -158,11 +161,11 @@
throws NoSuchElementException
{
synchronized (events) {
- XMLEvent event = new XMLEvent();
+ XMLEvent event = new XMLEvent(namespaces);
//System.out.println("EndElement thread "
// + Thread.currentThread().getName());
event.type = XMLEvent.ENDELEMENT;
- event.uriIndex = XMLEvent.getURIIndex(uri);
+ event.uriIndex = namespaces.getURIIndex(uri);
event.localName = localName;
event.qName = qName;
putEvent(event);
@@ -180,7 +183,7 @@
throws NoSuchElementException
{
synchronized (events) {
- XMLEvent event = new XMLEvent();
+ XMLEvent event = new XMLEvent(namespaces);
//System.out.println("characters thread "
// + Thread.currentThread().getName());
event.type = XMLEvent.CHARACTERS;
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org