From 97581a9081ec184b9755bdc07ce049df9419ca06 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Fri, 11 Nov 2005 13:27:34 +0000 Subject: Made the FO tree a little more consistent by renaming getName() to getLocalName() and adding additional methods like: getNamespaceURI() and getNormalNamespacePrefix(). getName() now returns the fully qualified name combined from getLocalName() and getNormalNamespacePrefix(). For special cases you can call getName(String) to return a different namespace prefix. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@332545 13f79535-47bb-0310-9956-ffa450edef68 --- test/java/org/apache/fop/fotreetest/ext/AssertElement.java | 5 +++++ .../org/apache/fop/fotreetest/ext/TestElementMapping.java | 7 ------- test/java/org/apache/fop/fotreetest/ext/TestObj.java | 11 +++++------ 3 files changed, 10 insertions(+), 13 deletions(-) (limited to 'test/java/org/apache/fop/fotreetest') diff --git a/test/java/org/apache/fop/fotreetest/ext/AssertElement.java b/test/java/org/apache/fop/fotreetest/ext/AssertElement.java index f773c76a6..3f4fcceda 100644 --- a/test/java/org/apache/fop/fotreetest/ext/AssertElement.java +++ b/test/java/org/apache/fop/fotreetest/ext/AssertElement.java @@ -87,5 +87,10 @@ public class AssertElement extends TestObj { } + /** @see org.apache.fop.fo.FONode#getLocalName() */ + public String getLocalName() { + return "assert"; + } + } diff --git a/test/java/org/apache/fop/fotreetest/ext/TestElementMapping.java b/test/java/org/apache/fop/fotreetest/ext/TestElementMapping.java index 903250155..a17c6f0b2 100644 --- a/test/java/org/apache/fop/fotreetest/ext/TestElementMapping.java +++ b/test/java/org/apache/fop/fotreetest/ext/TestElementMapping.java @@ -41,13 +41,6 @@ public class TestElementMapping extends ElementMapping { if (foObjs == null) { foObjs = new java.util.HashMap(); foObjs.put("assert", new AssertMaker()); - foObjs.put(DEFAULT, new TestMaker()); - } - } - - static class TestMaker extends ElementMapping.Maker { - public FONode make(FONode parent) { - return new TestObj(parent); } } diff --git a/test/java/org/apache/fop/fotreetest/ext/TestObj.java b/test/java/org/apache/fop/fotreetest/ext/TestObj.java index 245f81b5d..f1ff71ab4 100644 --- a/test/java/org/apache/fop/fotreetest/ext/TestObj.java +++ b/test/java/org/apache/fop/fotreetest/ext/TestObj.java @@ -23,9 +23,9 @@ import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; /** - * Catch all FOP Test objects as default element. + * Base class for all FOP Test objects. */ -public class TestObj extends FObj { +public abstract class TestObj extends FObj { /** * @see org.apache.fop.fo.FONode#FONode(FONode) @@ -34,11 +34,10 @@ public class TestObj extends FObj { super(parent); } - /** - * @see org.apache.fop.fo.XMLObj#getNameSpace() - */ - public String getNameSpace() { + /** @see org.apache.fop.fo.FONode#getNamespaceURI() */ + public String getNamespaceURI() { return TestElementMapping.NAMESPACE; } + } -- cgit v1.2.3