cvs commit: xml-fop/src/org/apache/fop/fo FOAttributes.java FONode.java FOPropertySets.java FOTree.java FObjectNames.java FObjectSets.java FObjects.java FoRoot.java PropNames.java PropertyConsts.java PropertySets.java ReferenceAreaFO.java ShorthandPropSets.java WritingModes.java
pbwest 2003/03/30 18:44:20 Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FOAttributes.java FONode.java FOPropertySets.java FOTree.java FObjectNames.java FObjectSets.java FObjects.java FoRoot.java PropNames.java PropertyConsts.java PropertySets.java ReferenceAreaFO.java ShorthandPropSets.java WritingModes.java Log: Tidied copyright notice Revision ChangesPath No revision No revision 1.1.2.15 +58 -58xml-fop/src/org/apache/fop/fo/Attic/FOAttributes.java Index: FOAttributes.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Attic/FOAttributes.java,v retrieving revision 1.1.2.14 retrieving revision 1.1.2.15 diff -u -r1.1.2.14 -r1.1.2.15 --- FOAttributes.java 19 Mar 2003 14:36:47 - 1.1.2.14 +++ FOAttributes.java 31 Mar 2003 02:44:19 - 1.1.2.15 @@ -1,3 +1,60 @@ +/* + * FOAttributes.java + * $Id$ + * + * Created: Wed Nov 14 15:19:51 2001 + * + * + * The Apache Software License, Version 1.1 + * + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + *this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + *this list of conditions and the following disclaimer in the documentation + *and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + *include the following acknowledgment: This product includes software + *developed by the Apache Software Foundation (http://www.apache.org/). + *Alternately, this acknowledgment may appear in the software itself, if + *and wherever such third-party acknowledgments normally appear. + * + * 4. The names FOP and Apache Software Foundation must not be used to + *endorse or promote products derived from this software without prior + *written permission. For written permission, please contact + *[EMAIL PROTECTED] + * + * 5. Products derived from this software may not be called Apache, nor may + *Apache appear in their name, without prior written permission of the + *Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber [EMAIL PROTECTED]. For more information on the Apache + * Software Foundation, please see http://www.apache.org/. + * + * + * @author a href=mailto:[EMAIL PROTECTED]Peter B. West/a + * @version $Revision$ $Name$ + */ package org.apache.fop.fo; import org.apache.fop.apps.FOPException; @@ -19,63 +76,6 @@ import java.util.Collections; import java.util.Arrays; -/* - * FOAttributes.java - * $Id$ - * - * Created: Wed Nov 14 15:19:51 2001 - * - * - *The Apache Software License, Version 1.1 - * - * - * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modifica- - * tion, are permitted provided that the following conditions are met: - * - * 1. Redistributions
cvs commit: xml-fop/src/org/apache/fop/fo FOAttributes.java FONode.java FOPropertySets.java FOTree.java FObjectNames.java FObjectSets.java FObjects.java FoRoot.java PropNames.java PropertyConsts.java PropertySets.java ReferenceAreaFO.java ShorthandPropSets.java WritingModes.java
pbwest 2003/03/19 06:36:49 Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FOAttributes.java FONode.java FOPropertySets.java FOTree.java FObjectNames.java FObjectSets.java FObjects.java FoRoot.java PropNames.java PropertyConsts.java PropertySets.java ReferenceAreaFO.java ShorthandPropSets.java WritingModes.java Log: Full LICENSE text. Revision ChangesPath No revision No revision 1.1.2.14 +51 -6 xml-fop/src/org/apache/fop/fo/Attic/FOAttributes.java Index: FOAttributes.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Attic/FOAttributes.java,v retrieving revision 1.1.2.13 retrieving revision 1.1.2.14 diff -u -r1.1.2.13 -r1.1.2.14 --- FOAttributes.java 13 Nov 2002 15:09:26 - 1.1.2.13 +++ FOAttributes.java 19 Mar 2003 14:36:47 - 1.1.2.14 @@ -24,9 +24,54 @@ * $Id$ * * Created: Wed Nov 14 15:19:51 2001 - * 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. + * + * + *The Apache Software License, Version 1.1 + * + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/). + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names FOP and Apache Software Foundation must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * [EMAIL PROTECTED] + * + * 5. Products derived from this software may not be called Apache, nor may + * Apache appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber [EMAIL PROTECTED]. For more information on the Apache + * Software Foundation, please see http://www.apache.org/. + * * * @author a href=mailto:[EMAIL PROTECTED]Peter B. West/a * @version $Revision$ $Name$ 1.19.2.31 +84 -6 xml-fop/src/org/apache/fop/fo/Attic/FONode.java Index: FONode.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Attic/FONode.java,v retrieving revision 1.19.2.30 retrieving revision 1.19.2.31 diff -u -r1.19.2.30 -r1.19.2.31 --- FONode.java 3 Dec 2002 07:22:23 - 1.19.2.30 +++ FONode.java 19 Mar 2003 14:36:47 - 1.19.2.31 @@ -39,9 +39,54 @@ * FONode.java * Created: Sat Nov 10 01:39:37 2001 * $Id$ - * Copyright (C)
cvs commit: xml-fop/src/org/apache/fop/fo FOAttributes.java
pbwest 2002/11/13 07:09:27 Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FOAttributes.java Log: Account for FoPcdata. Revision ChangesPath No revision No revision 1.1.2.13 +11 -7 xml-fop/src/org/apache/fop/fo/Attic/FOAttributes.java Index: FOAttributes.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Attic/FOAttributes.java,v retrieving revision 1.1.2.12 retrieving revision 1.1.2.13 diff -u -r1.1.2.12 -r1.1.2.13 --- FOAttributes.java 5 Nov 2002 14:23:29 - 1.1.2.12 +++ FOAttributes.java 13 Nov 2002 15:09:26 - 1.1.2.13 @@ -3,9 +3,10 @@ import org.apache.fop.apps.FOPException; import org.apache.fop.fo.expr.PropertyException; import org.apache.fop.fo.PropertyConsts; +import org.apache.fop.fo.FObjectNames; import org.apache.fop.datatypes.Ints; import org.apache.fop.messaging.MessageHandler; -import org.apache.fop.xml.XMLEvent; +import org.apache.fop.xml.FoXMLEvent; import org.apache.fop.xml.XMLNamespaces; import org.xml.sax.Attributes; @@ -89,18 +90,21 @@ * value is entered into the appropriate ttHashMap/tt in the * ttArrayList/tt inSpaceAttrMaps/i, indexed by the attribute's * local name. - * @param event - the XML event which triggered construction of the parent - * ttFONode/tt. + * @param event - the FO XML event which triggered construction of the + * parent ttFONode/tt. * @param foNode - the ttFONode/tt with which these attributes are * associated. */ -public FOAttributes (XMLEvent event, FONode foNode) throws FOPException { +public FOAttributes(FoXMLEvent event, FONode foNode) throws FOPException { // If the event is null, there is no event associated with this // node, probably because this is a manufactured node; e.g., // an invented FopageSequenceMaster. The default initialisation // includes an empty foAttrMap HashMap. if (event == null) return; + +if (event.getFoType() == FObjectNames.PCDATA) +return; // go with the empty foAttrMap // Create the foAttrMap. Attributes attributes = event.getAttributes(); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/fo FOAttributes.java
pbwest 2002/11/05 06:23:29 Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FOAttributes.java Log: Removed foTree field. Revision ChangesPath No revision No revision 1.1.2.12 +3 -7 xml-fop/src/org/apache/fop/fo/Attic/FOAttributes.java Index: FOAttributes.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Attic/FOAttributes.java,v retrieving revision 1.1.2.11 retrieving revision 1.1.2.12 diff -u -r1.1.2.11 -r1.1.2.12 --- FOAttributes.java 30 Oct 2002 14:45:38 - 1.1.2.11 +++ FOAttributes.java 5 Nov 2002 14:23:29 - 1.1.2.12 @@ -78,8 +78,6 @@ private static Integer[] integerArray = new Integer[] { Ints.consts.get(0) }; -private FONode foNode; - /** * Construct an iFOAttributes/i object. * pThe ttAttributes/tt object on the event is scanned, and each @@ -103,8 +101,6 @@ // an invented FopageSequenceMaster. The default initialisation // includes an empty foAttrMap HashMap. if (event == null) return; - -this.foNode = foNode; // Create the foAttrMap. Attributes attributes = event.getAttributes(); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/fo FOAttributes.java
pbwest 2002/10/30 06:45:38 Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FOAttributes.java Log: Comment typos. Revision ChangesPath No revision No revision 1.1.2.11 +5 -5 xml-fop/src/org/apache/fop/fo/Attic/FOAttributes.java Index: FOAttributes.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Attic/FOAttributes.java,v retrieving revision 1.1.2.10 retrieving revision 1.1.2.11 diff -u -r1.1.2.10 -r1.1.2.11 --- FOAttributes.java 21 Oct 2002 15:41:26 - 1.1.2.10 +++ FOAttributes.java 30 Oct 2002 14:45:38 - 1.1.2.11 @@ -66,7 +66,7 @@ private HashMap foAttrMap = new HashMap(0); /** - * An sorted array of the keys (property indices) of the values in + * A sorted array of the keys (property indices) of the values in * ifoAttrMap/i. */ private Integer[] foAttrKeys = null; @@ -85,7 +85,7 @@ * pThe ttAttributes/tt object on the event is scanned, and each * attribute is examined. If the attribute is in the default namespace * for fo: attributes, it is an fo: property, and its value is entered - * into the ifoAttrMap/i ttHashmap/tt indexed by the property + * into the ifoAttrMap/i ttHashmap/tt indexed by the property * index. * pIf the attribute does not belong to the default namespace, its * value is entered into the appropriate ttHashMap/tt in the - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/fo FOAttributes.java FObject.java FObjectNames.java FONode.java FOPropertySets.java FoRoot.java FOTree.java PropertyConsts.java PropertySets.java PropNames.java ReferenceAreaFO.java ShorthandPropSets.java WritingModes.java Properties.java
pbwest 2002/10/18 20:49:05 Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FOAttributes.java FObject.java FObjectNames.java FONode.java FOPropertySets.java FoRoot.java FOTree.java PropertyConsts.java PropertySets.java PropNames.java ReferenceAreaFO.java ShorthandPropSets.java WritingModes.java Removed: src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design Properties.java Log: PropertyConsts now instantiated. PropertyConsts data is accessed through a singleton object. getPropertyIndex() moved to PropNames. Properties split into properties.Property and properties.property. Revision ChangesPath No revision No revision 1.1.2.9 +11 -17xml-fop/src/org/apache/fop/fo/Attic/FOAttributes.java Index: FOAttributes.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Attic/FOAttributes.java,v retrieving revision 1.1.2.8 retrieving revision 1.1.2.9 diff -u -r1.1.2.8 -r1.1.2.9 --- FOAttributes.java 10 Oct 2002 03:16:12 - 1.1.2.8 +++ FOAttributes.java 19 Oct 2002 03:49:04 - 1.1.2.9 @@ -79,6 +79,7 @@ = new Integer[] { Ints.consts.get(0) }; private FONode foNode; +public final PropertyConsts propertyConsts; /** * Construct an iFOAttributes/i object. @@ -97,6 +98,9 @@ * associated. */ public FOAttributes (XMLEvent event, FONode foNode) throws FOPException { + +propertyConsts = PropertyConsts.getPropertyConsts(); + // If the event is null, there is no event associated with this // node, probably because this is a manufactured node; e.g., // an invented FopageSequenceMaster. The default initialisation @@ -127,18 +131,9 @@ // Catch default namespace declaration here. if (attrLocalname.equals(xmlns)) break; // Is this a known (valid) property? -try { -// throws PropertyException if invalid -propIndex = -PropertyConsts.getPropertyIndex(attrLocalname); +propIndex = PropNames.getPropertyIndex(attrLocalname); // Known attribute name -foAttrMap.put(Ints.consts.get(propIndex), attrValue); -} catch (PropertyException e) { -// Not known - ignore -MessageHandler.errorln(event.getQName() + - + attrQName - + not recognized. Ignoring.); -} +foAttrMap.put(Ints.consts.get(propIndex), attrValue); } else { // Not the XSL FO namespace int j; if (nSpaceAttrMaps == null) { @@ -234,8 +229,7 @@ public String getFoAttrValue(String propertyName) throws PropertyException { -return getFoAttrValue -(PropertyConsts.getPropertyIndex(propertyName)); +return getFoAttrValue(PropNames.getPropertyIndex(propertyName)); } /** @@ -274,7 +268,7 @@ throws PropertyException { if (uriIndex == XMLNamespaces.DefAttrNSIndex) -return getFoAttrValue(PropertyConsts.getPropertyIndex(localName)); +return getFoAttrValue(PropNames.getPropertyIndex(localName)); return (String) (((HashMap)nSpaceAttrMaps.get(uriIndex)).get(localName)); } 1.1.2.4 +0 -0 xml-fop/src/org/apache/fop/fo/Attic/FObject.java Index: FObject.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Attic/FObject.java,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -r1.1.2.3 -r1.1.2.4 1.1.2.5 +1 -1 xml-fop/src/org/apache/fop/fo/Attic/FObjectNames.java Index: FObjectNames.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Attic/FObjectNames.java,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -r1.1.2.4 -r1.1.2.5 1.19.2.17 +23 -20xml-fop/src/org/apache/fop/fo/FONode.java Index: FONode.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v retrieving revision 1.19.2.16 retrieving revision 1.19.2.17 diff -u -r1.19.2.16 -r1.19.2.17 --- FONode.java 9 Oct 2002 05:57:09 - 1.19.2.16 +++ FONode.java 19 Oct 2002 03:49:04
cvs commit: xml-fop/src/org/apache/fop/fo FOAttributes.java
pbwest 2002/10/09 20:16:12 Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FOAttributes.java Log: Remove xmlns attributes before processing. Delete Attributes object from event after processing. Revision ChangesPath No revision No revision 1.1.2.8 +10 -4 xml-fop/src/org/apache/fop/fo/Attic/FOAttributes.java Index: FOAttributes.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Attic/FOAttributes.java,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -u -r1.1.2.7 -r1.1.2.8 --- FOAttributes.java 9 Oct 2002 05:57:49 - 1.1.2.7 +++ FOAttributes.java 10 Oct 2002 03:16:12 - 1.1.2.8 @@ -114,6 +114,10 @@ for (int i = 0; i attributes.getLength(); i++) { String attrUri = attributes.getURI(i); String attrLocalname = attributes.getLocalName(i); +String attrQName = attributes.getQName(i); +int sep = attrQName.indexOf(':'); +String prefix = attrQName.substring(0, (sep == -1 ? 0 : sep)); +if (prefix.equals(xmlns)) break; String attrValue = attributes.getValue(i); int attrUriIndex = foNode.namespaces.getURIIndex(attrUri); @@ -132,7 +136,7 @@ } catch (PropertyException e) { // Not known - ignore MessageHandler.errorln(event.getQName() + - + attributes.getQName(i) + + attrQName + not recognized. Ignoring.); } } else { // Not the XSL FO namespace @@ -169,6 +173,8 @@ foAttrKeys = (Integer[])(foAttrMap.keySet().toArray(integerArray)); Arrays.sort(foAttrKeys); } +// Finished with the Attributes object +event.setAttributes(null); } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/fo FOAttributes.java
pbwest 2002/10/08 22:57:50 Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FOAttributes.java Log: Comment change. Revision ChangesPath No revision No revision 1.1.2.7 +6 -6 xml-fop/src/org/apache/fop/fo/Attic/FOAttributes.java Index: FOAttributes.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Attic/FOAttributes.java,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -r1.1.2.6 -r1.1.2.7 --- FOAttributes.java 1 Oct 2002 16:34:44 - 1.1.2.6 +++ FOAttributes.java 9 Oct 2002 05:57:49 - 1.1.2.7 @@ -45,7 +45,8 @@ * ttHashMap/tts which contain the attribute lists for each * namespace which may be active for a particular FO element. The * ttArrayList/tt is indexed by the URIIndex for this namespace - * which is statically maintained by ttXMLEvent/tt. The + * which is maintained in an ttXMLNamespaces/tt object by the + * ttFOTree/tt object which is processing the FO input. The * values in the ttHashMap/tts are indexed by the local name of the * attribute. * The ttArrayList/tt will not be created for a particular instance @@ -119,8 +120,7 @@ //System.out.println(FONode: + event); if (attrUriIndex == XMLNamespaces.DefAttrNSIndex) { // Standard FO namespace -// Catch default namespace declaration here. This seems to -// be a kludge. Should 'xmlns' come through here? +// Catch default namespace declaration here. if (attrLocalname.equals(xmlns)) break; // Is this a known (valid) property? try { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/fo FOAttributes.java
pbwest 2002/10/01 09:34:44 Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FOAttributes.java Log: Added foAttrKeys[] sorted key array. Obtain DefAttrNSIndex from XMLNamespaces. Revision ChangesPath No revision No revision 1.1.2.6 +46 -9 xml-fop/src/org/apache/fop/fo/Attic/FOAttributes.java Index: FOAttributes.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Attic/FOAttributes.java,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -u -r1.1.2.5 -r1.1.2.6 --- FOAttributes.java 16 Sep 2002 05:01:58 - 1.1.2.5 +++ FOAttributes.java 1 Oct 2002 16:34:44 - 1.1.2.6 @@ -16,6 +16,7 @@ import java.util.List; import java.util.Map; import java.util.Collections; +import java.util.Arrays; /* * FOAttributes.java @@ -63,7 +64,18 @@ */ private HashMap foAttrMap = new HashMap(0); -private int DefAttrNSIndex = XMLNamespaces.DefAttrNSIndex; +/** + * An sorted array of the keys (property indices) of the values in + * ifoAttrMap/i. + */ +private Integer[] foAttrKeys = null; + +/** + * A static array of ttInteger/tt as a template for the generation + * of the ifoAttrKeys/i array. + */ +private static Integer[] integerArray += new Integer[] { Ints.consts.get(0) }; private FONode foNode; @@ -105,7 +117,7 @@ int attrUriIndex = foNode.namespaces.getURIIndex(attrUri); //System.out.println(FONode: + event); -if (attrUriIndex == DefAttrNSIndex) { +if (attrUriIndex == XMLNamespaces.DefAttrNSIndex) { // Standard FO namespace // Catch default namespace declaration here. This seems to // be a kludge. Should 'xmlns' come through here? @@ -130,7 +142,7 @@ System.out.println(Creating nSpaceAttrMaps); nSpaceAttrMaps = new ArrayList(attrUriIndex + 1); // Add the fo list -for (j = 0; j DefAttrNSIndex; j++) +for (j = 0; j XMLNamespaces.DefAttrNSIndex; j++) nSpaceAttrMaps.add(new HashMap(0)); System.out.println(Adding foAttrMap); @@ -151,9 +163,17 @@ tmpHash.put(attrLocalname, attrValue); } } +// Set up the sorted array of the foAttr keys, if foAttrMap has +// any entries. +if (foAttrMap.size() 0) { +foAttrKeys = (Integer[])(foAttrMap.keySet().toArray(integerArray)); +Arrays.sort(foAttrKeys); +} } /** + * Get the default namespace attribute values as an unmodifiable + * ttMap/tt. * @return a unmodifiable ttMap/tt containing the the attribute * values for all of the default attribute namespace attributes in this * attribute list, indexed by the property name index from @@ -164,6 +184,7 @@ } /** + * Get the ttHashMap/tt of all default namespace attributes. * @return ttHashMap/tt ifoAttrMap/i containing the the attribute * values for all of the default attribute namespace attributes in this * attribute list, indexed by the property name index from @@ -175,6 +196,19 @@ } /** + * Get the sorted array of property index keys for the default namespace + * attributes. + * @return ttInteger[]/tt ifoAttrKeys/i containing the the + * sorted keys (the property indices from ttPropNames/tt) of the + * attribute values for all of the default attribute namespace attributes + * in this attribute list. + * Warning: This array may be changed by the calling process. + */ +public Integer[] getFoAttrKeys() { +return foAttrKeys; +} + +/** * A convenience method for accessing attribute values from the default * attribute namespace. * @param property an ttint/tt containing the property name index @@ -199,6 +233,8 @@ } /** + * Get an unmodifiable ttMap/tt of the attribute values for a + * particular namespace. * @param uriIndex an ttint/tt containing the index of the attribute * values namespace, maintained in an ttXMLEvent/tt ttstatic/tt * array. @@ -208,7 +244,7 @@ * derived from the one maintained in inSpaceAttrMaps/i. */ public Map getAttrMap(int uriIndex) { -if (uriIndex == DefAttrNSIndex) +if (uriIndex == XMLNamespaces.DefAttrNSIndex) return Collections.unmodifiableMap((Map)foAttrMap); if (nSpaceAttrMaps != null) {
cvs commit: xml-fop/src/org/apache/fop/fo FOAttributes.java
pbwest 2002/08/19 08:59:23 Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FOAttributes.java Log: Changed names of maps from \*List\* to \*Map\*. Revision ChangesPath No revision No revision 1.1.2.3 +71 -46xml-fop/src/org/apache/fop/fo/Attic/FOAttributes.java Index: FOAttributes.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Attic/FOAttributes.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- FOAttributes.java 27 Jun 2002 12:55:18 - 1.1.2.2 +++ FOAttributes.java 19 Aug 2002 15:59:22 - 1.1.2.3 @@ -39,7 +39,7 @@ private static final String revision = $Revision$; /** - * inSpaceAttrLists/i is an ttArrayList/tt to hold the array of + * inSpaceAttrMaps/i is an ttArrayList/tt to hold the array of * ttHashMap/tts which contain the attribute lists for each * namespace which may be active for a particular FO element. The * ttArrayList/tt is indexed by the URIIndex for this namespace @@ -49,18 +49,18 @@ * The ttArrayList/tt will not be created for a particular instance * of ttFOAttributes/tt unless a namespace other than the standard * XSL namespace is activated for this instance. - * See ifoAttrList/i. + * See ifoAttrMap/i. */ -private ArrayList nSpaceAttrLists; +private ArrayList nSpaceAttrMaps; /** - * ifoAttrList/i is a ttHashMap/tt to hold the FO namespace + * ifoAttrMap/i is a ttHashMap/tt to hold the FO namespace * attribute list specified in the FO element with which this list is * associated. The ttString/tt attribute value is stored * indexed by the integer constant property identifier from * ttPropertyConsts/tt. */ -private HashMap foAttrList = new HashMap(0); +private HashMap foAttrMap = new HashMap(0); private int DefAttrNSIndex = XMLEvent.DefAttrNSIndex; @@ -71,11 +71,11 @@ * pThe ttAttributes/tt object on the event is scanned, and each * attribute is examined. If the attribute is in the default namespace * for fo: attributes, it is an fo: property, and its value is entered - * into the ifoAttrList/i ttHashmap/tt indexed by the property + * into the ifoAttrMap/i ttHashmap/tt indexed by the property * index. * pIf the attribute does not belong to the default namespace, its * value is entered into the appropriate ttHashMap/tt in the - * ttArrayList/tt inSpaceAttrLists/i, indexed by the attribute's + * ttArrayList/tt inSpaceAttrMaps/i, indexed by the attribute's * local name. * p */ @@ -83,10 +83,10 @@ // If the event is null, there is no event associated with this // node, probably because this is a manufactured node; e.g., // an invented FopageSequenceMaster. The default initialisation -// includes an empty foAttrList HashMap. +// includes an empty foAttrMap HashMap. if (event == null) return; -// Create the foAttrList. +// Create the foAttrMap. Attributes attributes = event.attributes; if (attributes == null) throw new FOPException (No Attributes in XMLEvent); @@ -109,7 +109,7 @@ propIndex = PropertyConsts.getPropertyIndex(attrLocalname); // Known attribute name -foAttrList.put(Ints.consts.get(propIndex), attrValue); +foAttrMap.put(Ints.consts.get(propIndex), attrValue); } catch (PropertyException e) { // Not known - ignore MessageHandler.errorln(event.qName + @@ -118,27 +118,27 @@ } } else { // Not the XSL FO namespace int j; -if (nSpaceAttrLists == null) { +if (nSpaceAttrMaps == null) { //Create the list -System.out.println(Creating nSpaceAttrLists); -nSpaceAttrLists = new ArrayList(attrUriIndex + 1); +System.out.println(Creating nSpaceAttrMaps); +nSpaceAttrMaps = new ArrayList(attrUriIndex + 1); // Add the fo list for (j = 0; j DefAttrNSIndex; j++) -nSpaceAttrLists.add(new HashMap(0)); +nSpaceAttrMaps.add(new HashMap(0)); -System.out.println(Adding foAttrList); -nSpaceAttrLists.add(foAttrList); +
cvs commit: xml-fop/src/org/apache/fop/fo FOAttributes.java FObject.java FObjectNames.java FObjects.java FONode.java FoRoot.java FOTree.java PropertyConsts.java PropertySets.java PropNames.java
pbwest 2002/06/27 05:55:19 Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FOAttributes.java FObject.java FObjectNames.java FObjects.java FONode.java FoRoot.java FOTree.java PropertyConsts.java PropertySets.java PropNames.java Log: Added ident keywords Revision ChangesPath No revision No revision 1.1.2.2 +5 -2 xml-fop/src/org/apache/fop/fo/Attic/FOAttributes.java Index: FOAttributes.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Attic/FOAttributes.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- FOAttributes.java 7 May 2002 05:17:52 - 1.1.2.1 +++ FOAttributes.java 27 Jun 2002 12:55:18 - 1.1.2.2 @@ -35,6 +35,9 @@ public class FOAttributes { +private static final String tag = $Name$; +private static final String revision = $Revision$; + /** * inSpaceAttrLists/i is an ttArrayList/tt to hold the array of * ttHashMap/tts which contain the attribute lists for each 1.1.2.2 +4 -1 xml-fop/src/org/apache/fop/fo/Attic/FObject.java Index: FObject.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Attic/FObject.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- FObject.java 7 May 2002 05:17:52 - 1.1.2.1 +++ FObject.java 27 Jun 2002 12:55:18 - 1.1.2.2 @@ -17,6 +17,9 @@ */ public class FObject { +private static final String tag = $Name$; +private static final String revision = $Revision$; + private int foIndex; public FObject(int foIndex) { 1.1.2.2 +4 -1 xml-fop/src/org/apache/fop/fo/Attic/FObjectNames.java Index: FObjectNames.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Attic/FObjectNames.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- FObjectNames.java 7 May 2002 05:17:52 - 1.1.2.1 +++ FObjectNames.java 27 Jun 2002 12:55:18 - 1.1.2.2 @@ -17,6 +17,9 @@ public class FObjectNames { +private static final String tag = $Name$; +private static final String revision = $Revision$; + /** * Constant for matching Flow Object defined in iXSLFO/i. */ 1.1.2.2 +5 -2 xml-fop/src/org/apache/fop/fo/Attic/FObjects.java Index: FObjects.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Attic/FObjects.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- FObjects.java 7 May 2002 05:17:52 - 1.1.2.1 +++ FObjects.java 27 Jun 2002 12:55:18 - 1.1.2.2 @@ -32,6 +32,9 @@ public class FObjects { +private static final String tag = $Name$; +private static final String revision = $Revision$; + public static final String XSLNamespace = http://www.w3.org/1999/XSL/Format;; 1.19.2.2 +4 -1 xml-fop/src/org/apache/fop/fo/FONode.java Index: FONode.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v retrieving revision 1.19.2.1 retrieving revision 1.19.2.2 diff -u -r1.19.2.1 -r1.19.2.2 --- FONode.java 7 May 2002 05:23:06 - 1.19.2.1 +++ FONode.java 27 Jun 2002 12:55:18 - 1.19.2.2 @@ -34,6 +34,9 @@ public class FONode extends FOTree.Node{ +private static final String tag = $Name$; +private static final String revision = $Revision$; + /** * Constants for the set of attributes of interest with this FONode */ 1.1.2.2 +5 -4 xml-fop/src/org/apache/fop/fo/Attic/FoRoot.java Index: FoRoot.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Attic/FoRoot.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- FoRoot.java 7 May 2002 05:17:52 - 1.1.2.1 +++ FoRoot.java 27 Jun 2002 12:55:18 - 1.1.2.2 @@ -36,6 +36,9 @@ public class FoRoot extends FONode { +private static final String tag = $Name$; +private static final String revision = $Revision$; + private FoLayoutMasterSet layoutMasters; /** @@ -115,5 +118,3 @@ } } - -