From: Joerg Pietschmann Date: Wed, 24 Jul 2002 01:06:26 +0000 (+0000) Subject: Removed 'name' field and diverse getElementName() methods, X-Git-Tag: fop-0_20_5rc~117 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=50227328761a0f5586b3d955c6a70cf111ca759f;p=xmlgraphics-fop.git Removed 'name' field and diverse getElementName() methods, replaced by getName() returning a string constant. A few minor cosmetic changes. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_20_2-maintain@195026 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/org/apache/fop/extensions/Label.java b/src/org/apache/fop/extensions/Label.java index c46384f38..7f0b73aaa 100644 --- a/src/org/apache/fop/extensions/Label.java +++ b/src/org/apache/fop/extensions/Label.java @@ -39,5 +39,8 @@ public class Label extends ExtensionObj { return textBuffer.toString(); } + public String getName() { + return "fop:label"; + } } diff --git a/src/org/apache/fop/extensions/Outline.java b/src/org/apache/fop/extensions/Outline.java index e9c8a0ca2..9247bc35f 100644 --- a/src/org/apache/fop/extensions/Outline.java +++ b/src/org/apache/fop/extensions/Outline.java @@ -103,6 +103,9 @@ public class Outline extends ExtensionObj { return _internalDestination; } + public String getName() { + return "fop:outline"; + } } diff --git a/src/org/apache/fop/fo/ColorProfile.java b/src/org/apache/fop/fo/ColorProfile.java index 020b6cce6..8d4597477 100644 --- a/src/org/apache/fop/fo/ColorProfile.java +++ b/src/org/apache/fop/fo/ColorProfile.java @@ -11,21 +11,15 @@ package org.apache.fop.fo; import org.apache.fop.fo.*; import org.apache.fop.fo.flow.*; import org.apache.fop.fo.properties.*; -import org.apache.fop.layout.AreaTree; import org.apache.fop.apps.FOPException; -/** - * The fo:root formatting object. Contains page masters, root extensions, - * page-sequences. - */ -public class ColorProfile extends ToBeImplementedElement { +public class ColorProfile extends FObj { public static class Maker extends FObj.Maker { public FObj make(FObj parent, PropertyList propertyList) throws FOPException { return new ColorProfile(parent, propertyList); } - } public static FObj.Maker maker() { @@ -35,11 +29,13 @@ public class ColorProfile extends ToBeImplementedElement { protected ColorProfile(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:color-profile"; - + log.warn("color profile not implemented"); // this.properties.get("src"); // this.properties.get("color-profile-name"); // this.properties.get("rendering-intent"); } + public String getName() { + return "fo:color-profile"; + } } diff --git a/src/org/apache/fop/fo/Declarations.java b/src/org/apache/fop/fo/Declarations.java index ce711f4f0..928282254 100644 --- a/src/org/apache/fop/fo/Declarations.java +++ b/src/org/apache/fop/fo/Declarations.java @@ -11,19 +11,15 @@ package org.apache.fop.fo; import org.apache.fop.fo.*; import org.apache.fop.fo.flow.*; import org.apache.fop.fo.properties.*; -import org.apache.fop.layout.AreaTree; import org.apache.fop.apps.FOPException; -/** - */ -public class Declarations extends ToBeImplementedElement { +public class Declarations extends FObj { public static class Maker extends FObj.Maker { public FObj make(FObj parent, PropertyList propertyList) throws FOPException { return new Declarations(parent, propertyList); } - } public static FObj.Maker maker() { @@ -33,7 +29,10 @@ public class Declarations extends ToBeImplementedElement { protected Declarations(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:declarations"; + log.warn("declarations not implemented"); } + public String getName() { + return "fo:declarations"; + } } diff --git a/src/org/apache/fop/fo/FObj.java b/src/org/apache/fop/fo/FObj.java index 7d804dc9d..6b36be5bc 100644 --- a/src/org/apache/fop/fo/FObj.java +++ b/src/org/apache/fop/fo/FObj.java @@ -21,19 +21,16 @@ import java.util.Vector; /** * base class for representation of formatting objects and their processing */ -public class FObj extends FONode { - - public static class Maker { - public FObj make(FObj parent, - PropertyList propertyList) throws FOPException { - return new FObj(parent, propertyList); - } +public abstract class FObj extends FONode { + public abstract static class Maker { + abstract public FObj make(FObj parent, + PropertyList propertyList) throws FOPException; } - public static Maker maker() { - return new Maker(); - } +// public static Maker maker() { +// return new Maker(); +// } // protected PropertyList properties; public PropertyList properties; @@ -42,14 +39,13 @@ public class FObj extends FONode { // markers private Hashtable markers; - protected String name; +// protected String name; protected FObj(FObj parent, PropertyList propertyList) { super(parent); this.properties = propertyList; // TO BE REMOVED!!! propertyList.setFObj(this); this.propMgr = makePropertyManager(propertyList); - this.name = "default FO"; setWritingMode(); } @@ -83,16 +79,14 @@ public class FObj extends FONode { * returns the name of the formatting object * @return the name of this formatting objects */ - public String getName() { - return this.name; - } + abstract public String getName(); /** * */ - protected void start() { - // do nothing by default - } +// protected void start() { +// // do nothing by default +// } /** * diff --git a/src/org/apache/fop/fo/FObjMixed.java b/src/org/apache/fop/fo/FObjMixed.java index 8e3990258..f159b0ed1 100644 --- a/src/org/apache/fop/fo/FObjMixed.java +++ b/src/org/apache/fop/fo/FObjMixed.java @@ -15,24 +15,13 @@ import org.apache.fop.apps.FOPException; * base class for representation of mixed content formatting objects * and their processing */ -public class FObjMixed extends FObj { +public abstract class FObjMixed extends FObj { // Textdecoration protected TextState ts; private StringBuffer textBuffer; - public static class Maker extends FObj.Maker { - public FObj make(FObj parent, - PropertyList propertyList) throws FOPException { - return new FObjMixed(parent, propertyList); - } - } - - public static FObj.Maker maker() { - return new FObjMixed.Maker(); - } - protected FObjMixed(FObj parent, PropertyList propertyList) { super(parent, propertyList); } diff --git a/src/org/apache/fop/fo/Title.java b/src/org/apache/fop/fo/Title.java index b55b0aeea..09c31feac 100644 --- a/src/org/apache/fop/fo/Title.java +++ b/src/org/apache/fop/fo/Title.java @@ -35,7 +35,10 @@ public class Title extends ToBeImplementedElement { protected Title(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:title"; + } + + public String getName() { + return "fo:title"; } public Status layout(Area area) throws FOPException { diff --git a/src/org/apache/fop/fo/ToBeImplementedElement.java b/src/org/apache/fop/fo/ToBeImplementedElement.java index f1df7e563..c9af684fc 100644 --- a/src/org/apache/fop/fo/ToBeImplementedElement.java +++ b/src/org/apache/fop/fo/ToBeImplementedElement.java @@ -16,7 +16,7 @@ import org.apache.fop.apps.FOPException; /** */ -public class ToBeImplementedElement extends FObj { +public abstract class ToBeImplementedElement extends FObj { protected ToBeImplementedElement(FObj parent, PropertyList propertyList) throws FOPException { @@ -24,8 +24,8 @@ public class ToBeImplementedElement extends FObj { } public Status layout(Area area) throws FOPException { - log.debug("This element \"" + this.name - + "\" is not yet implemented."); + log.debug("The element '" + this.getName() + + "' is not yet implemented."); return new Status(Status.OK); } diff --git a/src/org/apache/fop/fo/Unknown.java b/src/org/apache/fop/fo/Unknown.java index 43cd255e8..25a965de6 100644 --- a/src/org/apache/fop/fo/Unknown.java +++ b/src/org/apache/fop/fo/Unknown.java @@ -38,7 +38,10 @@ public class Unknown extends FObj { protected Unknown(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "unknown"; + } + + public String getName() { + return "(unknown)"; } public Status layout(Area area) throws FOPException { diff --git a/src/org/apache/fop/fo/UnknownXMLObj.java b/src/org/apache/fop/fo/UnknownXMLObj.java index 0110dd992..e3217f953 100644 --- a/src/org/apache/fop/fo/UnknownXMLObj.java +++ b/src/org/apache/fop/fo/UnknownXMLObj.java @@ -59,14 +59,9 @@ public class UnknownXMLObj extends XMLObj { * @param parent the parent formatting object * @param propertyList the explicit properties of this object */ - protected UnknownXMLObj(FObj parent, PropertyList propertyList, String space, String tag) { - super(parent, propertyList, tag); - this.namespace = space; - if(!"".equals(space)) { - this.name = this.namespace + ":" + tag; - } else { - this.name = "(none):" + tag; - } + protected UnknownXMLObj(FObj parent, PropertyList propertyList, String namespace, String name) { + super(parent, propertyList, name); + this.namespace = namespace; } public String getNameSpace() { @@ -92,10 +87,14 @@ public class UnknownXMLObj extends XMLObj { // this is an error //throw new FOPException("Foreign XML not in fo:instream-foreign-object"); //} - log.error("no handler defined for " + this.name + " foreign xml"); + log.error("no handler defined for " + this.getName() + " foreign xml"); /* return status */ return new Status(Status.OK); } + + public String getName() { + return ""+namespace+":"+tagName; + } } diff --git a/src/org/apache/fop/fo/XMLElement.java b/src/org/apache/fop/fo/XMLElement.java index dc8586414..518abbdb5 100644 --- a/src/org/apache/fop/fo/XMLElement.java +++ b/src/org/apache/fop/fo/XMLElement.java @@ -63,6 +63,10 @@ public class XMLElement extends XMLObj { init(); } + public String getName() { + return tagName; + } + /** * layout this formatting object. * diff --git a/src/org/apache/fop/fo/XMLObj.java b/src/org/apache/fop/fo/XMLObj.java index f4df1cb2b..644d7b6c0 100644 --- a/src/org/apache/fop/fo/XMLObj.java +++ b/src/org/apache/fop/fo/XMLObj.java @@ -27,7 +27,7 @@ import java.util.*; */ public abstract class XMLObj extends FObj { - protected String tagName = ""; + protected String tagName; protected Element element; protected Document doc; @@ -141,7 +141,7 @@ public abstract class XMLObj extends FObj { */ public Status layout(Area area) throws FOPException { /* generate a warning */ - log.error("" + this.name + " outside foreign xml"); + log.error("" + this.tagName + " outside foreign xml"); /* return status */ return new Status(Status.OK); diff --git a/src/org/apache/fop/fo/flow/BasicLink.java b/src/org/apache/fop/fo/flow/BasicLink.java index ae1bad695..08b82527d 100644 --- a/src/org/apache/fop/fo/flow/BasicLink.java +++ b/src/org/apache/fop/fo/flow/BasicLink.java @@ -25,7 +25,6 @@ public class BasicLink extends Inline { PropertyList propertyList) throws FOPException { return new BasicLink(parent, propertyList); } - } public static FObj.Maker maker() { @@ -35,7 +34,10 @@ public class BasicLink extends Inline { public BasicLink(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:basic-link"; + } + + public String getName() { + return "fo:basic-link"; } public Status layout(Area area) throws FOPException { diff --git a/src/org/apache/fop/fo/flow/BidiOverride.java b/src/org/apache/fop/fo/flow/BidiOverride.java index 5133369bf..6fba63f2f 100644 --- a/src/org/apache/fop/fo/flow/BidiOverride.java +++ b/src/org/apache/fop/fo/flow/BidiOverride.java @@ -24,7 +24,6 @@ public class BidiOverride extends ToBeImplementedElement { PropertyList propertyList) throws FOPException { return new BidiOverride(parent, propertyList); } - } public static FObj.Maker maker() { @@ -34,7 +33,10 @@ public class BidiOverride extends ToBeImplementedElement { protected BidiOverride(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:bidi-override"; + } + + public String getName() { + return "fo:bidi-override"; } public Status layout(Area area) throws FOPException { diff --git a/src/org/apache/fop/fo/flow/Block.java b/src/org/apache/fop/fo/flow/Block.java index 85a1ca0cd..b02a2392a 100644 --- a/src/org/apache/fop/fo/flow/Block.java +++ b/src/org/apache/fop/fo/flow/Block.java @@ -69,11 +69,14 @@ public class Block extends FObjMixed { throws FOPException { super(parent, propertyList); - this.name = "fo:block"; this.span = this.properties.get("span").getEnum(); ts = propMgr.getTextDecoration(parent); } + public String getName() { + return "fo:block"; + } + public Status layout(Area area) throws FOPException { BlockArea blockArea; diff --git a/src/org/apache/fop/fo/flow/BlockContainer.java b/src/org/apache/fop/fo/flow/BlockContainer.java index 1f165d3c8..53c122826 100644 --- a/src/org/apache/fop/fo/flow/BlockContainer.java +++ b/src/org/apache/fop/fo/flow/BlockContainer.java @@ -51,10 +51,13 @@ public class BlockContainer extends FObj { protected BlockContainer(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:block-container"; this.span = this.properties.get("span").getEnum(); } + public String getName() { + return "fo:block-container"; + } + public Status layout(Area area) throws FOPException { if (this.marker == START) { diff --git a/src/org/apache/fop/fo/flow/Character.java b/src/org/apache/fop/fo/flow/Character.java index ac8b870ab..b15423649 100644 --- a/src/org/apache/fop/fo/flow/Character.java +++ b/src/org/apache/fop/fo/flow/Character.java @@ -37,24 +37,24 @@ public class Character extends FObj { public final static int OK = 0; public final static int DOESNOT_FIT = 1; - public Character(FObj parent, PropertyList propertyList) { - super(parent, propertyList); - this.name = "fo:character"; - } - - public static FObj.Maker maker() { - return new Character.Maker(); - } - - public static class Maker extends FObj.Maker { public FObj make(FObj parent, PropertyList propertyList) throws FOPException { return new Character(parent, propertyList); } + } + + public static FObj.Maker maker() { + return new Character.Maker(); + } + public Character(FObj parent, PropertyList propertyList) { + super(parent, propertyList); } + public String getName() { + return "fo:character"; + } public Status layout(Area area) throws FOPException { BlockArea blockArea; diff --git a/src/org/apache/fop/fo/flow/ExternalGraphic.java b/src/org/apache/fop/fo/flow/ExternalGraphic.java index e5ce14930..469089865 100644 --- a/src/org/apache/fop/fo/flow/ExternalGraphic.java +++ b/src/org/apache/fop/fo/flow/ExternalGraphic.java @@ -36,12 +36,24 @@ public class ExternalGraphic extends FObj { ImageArea imageArea; + public static class Maker extends FObj.Maker { + public FObj make(FObj parent, + PropertyList propertyList) throws FOPException { + return new ExternalGraphic(parent, propertyList); + } + } + + public static FObj.Maker maker() { + return new ExternalGraphic.Maker(); + } public ExternalGraphic(FObj parent, PropertyList propertyList) { super(parent, propertyList); - this.name = "fo:external-graphic"; } + public String getName() { + return "fo:external-graphic"; + } public Status layout(Area area) throws FOPException { @@ -251,18 +263,5 @@ public class ExternalGraphic extends FObj { return new Status(Status.OK); } - - public static FObj.Maker maker() { - return new ExternalGraphic.Maker(); - } - - - public static class Maker extends FObj.Maker { - public FObj make(FObj parent, - PropertyList propertyList) throws FOPException { - return new ExternalGraphic(parent, propertyList); - } - - } } diff --git a/src/org/apache/fop/fo/flow/Float.java b/src/org/apache/fop/fo/flow/Float.java index b88e7873c..c913704c4 100644 --- a/src/org/apache/fop/fo/flow/Float.java +++ b/src/org/apache/fop/fo/flow/Float.java @@ -33,7 +33,10 @@ public class Float extends ToBeImplementedElement { protected Float(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:float"; + } + + public String getName() { + return "fo:float"; } public Status layout(Area area) throws FOPException { diff --git a/src/org/apache/fop/fo/flow/Flow.java b/src/org/apache/fop/fo/flow/Flow.java index 2e1f042a8..a1752758d 100644 --- a/src/org/apache/fop/fo/flow/Flow.java +++ b/src/org/apache/fop/fo/flow/Flow.java @@ -65,13 +65,11 @@ public class Flow extends FObj { protected Flow(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = getElementName(); if (parent.getName().equals("fo:page-sequence")) { this.pageSequence = (PageSequence)parent; } else { - throw new FOPException("flow must be child of " - + "page-sequence, not " + throw new FOPException("flow must be child of page-sequence, not " + parent.getName()); } setFlowName(getProperty("flow-name").getString()); @@ -82,21 +80,25 @@ public class Flow extends FObj { // fo:flow per fo:page-sequence only. if (pageSequence.isFlowSet()) { - if (this.name.equals("fo:flow")) { + if (getName().equals("fo:flow")) { throw new FOPException("Only a single fo:flow permitted" + " per fo:page-sequence"); } else { - throw new FOPException(this.name + throw new FOPException(getName() + " not allowed after fo:flow"); } } pageSequence.addFlow(this); } + public String getName() { + return "fo:flow"; + } + protected void setFlowName(String name) throws FOPException { if (name == null || name.equals("")) { log.warn("A 'flow-name' is required for " - + getElementName() + + getName() + ". This constraint will be enforced in future versions of FOP"); _flowName = "xsl-region-body"; } else { @@ -218,10 +220,6 @@ public class Flow extends FObj { return this.contentWidth; } - protected String getElementName() { - return "fo:flow"; - } - public Status getStatus() { return _status; } diff --git a/src/org/apache/fop/fo/flow/Footnote.java b/src/org/apache/fop/fo/flow/Footnote.java index 3348b730d..d22909e3c 100644 --- a/src/org/apache/fop/fo/flow/Footnote.java +++ b/src/org/apache/fop/fo/flow/Footnote.java @@ -35,7 +35,10 @@ public class Footnote extends FObj { public Footnote(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:footnote"; + } + + public String getName() { + return "fo:footnote"; } public Status layout(Area area) throws FOPException { diff --git a/src/org/apache/fop/fo/flow/FootnoteBody.java b/src/org/apache/fop/fo/flow/FootnoteBody.java index 029ea5b92..ad6975147 100644 --- a/src/org/apache/fop/fo/flow/FootnoteBody.java +++ b/src/org/apache/fop/fo/flow/FootnoteBody.java @@ -42,10 +42,13 @@ public class FootnoteBody extends FObj { public FootnoteBody(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:footnote-body"; this.areaClass = AreaClass.setAreaClass(AreaClass.XSL_FOOTNOTE); } + public String getName() { + return "fo:footnote-body"; + } + public Status layout(Area area) throws FOPException { if (this.marker == START) { this.marker = 0; diff --git a/src/org/apache/fop/fo/flow/InitialPropertySet.java b/src/org/apache/fop/fo/flow/InitialPropertySet.java index aa53341a3..ca1d7998c 100644 --- a/src/org/apache/fop/fo/flow/InitialPropertySet.java +++ b/src/org/apache/fop/fo/flow/InitialPropertySet.java @@ -34,7 +34,10 @@ public class InitialPropertySet extends ToBeImplementedElement { protected InitialPropertySet(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:initial-property-set"; + } + + public String getName() { + return "fo:initial-property-set"; } public Status layout(Area area) throws FOPException { diff --git a/src/org/apache/fop/fo/flow/Inline.java b/src/org/apache/fop/fo/flow/Inline.java index 93ae968df..fa67bdb67 100644 --- a/src/org/apache/fop/fo/flow/Inline.java +++ b/src/org/apache/fop/fo/flow/Inline.java @@ -33,7 +33,6 @@ public class Inline extends FObjMixed { public Inline(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:inline"; if (parent.getName().equals("fo:flow")) { throw new FOPException("inline formatting objects cannot" + " be directly under flow"); @@ -77,4 +76,9 @@ public class Inline extends FObjMixed { ts = propMgr.getTextDecoration(parent); } + + public String getName() { + return "fo:inline"; + } + } diff --git a/src/org/apache/fop/fo/flow/InlineContainer.java b/src/org/apache/fop/fo/flow/InlineContainer.java index 61aba7695..4eba7fa47 100644 --- a/src/org/apache/fop/fo/flow/InlineContainer.java +++ b/src/org/apache/fop/fo/flow/InlineContainer.java @@ -23,7 +23,6 @@ public class InlineContainer extends ToBeImplementedElement { PropertyList propertyList) throws FOPException { return new InlineContainer(parent, propertyList); } - } public static FObj.Maker maker() { @@ -33,7 +32,6 @@ public class InlineContainer extends ToBeImplementedElement { protected InlineContainer(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:inline-container"; // Common Border, Padding, and Background Properties BorderAndPadding bap = propMgr.getBorderAndPadding(); @@ -66,4 +64,8 @@ public class InlineContainer extends ToBeImplementedElement { // this.properties.get("writing-mode"); } + public String getName() { + return "fo:inline-container"; + } + } diff --git a/src/org/apache/fop/fo/flow/InstreamForeignObject.java b/src/org/apache/fop/fo/flow/InstreamForeignObject.java index 27f9dc1c4..64776ad65 100644 --- a/src/org/apache/fop/fo/flow/InstreamForeignObject.java +++ b/src/org/apache/fop/fo/flow/InstreamForeignObject.java @@ -76,7 +76,10 @@ public class InstreamForeignObject extends FObj { */ public InstreamForeignObject(FObj parent, PropertyList propertyList) { super(parent, propertyList); - this.name = "fo:instream-foreign-object"; + } + + public String getName() { + return "fo:instream-foreign-object"; } /** diff --git a/src/org/apache/fop/fo/flow/Leader.java b/src/org/apache/fop/fo/flow/Leader.java index 2e6d3dbfa..55b08acba 100644 --- a/src/org/apache/fop/fo/flow/Leader.java +++ b/src/org/apache/fop/fo/flow/Leader.java @@ -40,7 +40,10 @@ public class Leader extends FObjMixed { public Leader(FObj parent, PropertyList propertyList) { super(parent, propertyList); - this.name = "fo:leader"; + } + + public String getName() { + return "fo:leader"; } public Status layout(Area area) throws FOPException { diff --git a/src/org/apache/fop/fo/flow/ListBlock.java b/src/org/apache/fop/fo/flow/ListBlock.java index e414b6bb5..58b5160a8 100644 --- a/src/org/apache/fop/fo/flow/ListBlock.java +++ b/src/org/apache/fop/fo/flow/ListBlock.java @@ -46,7 +46,10 @@ public class ListBlock extends FObj { public ListBlock(FObj parent, PropertyList propertyList) { super(parent, propertyList); - this.name = "fo:list-block"; + } + + public String getName() { + return "fo:list-block"; } public Status layout(Area area) throws FOPException { diff --git a/src/org/apache/fop/fo/flow/ListItem.java b/src/org/apache/fop/fo/flow/ListItem.java index 683a2b024..320b0acd5 100644 --- a/src/org/apache/fop/fo/flow/ListItem.java +++ b/src/org/apache/fop/fo/flow/ListItem.java @@ -46,7 +46,10 @@ public class ListItem extends FObj { public ListItem(FObj parent, PropertyList propertyList) { super(parent, propertyList); - this.name = "fo:list-item"; + } + + public String getName() { + return "fo:list-item"; } public Status layout(Area area) throws FOPException { diff --git a/src/org/apache/fop/fo/flow/ListItemBody.java b/src/org/apache/fop/fo/flow/ListItemBody.java index fa00c4b4d..0e4d7e7bc 100644 --- a/src/org/apache/fop/fo/flow/ListItemBody.java +++ b/src/org/apache/fop/fo/flow/ListItemBody.java @@ -33,7 +33,10 @@ public class ListItemBody extends FObj { public ListItemBody(FObj parent, PropertyList propertyList) { super(parent, propertyList); - this.name = "fo:list-item-body"; + } + + public String getName() { + return "fo:list-item-body"; } public Status layout(Area area) throws FOPException { diff --git a/src/org/apache/fop/fo/flow/ListItemLabel.java b/src/org/apache/fop/fo/flow/ListItemLabel.java index a649459d3..8f8a3ba23 100644 --- a/src/org/apache/fop/fo/flow/ListItemLabel.java +++ b/src/org/apache/fop/fo/flow/ListItemLabel.java @@ -33,7 +33,10 @@ public class ListItemLabel extends FObj { public ListItemLabel(FObj parent, PropertyList propertyList) { super(parent, propertyList); - this.name = "fo:list-item-label"; + } + + public String getName() { + return "fo:list-item-label"; } public Status layout(Area area) throws FOPException { diff --git a/src/org/apache/fop/fo/flow/Marker.java b/src/org/apache/fop/fo/flow/Marker.java index 0eb0baaa5..309ba5118 100644 --- a/src/org/apache/fop/fo/flow/Marker.java +++ b/src/org/apache/fop/fo/flow/Marker.java @@ -33,7 +33,6 @@ public class Marker extends FObjMixed { public Marker(FObj parent, PropertyList propertyList) { super(parent, propertyList); - this.name = "fo:marker"; // do check to see that 'this' is under fo:flow @@ -51,6 +50,10 @@ public class Marker extends FObjMixed { } } + public String getName() { + return "fo:marker"; + } + public Status layout(Area area) throws FOPException { // no layout action desired this.registryArea = area; diff --git a/src/org/apache/fop/fo/flow/MultiCase.java b/src/org/apache/fop/fo/flow/MultiCase.java index d3c0884c2..5dc5d56bb 100644 --- a/src/org/apache/fop/fo/flow/MultiCase.java +++ b/src/org/apache/fop/fo/flow/MultiCase.java @@ -23,7 +23,6 @@ public class MultiCase extends ToBeImplementedElement { PropertyList propertyList) throws FOPException { return new MultiCase(parent, propertyList); } - } public static FObj.Maker maker() { @@ -33,7 +32,10 @@ public class MultiCase extends ToBeImplementedElement { protected MultiCase(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:multi-case"; + } + + public String getName() { + return "fo:multi-case"; } public Status layout(Area area) throws FOPException { diff --git a/src/org/apache/fop/fo/flow/MultiProperties.java b/src/org/apache/fop/fo/flow/MultiProperties.java index 19cd50019..8849f879f 100644 --- a/src/org/apache/fop/fo/flow/MultiProperties.java +++ b/src/org/apache/fop/fo/flow/MultiProperties.java @@ -33,7 +33,10 @@ public class MultiProperties extends ToBeImplementedElement { protected MultiProperties(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:multi-properties"; + } + + public String getName() { + return "fo:multi-properties"; } public Status layout(Area area) throws FOPException { diff --git a/src/org/apache/fop/fo/flow/MultiPropertySet.java b/src/org/apache/fop/fo/flow/MultiPropertySet.java index f9c9fb96e..ca501a260 100644 --- a/src/org/apache/fop/fo/flow/MultiPropertySet.java +++ b/src/org/apache/fop/fo/flow/MultiPropertySet.java @@ -33,7 +33,10 @@ public class MultiPropertySet extends ToBeImplementedElement { protected MultiPropertySet(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:multi-property-set"; + } + + public String getName() { + return "fo:multi-property-set"; } public Status layout(Area area) throws FOPException { diff --git a/src/org/apache/fop/fo/flow/MultiSwitch.java b/src/org/apache/fop/fo/flow/MultiSwitch.java index eabd80535..1fec9402f 100644 --- a/src/org/apache/fop/fo/flow/MultiSwitch.java +++ b/src/org/apache/fop/fo/flow/MultiSwitch.java @@ -33,7 +33,10 @@ public class MultiSwitch extends ToBeImplementedElement { protected MultiSwitch(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:multi-switch"; + } + + public String getName() { + return "fo:multi-switch"; } public Status layout(Area area) throws FOPException { diff --git a/src/org/apache/fop/fo/flow/MultiToggle.java b/src/org/apache/fop/fo/flow/MultiToggle.java index f49fcd170..ef9cc2b09 100644 --- a/src/org/apache/fop/fo/flow/MultiToggle.java +++ b/src/org/apache/fop/fo/flow/MultiToggle.java @@ -33,7 +33,10 @@ public class MultiToggle extends ToBeImplementedElement { protected MultiToggle(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:multi-toggle"; + } + + public String getName() { + return "fo:multi-toggle"; } public Status layout(Area area) throws FOPException { diff --git a/src/org/apache/fop/fo/flow/PageNumber.java b/src/org/apache/fop/fo/flow/PageNumber.java index 81b807a15..c721e3942 100644 --- a/src/org/apache/fop/fo/flow/PageNumber.java +++ b/src/org/apache/fop/fo/flow/PageNumber.java @@ -41,7 +41,10 @@ public class PageNumber extends FObj { public PageNumber(FObj parent, PropertyList propertyList) { super(parent, propertyList); - this.name = "fo:page-number"; + } + + public String getName() { + return "fo:page-number"; } public Status layout(Area area) throws FOPException { diff --git a/src/org/apache/fop/fo/flow/PageNumberCitation.java b/src/org/apache/fop/fo/flow/PageNumberCitation.java index 447149cce..569d91407 100644 --- a/src/org/apache/fop/fo/flow/PageNumberCitation.java +++ b/src/org/apache/fop/fo/flow/PageNumberCitation.java @@ -98,9 +98,11 @@ public class PageNumberCitation extends FObj { public PageNumberCitation(FObj parent, PropertyList propertyList) { super(parent, propertyList); - this.name = "fo:page-number-citation"; } + public String getName() { + return "fo:page-number-citation"; + } public Status layout(Area area) throws FOPException { if (!(area instanceof BlockArea)) { diff --git a/src/org/apache/fop/fo/flow/RetrieveMarker.java b/src/org/apache/fop/fo/flow/RetrieveMarker.java index bfb7545ec..c63bbf85a 100644 --- a/src/org/apache/fop/fo/flow/RetrieveMarker.java +++ b/src/org/apache/fop/fo/flow/RetrieveMarker.java @@ -17,7 +17,7 @@ import org.apache.fop.apps.FOPException; // Java import java.util.Vector; -public class RetrieveMarker extends FObjMixed { +public class RetrieveMarker extends FObj { private String retrieveClassName; private int retrievePosition; @@ -37,7 +37,6 @@ public class RetrieveMarker extends FObjMixed { public RetrieveMarker(FObj parent, PropertyList propertyList) { super(parent, propertyList); - this.name = "fo:retrieve-marker"; this.retrieveClassName = this.properties.get("retrieve-class-name").getString(); @@ -47,6 +46,10 @@ public class RetrieveMarker extends FObjMixed { this.properties.get("retrieve-boundary").getEnum(); } + public String getName() { + return "fo:retrieve-marker"; + } + public Status layout(Area area) throws FOPException { // locate qualifying areas by 'marker-class-name' and // 'retrieve-boundary'. Initially we will always check diff --git a/src/org/apache/fop/fo/flow/StaticContent.java b/src/org/apache/fop/fo/flow/StaticContent.java index 9e50e242b..504b8ad05 100644 --- a/src/org/apache/fop/fo/flow/StaticContent.java +++ b/src/org/apache/fop/fo/flow/StaticContent.java @@ -37,6 +37,10 @@ public class StaticContent extends Flow { ((PageSequence)parent).setIsFlowSet(false); // hacquery of sorts } + public String getName() { + return "fo:static-content"; + } + public Status layout(Area area) throws FOPException { return layout(area, null); } @@ -90,15 +94,11 @@ public class StaticContent extends Flow { return new Status(Status.OK); } - protected String getElementName() { - return "fo:static-content"; - } - // flowname checking is more stringient for static content currently protected void setFlowName(String name) throws FOPException { if (name == null || name.equals("")) { throw new FOPException("A 'flow-name' is required for " - + getElementName() + "."); + + getName() + "."); } else { super.setFlowName(name); } diff --git a/src/org/apache/fop/fo/flow/Table.java b/src/org/apache/fop/fo/flow/Table.java index c2a0c4479..7254c0c2e 100644 --- a/src/org/apache/fop/fo/flow/Table.java +++ b/src/org/apache/fop/fo/flow/Table.java @@ -60,7 +60,10 @@ public class Table extends FObj { public Table(FObj parent, PropertyList propertyList) { super(parent, propertyList); - this.name = "fo:table"; + } + + public String getName() { + return "fo:table"; } public Status layout(Area area) throws FOPException { diff --git a/src/org/apache/fop/fo/flow/TableAndCaption.java b/src/org/apache/fop/fo/flow/TableAndCaption.java index d7cbebf20..96258035e 100644 --- a/src/org/apache/fop/fo/flow/TableAndCaption.java +++ b/src/org/apache/fop/fo/flow/TableAndCaption.java @@ -33,7 +33,10 @@ public class TableAndCaption extends ToBeImplementedElement { protected TableAndCaption(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:table-and-caption"; + } + + public String getName() { + return "fo:table-and-caption"; } public Status layout(Area area) throws FOPException { diff --git a/src/org/apache/fop/fo/flow/TableBody.java b/src/org/apache/fop/fo/flow/TableBody.java index 185e4bdf6..7c889d126 100644 --- a/src/org/apache/fop/fo/flow/TableBody.java +++ b/src/org/apache/fop/fo/flow/TableBody.java @@ -35,7 +35,10 @@ public class TableBody extends AbstractTableBody { public TableBody(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:table-body"; + } + + public String getName() { + return "fo:table-body"; } } diff --git a/src/org/apache/fop/fo/flow/TableCaption.java b/src/org/apache/fop/fo/flow/TableCaption.java index 396f08863..a6cb29286 100644 --- a/src/org/apache/fop/fo/flow/TableCaption.java +++ b/src/org/apache/fop/fo/flow/TableCaption.java @@ -33,7 +33,10 @@ public class TableCaption extends ToBeImplementedElement { protected TableCaption(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:table-caption"; + } + + public String getName() { + return "fo:table-caption"; } public Status layout(Area area) throws FOPException { diff --git a/src/org/apache/fop/fo/flow/TableCell.java b/src/org/apache/fop/fo/flow/TableCell.java index 83571ae4a..161aa4a14 100644 --- a/src/org/apache/fop/fo/flow/TableCell.java +++ b/src/org/apache/fop/fo/flow/TableCell.java @@ -98,7 +98,6 @@ public class TableCell extends FObj { public TableCell(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:table-cell"; if (!(parent instanceof TableRow)) { throw new FOPException("A table cell must be child of fo:table-row," + " not " + parent.getName()); @@ -106,6 +105,10 @@ public class TableCell extends FObj { doSetup(); // init some basic property values } + public String getName() { + return "fo:table-cell"; + } + // Set position relative to table (set by body?) public void setStartOffset(int offset) { startOffset = offset; diff --git a/src/org/apache/fop/fo/flow/TableColumn.java b/src/org/apache/fop/fo/flow/TableColumn.java index 2a3b4a0e1..42a944b85 100644 --- a/src/org/apache/fop/fo/flow/TableColumn.java +++ b/src/org/apache/fop/fo/flow/TableColumn.java @@ -31,7 +31,6 @@ public class TableColumn extends FObj { PropertyList propertyList) throws FOPException { return new TableColumn(parent, propertyList); } - } public static FObj.Maker maker() { @@ -41,13 +40,16 @@ public class TableColumn extends FObj { public TableColumn(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:table-column"; if (!(parent instanceof Table)) { throw new FOPException("A table column must be child of fo:table, not " + parent.getName()); } } + public String getName() { + return "fo:table-column"; + } + public Length getColumnWidthAsLength() { return columnWidthPropVal; } diff --git a/src/org/apache/fop/fo/flow/TableFooter.java b/src/org/apache/fop/fo/flow/TableFooter.java index 4273f551e..15502dc75 100644 --- a/src/org/apache/fop/fo/flow/TableFooter.java +++ b/src/org/apache/fop/fo/flow/TableFooter.java @@ -35,7 +35,10 @@ public class TableFooter extends AbstractTableBody { public TableFooter(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:table-footer"; + } + + public String getName() { + return "fo:table-footer"; } public int getYPosition() { diff --git a/src/org/apache/fop/fo/flow/TableHeader.java b/src/org/apache/fop/fo/flow/TableHeader.java index e13864d59..c91ac2c1c 100644 --- a/src/org/apache/fop/fo/flow/TableHeader.java +++ b/src/org/apache/fop/fo/flow/TableHeader.java @@ -35,7 +35,10 @@ public class TableHeader extends AbstractTableBody { public TableHeader(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:table-header"; + } + + public String getName() { + return "fo:table-header"; } } diff --git a/src/org/apache/fop/fo/flow/TableRow.java b/src/org/apache/fop/fo/flow/TableRow.java index 2eb4e75bd..12f76cc5d 100644 --- a/src/org/apache/fop/fo/flow/TableRow.java +++ b/src/org/apache/fop/fo/flow/TableRow.java @@ -174,7 +174,6 @@ public class TableRow extends FObj { public TableRow(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:table-row"; if (!(parent instanceof AbstractTableBody)) { throw new FOPException("A table row must be child of fo:table-body," + " fo:table-header or fo:table-footer, not " @@ -182,6 +181,10 @@ public class TableRow extends FObj { } } + public String getName() { + return "fo:table-row"; + } + public void setColumns(Vector columns) { this.columns = columns; } diff --git a/src/org/apache/fop/fo/flow/Wrapper.java b/src/org/apache/fop/fo/flow/Wrapper.java index 59f793445..fafb36d88 100644 --- a/src/org/apache/fop/fo/flow/Wrapper.java +++ b/src/org/apache/fop/fo/flow/Wrapper.java @@ -34,6 +34,10 @@ public class Wrapper extends FObjMixed { return new Wrapper.Maker(); } + public String getName() { + return "fo:wrapper"; + } + public Wrapper(FObj parent, PropertyList propertyList) { super(parent, propertyList); // check that this occurs inside an fo:flow diff --git a/src/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java b/src/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java index bd6c9a2a4..d84fc1327 100644 --- a/src/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java +++ b/src/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java @@ -37,7 +37,6 @@ public class ConditionalPageMasterReference extends FObj { throws FOPException { super(parent, propertyList); - this.name = "fo:conditional-page-master-reference"; if (getProperty("master-reference") != null) { this.masterName = getProperty("master-reference").getString(); } @@ -59,6 +58,10 @@ public class ConditionalPageMasterReference extends FObj { this.blankOrNotBlank = this.properties.get("blank-or-not-blank").getEnum(); } + public String getName() { + return "fo:conditional-page-master-reference"; + } + protected boolean isValid(boolean isOddPage, boolean isFirstPage, boolean isEmptyPage) { // page-position diff --git a/src/org/apache/fop/fo/pagination/LayoutMasterSet.java b/src/org/apache/fop/fo/pagination/LayoutMasterSet.java index 1c5b85118..7953de2fa 100644 --- a/src/org/apache/fop/fo/pagination/LayoutMasterSet.java +++ b/src/org/apache/fop/fo/pagination/LayoutMasterSet.java @@ -23,7 +23,6 @@ public class LayoutMasterSet extends FObj { PropertyList propertyList) throws FOPException { return new LayoutMasterSet(parent, propertyList); } - } public static FObj.Maker maker() { @@ -39,7 +38,6 @@ public class LayoutMasterSet extends FObj { protected LayoutMasterSet(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:layout-master-set"; this.simplePageMasters = new Hashtable(); this.pageSequenceMasters = new Hashtable(); @@ -55,6 +53,10 @@ public class LayoutMasterSet extends FObj { } + public String getName() { + return "fo:layout-master-set"; + } + protected void addSimplePageMaster(SimplePageMaster simplePageMaster) throws FOPException { // check against duplication of master-name @@ -148,5 +150,4 @@ public class LayoutMasterSet extends FObj { return result; } - } diff --git a/src/org/apache/fop/fo/pagination/PageSequence.java b/src/org/apache/fop/fo/pagination/PageSequence.java index 4e7900c54..36fe422d9 100644 --- a/src/org/apache/fop/fo/pagination/PageSequence.java +++ b/src/org/apache/fop/fo/pagination/PageSequence.java @@ -121,7 +121,6 @@ public class PageSequence extends FObj { protected PageSequence(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:page-sequence"; if (parent.getName().equals("fo:root")) { this.root = (Root)parent; @@ -177,6 +176,9 @@ public class PageSequence extends FObj { // this.properties.get("id"); } + public String getName() { + return "fo:page-sequence"; + } public void addFlow(Flow flow) throws FOPException { if (_flowMap.containsKey(flow.getFlowName())) { diff --git a/src/org/apache/fop/fo/pagination/PageSequenceMaster.java b/src/org/apache/fop/fo/pagination/PageSequenceMaster.java index c36b14f31..2bb7c37c5 100644 --- a/src/org/apache/fop/fo/pagination/PageSequenceMaster.java +++ b/src/org/apache/fop/fo/pagination/PageSequenceMaster.java @@ -45,7 +45,6 @@ public class PageSequenceMaster extends FObj { protected PageSequenceMaster(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:page-sequence-master"; if (parent.getName().equals("fo:layout-master-set")) { this.layoutMasterSet = (LayoutMasterSet)parent; @@ -133,4 +132,9 @@ public class PageSequenceMaster extends FObj { } return pageMaster; } + + public String getName() { + return "fo:page-sequence-master"; + } + } diff --git a/src/org/apache/fop/fo/pagination/Region.java b/src/org/apache/fop/fo/pagination/Region.java index 18c2d6d15..e5925a900 100644 --- a/src/org/apache/fop/fo/pagination/Region.java +++ b/src/org/apache/fop/fo/pagination/Region.java @@ -25,7 +25,6 @@ public abstract class Region extends FObj { protected Region(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = getElementName(); // regions may have name, or default if (null == this.properties.get(PROP_REGION_NAME)) { @@ -38,7 +37,7 @@ public abstract class Region extends FObj { if (isReserved(getRegionName()) &&!getRegionName().equals(getDefaultRegionName())) { throw new FOPException(PROP_REGION_NAME + " '" + _regionName - + "' for " + this.name + + "' for " + this.getName() + " not permitted."); } } @@ -47,7 +46,7 @@ public abstract class Region extends FObj { _layoutMaster = (SimplePageMaster)parent; getPageMaster().addRegion(this); } else { - throw new FOPException(getElementName() + " must be child " + throw new FOPException(getName() + " must be child " + "of simple-page-master, not " + parent.getName()); } @@ -67,12 +66,6 @@ public abstract class Region extends FObj { */ protected abstract String getDefaultRegionName(); - /** - * Returns the element name ("fo:region-body", "fo:region-start", - * etc.) - */ - protected abstract String getElementName(); - public abstract String getRegionClass(); diff --git a/src/org/apache/fop/fo/pagination/RegionAfter.java b/src/org/apache/fop/fo/pagination/RegionAfter.java index 3d2733423..251cbd822 100644 --- a/src/org/apache/fop/fo/pagination/RegionAfter.java +++ b/src/org/apache/fop/fo/pagination/RegionAfter.java @@ -39,6 +39,10 @@ public class RegionAfter extends Region { precedence = this.properties.get("precedence").getEnum(); } + public String getName() { + return "fo:region-after"; + } + RegionArea makeRegionArea(int allocationRectangleXPosition, int allocationRectangleYPosition, int allocationRectangleWidth, @@ -84,10 +88,6 @@ public class RegionAfter extends Region { return "xsl-region-after"; } - protected String getElementName() { - return "fo:region-after"; - } - public String getRegionClass() { return REGION_CLASS; } diff --git a/src/org/apache/fop/fo/pagination/RegionBefore.java b/src/org/apache/fop/fo/pagination/RegionBefore.java index 41c280a2a..a62303e45 100644 --- a/src/org/apache/fop/fo/pagination/RegionBefore.java +++ b/src/org/apache/fop/fo/pagination/RegionBefore.java @@ -40,6 +40,10 @@ public class RegionBefore extends Region { } + public String getName() { + return "fo:region-before"; + } + RegionArea makeRegionArea(int allocationRectangleXPosition, int allocationRectangleYPosition, int allocationRectangleWidth, @@ -84,10 +88,6 @@ public class RegionBefore extends Region { return "xsl-region-before"; } - protected String getElementName() { - return "fo:region-before"; - } - public String getRegionClass() { return REGION_CLASS; } diff --git a/src/org/apache/fop/fo/pagination/RegionBody.java b/src/org/apache/fop/fo/pagination/RegionBody.java index 6f5200390..782aca9c3 100644 --- a/src/org/apache/fop/fo/pagination/RegionBody.java +++ b/src/org/apache/fop/fo/pagination/RegionBody.java @@ -40,6 +40,10 @@ public class RegionBody extends Region { super(parent, propertyList); } + public String getName() { + return "fo:region-body"; + } + RegionArea makeRegionArea(int allocationRectangleXPosition, int allocationRectangleYPosition, int allocationRectangleWidth, @@ -101,10 +105,6 @@ public class RegionBody extends Region { return "xsl-region-body"; } - protected String getElementName() { - return "fo:region-body"; - } - public String getRegionClass() { return REGION_CLASS; } diff --git a/src/org/apache/fop/fo/pagination/RegionEnd.java b/src/org/apache/fop/fo/pagination/RegionEnd.java index 207c8ea29..d32237182 100644 --- a/src/org/apache/fop/fo/pagination/RegionEnd.java +++ b/src/org/apache/fop/fo/pagination/RegionEnd.java @@ -37,6 +37,9 @@ public class RegionEnd extends Region { super(parent, propertyList); } + public String getName() { + return "fo:region-end"; + } RegionArea makeRegionArea(int allocationRectangleXPosition, int allocationRectangleYPosition, @@ -90,10 +93,6 @@ public class RegionEnd extends Region { return "xsl-region-end"; } - protected String getElementName() { - return "fo:region-end"; - } - public String getRegionClass() { return REGION_CLASS; } diff --git a/src/org/apache/fop/fo/pagination/RegionStart.java b/src/org/apache/fop/fo/pagination/RegionStart.java index f8b62cdcc..be7c36a1c 100644 --- a/src/org/apache/fop/fo/pagination/RegionStart.java +++ b/src/org/apache/fop/fo/pagination/RegionStart.java @@ -37,6 +37,9 @@ public class RegionStart extends Region { super(parent, propertyList); } + public String getName() { + return "fo:region-start"; + } RegionArea makeRegionArea(int allocationRectangleXPosition, int allocationRectangleYPosition, @@ -88,10 +91,6 @@ public class RegionStart extends Region { return "xsl-region-start"; } - protected String getElementName() { - return "fo:region-start"; - } - public String getRegionClass() { return REGION_CLASS; } diff --git a/src/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java b/src/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java index db5734cbc..f29add4c2 100644 --- a/src/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java +++ b/src/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java @@ -45,7 +45,6 @@ public class RepeatablePageMasterAlternatives extends FObj public RepeatablePageMasterAlternatives(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:repeatable-page-master-alternatives"; if (parent.getName().equals("fo:page-sequence-master")) { this.pageSequenceMaster = (PageSequenceMaster)parent; @@ -74,6 +73,10 @@ public class RepeatablePageMasterAlternatives extends FObj conditionalPageMasterRefs = new Vector(); } + public String getName() { + return "fo:repeatable-page-master-alternatives"; + } + public void addConditionalPageMasterReference(ConditionalPageMasterReference cpmr) { this.conditionalPageMasterRefs.addElement(cpmr); } diff --git a/src/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java b/src/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java index c4ed974c2..7f95587a3 100644 --- a/src/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java +++ b/src/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java @@ -33,7 +33,6 @@ public class RepeatablePageMasterReference extends PageMasterReference public RepeatablePageMasterReference(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - name = "fo:repeatable-page-master-reference"; if (getProperty("master-reference") != null) { this.masterName = getProperty("master-reference").getString(); if (parent.getName().equals("fo:page-sequence-master")) { @@ -63,6 +62,10 @@ public class RepeatablePageMasterReference extends PageMasterReference } } + public String getName() { + return "fo:repeatable-page-master-reference"; + } + public String getNextPageMasterName(boolean isOddPage, boolean isFirstPage, boolean isEmptyPage) { diff --git a/src/org/apache/fop/fo/pagination/Root.java b/src/org/apache/fop/fo/pagination/Root.java index f6ce83bf4..07c7434a6 100644 --- a/src/org/apache/fop/fo/pagination/Root.java +++ b/src/org/apache/fop/fo/pagination/Root.java @@ -47,8 +47,6 @@ public class Root extends FObj { protected Root(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:root"; - // this.properties.get("media-usage"); if (parent != null) { @@ -71,4 +69,8 @@ public class Root extends FObj { public void setLayoutMasterSet(LayoutMasterSet layoutMasterSet) { this.layoutMasterSet = layoutMasterSet; } + + public String getName() { + return "fo:root"; + } } diff --git a/src/org/apache/fop/fo/pagination/SimplePageMaster.java b/src/org/apache/fop/fo/pagination/SimplePageMaster.java index 2eaef15e4..c6600d1f3 100644 --- a/src/org/apache/fop/fo/pagination/SimplePageMaster.java +++ b/src/org/apache/fop/fo/pagination/SimplePageMaster.java @@ -50,7 +50,6 @@ public class SimplePageMaster extends FObj { protected SimplePageMaster(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:simple-page-master"; if (parent.getName().equals("fo:layout-master-set")) { this.layoutMasterSet = (LayoutMasterSet)parent; @@ -70,6 +69,10 @@ public class SimplePageMaster extends FObj { } + public String getName() { + return "fo:simple-page-master"; + } + protected void end() { int pageWidth = this.properties.get("page-width").getLength().mvalue(); diff --git a/src/org/apache/fop/fo/pagination/SinglePageMasterReference.java b/src/org/apache/fop/fo/pagination/SinglePageMasterReference.java index 303b1b7be..7e60f54fe 100644 --- a/src/org/apache/fop/fo/pagination/SinglePageMasterReference.java +++ b/src/org/apache/fop/fo/pagination/SinglePageMasterReference.java @@ -31,7 +31,6 @@ public class SinglePageMasterReference extends PageMasterReference { public SinglePageMasterReference(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); - this.name = "fo:single-page-master-reference"; if (getProperty("master-reference") != null) { this.masterName = getProperty("master-reference").getString(); if (parent.getName().equals("fo:page-sequence-master")) { @@ -47,6 +46,10 @@ public class SinglePageMasterReference extends PageMasterReference { this.state = FIRST; } + public String getName() { + return "fo:single-page-master-reference"; + } + public String getNextPageMasterName(boolean isOddPage, boolean isFirstPage, boolean isEmptyPage) { diff --git a/src/org/apache/fop/svg/SVGObj.java b/src/org/apache/fop/svg/SVGObj.java index 78a84bdda..48e73607b 100644 --- a/src/org/apache/fop/svg/SVGObj.java +++ b/src/org/apache/fop/svg/SVGObj.java @@ -56,7 +56,10 @@ public class SVGObj extends XMLObj { */ protected SVGObj(FObj parent, PropertyList propertyList, String tag) { super(parent, propertyList, tag); - this.name = "svg:" + tag; + } + + public String getName() { + return "svg:"+tagName; } public String getNameSpace() {