Revision: 12906
http://sourceforge.net/p/foray/code/12906
Author: victormote
Date: 2022-12-21 13:50:48 +0000 (Wed, 21 Dec 2022)
Log Message:
-----------
Simplify attribute processing for foreign namespaces.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/Namespace.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/NamespaceForeign.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/NamespaceNative.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/NamespaceMath.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/NamespaceSvg.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/Namespace.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/Namespace.java 2022-12-21 13:12:02 UTC (rev 12905)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/Namespace.java 2022-12-21 13:50:48 UTC (rev 12906)
@@ -126,20 +126,6 @@
FoObj fobj, Locator locator, FoTreeParser4a builder, FoTreeCreator creator) throws PropertyException;
/**
- * Parses one attribute in this namespace.
- * @param attributes The unparsed SAX attributes.
- * @param attributeName The name of the attribute to be parsed.
- * @param attributeValue The value of the attribute to be parsed.
- * @param fobj The FoObj to which the properties belongs.
- * @param locator The SAX locator.
- * @param creator The FO Tree creation context.
- * @return The parsed property.
- * @throws PropertyException For errors during parsing.
- */
- public abstract Property parseAttributeForNS(Attributes attributes, String attributeName, String attributeValue,
- FoObj fobj, Locator locator, FoTreeCreator creator) throws PropertyException;
-
- /**
* Return a newly-created appropriate PropertyList for this namespace.
* @param attlist The attributes that will become the properties in the list.
* @return The newly-created property list.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/NamespaceForeign.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/NamespaceForeign.java 2022-12-21 13:12:02 UTC (rev 12905)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/NamespaceForeign.java 2022-12-21 13:50:48 UTC (rev 12906)
@@ -55,9 +55,9 @@
public Property parseAttribute(final Attributes attributes, final String attributeName, final String attributeValue,
final FoObj fobj, final Locator locator, final FoTreeParser4a builder, final FoTreeCreator creator)
throws PropertyException {
- final Property property = parseAttributeForNS(attributes, attributeName, attributeValue, fobj, locator,
- creator);
- return property;
+ /* This method is required by the abstract superclass Namespace, but is
+ * not used, because the parseAttributes method does all of the work. */
+ return null;
}
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/NamespaceNative.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/NamespaceNative.java 2022-12-21 13:12:02 UTC (rev 12905)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/NamespaceNative.java 2022-12-21 13:50:48 UTC (rev 12906)
@@ -105,6 +105,20 @@
}
/**
+ * Parses one attribute in this namespace.
+ * @param attributes The unparsed SAX attributes.
+ * @param attributeName The name of the attribute to be parsed.
+ * @param attributeValue The value of the attribute to be parsed.
+ * @param fobj The FoObj to which the properties belongs.
+ * @param locator The SAX locator.
+ * @param creator The FO Tree creation context.
+ * @return The parsed property.
+ * @throws PropertyException For errors during parsing.
+ */
+ public abstract Property parseAttributeForNS(Attributes attributes, String attributeName, String attributeValue,
+ FoObj fobj, Locator locator, FoTreeCreator creator) throws PropertyException;
+
+ /**
* Parses the attributes for an object in a pre-specified order, building the PropertyList from them.
* @param propertyList The property list into which the parsed values should be placed.
* @param attributes The unparsed SAX attributes.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/NamespaceMath.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/NamespaceMath.java 2022-12-21 13:12:02 UTC (rev 12905)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/NamespaceMath.java 2022-12-21 13:50:48 UTC (rev 12906)
@@ -32,8 +32,6 @@
import org.foray.fotree.FoTree4a;
import org.foray.fotree.FoTreeParser4a;
import org.foray.fotree.NamespaceForeign;
-import org.foray.fotree.Property;
-import org.foray.fotree.PropertyException;
import org.foray.fotree.PropertyList;
import org.foray.fotree.PropertyListUnparsed;
import org.foray.fotree.fo.obj.InstreamForeignObject4a;
@@ -89,15 +87,6 @@
}
@Override
- public Property parseAttributeForNS(final Attributes attributes, final String attributeName,
- final String attributeValue, final FoObj fobj, final Locator locator, final FoTreeCreator creator)
- throws PropertyException {
- /* This method is required by the abstract superclass Namespace, but is
- * not used, because the parseAttributes method does all of the work. */
- return null;
- }
-
- @Override
protected PropertyList createNewPropertyList(final Attributes attlist) {
return new PropertyListUnparsed(attlist);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/NamespaceSvg.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/NamespaceSvg.java 2022-12-21 13:12:02 UTC (rev 12905)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/NamespaceSvg.java 2022-12-21 13:50:48 UTC (rev 12906)
@@ -32,8 +32,6 @@
import org.foray.fotree.FoTree4a;
import org.foray.fotree.FoTreeParser4a;
import org.foray.fotree.NamespaceForeign;
-import org.foray.fotree.Property;
-import org.foray.fotree.PropertyException;
import org.foray.fotree.PropertyList;
import org.foray.fotree.PropertyListUnparsed;
import org.foray.fotree.fo.obj.InstreamForeignObject4a;
@@ -88,15 +86,6 @@
}
@Override
- public Property parseAttributeForNS(final Attributes attributes, final String attributeName,
- final String attributeValue, final FoObj fobj, final Locator locator, final FoTreeCreator creator)
- throws PropertyException {
- /* This method is required by the abstract superclass Namespace, but is
- * not used, because the parseAttributes method does all of the work. */
- return null;
- }
-
- @Override
protected PropertyList createNewPropertyList(final Attributes attlist) {
return new PropertyListUnparsed(attlist);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|