Revision: 12797
http://sourceforge.net/p/foray/code/12797
Author: victormote
Date: 2022-12-07 11:53:26 +0000 (Wed, 07 Dec 2022)
Log Message:
-----------
Rename method for clarity.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/Property.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyId.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslPropertyId.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/prop/AxslEnumerated.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoPropertyId.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/XmlPropertyId.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java 2022-12-07 11:37:04 UTC (rev 12796)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java 2022-12-07 11:53:26 UTC (rev 12797)
@@ -223,7 +223,7 @@
* @return The text property name.
*/
public String getPropertyName(final PropertyId propertyType) {
- final String propertyName = propertyType.toStringUnparsed();
+ final String propertyName = propertyType.getAttributeName();
for (Namespace ns : this.namespaceMap.values()) {
if (propertyName != null
&& ! propertyName.equals("")) {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/Property.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/Property.java 2022-12-07 11:37:04 UTC (rev 12796)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/Property.java 2022-12-07 11:53:26 UTC (rev 12797)
@@ -93,7 +93,7 @@
final String value, final FoObj fobj) {
final StringBuilder buffer = new StringBuilder();
buffer.append("Unexpected value for property \"");
- buffer.append(getPropertyType().toStringUnparsed());
+ buffer.append(getPropertyType().getAttributeName());
buffer.append("\": \"" + value + "\"");
if (reason != null) {
buffer.append(" Reason: " + reason);
@@ -121,7 +121,7 @@
*/
protected IllegalStateException unexpectedRetrieval() {
return new IllegalStateException("Unexpected property value while "
- + "retrieving: " + this.getPropertyType().toStringUnparsed()
+ + "retrieving: " + this.getPropertyType().getAttributeName()
+ ".\n"
+ "This is an internal logic error in the class: "
+ this.getClass().getName());
@@ -141,7 +141,7 @@
final PropertyId propertyType,
final Class<? extends Property> theClass) {
return new IllegalArgumentException("Illegal argument while trying to "
- + "obtain initial value: " + propertyType.toStringUnparsed()
+ + "obtain initial value: " + propertyType.getAttributeName()
+ ".\n"
+ "This is an internal logic error in the class: "
+ theClass.getName());
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyId.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyId.java 2022-12-07 11:37:04 UTC (rev 12796)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyId.java 2022-12-07 11:53:26 UTC (rev 12797)
@@ -29,20 +29,17 @@
package org.foray.fotree;
/**
- * Common interface for all enumerated property classes.
- * Use of this interface allows the enumerated property types from different namespaces to have a common parent.
+ * Common interface for all classes that enumerate property IDs for a namespace.
+ * Use of this interface allows the enumerated property ID types from different namespaces to have a common parent.
*/
public interface PropertyId {
/**
- * Returns the raw, unparsed value of this property type that would be found
- * in an input file, or that would be meaningful to a user in a user
- * message.
- * For example, an implementation might be an enum with an element called
- * WRITING_MODE.
- * But the unparsed value of this element would be "writing-mode".
- * @return The unparsed name for the property type.
+ * Returns the attribute name of this property as it appears in an XML input file.
+ * For example, an implementation might be an enum with an element called WRITING_MODE that was derived from an
+ * attribute named "writing-mode".
+ * @return The unparsed attribute name for this property.
*/
- String toStringUnparsed();
+ String getAttributeName();
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2022-12-07 11:37:04 UTC (rev 12796)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2022-12-07 11:53:26 UTC (rev 12797)
@@ -302,7 +302,7 @@
*/
if (existingProperty != null && property != existingProperty) {
fobj.getFoTree().logError("Property "
- + property.getPropertyType().toStringUnparsed()
+ + property.getPropertyType().getAttributeName()
+ " already exists.\n" + fobj.getContextMessage());
}
this.properties.add(property);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslPropertyId.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslPropertyId.java 2022-12-07 11:37:04 UTC (rev 12796)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslPropertyId.java 2022-12-07 11:53:26 UTC (rev 12797)
@@ -50,13 +50,8 @@
"metadata-key", // 0
};
- /**
- * Returns the XSL-FO name for this instance.
- * For example, the enumeration {@link AxslPropertyId#METADATA_KEY} converts
- * to the XSL-FO name "metadata-key".
- * @return The XSL-FO name for the property enumeration.
- */
- public String toStringUnparsed() {
+ @Override
+ public String getAttributeName() {
return AxslPropertyId.PROPERTY_NAME_LIST[this.ordinal()];
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/prop/AxslEnumerated.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/prop/AxslEnumerated.java 2022-12-07 11:37:04 UTC (rev 12796)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/prop/AxslEnumerated.java 2022-12-07 11:53:26 UTC (rev 12797)
@@ -153,7 +153,7 @@
default: {
throw new IllegalArgumentException("Property Type either not an " +
"enumerated type or is inheritable: "
- + propertyType.toStringUnparsed());
+ + propertyType.getAttributeName());
}
}
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoPropertyId.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoPropertyId.java 2022-12-07 11:37:04 UTC (rev 12796)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoPropertyId.java 2022-12-07 11:53:26 UTC (rev 12797)
@@ -1135,13 +1135,8 @@
"z-index", // 270
};
- /**
- * Returns the XSL-FO name for this instance.
- * For example, the enumeration {@link FoPropertyId#WRITING_MODE} converts to
- * the XSL-FO name "writing-mode".
- * @return The XSL-FO name for the property enumeration.
- */
- public String toStringUnparsed() {
+ @Override
+ public String getAttributeName() {
return FoPropertyId.PROPERTY_NAME_LIST[this.ordinal()];
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/XmlPropertyId.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/XmlPropertyId.java 2022-12-07 11:37:04 UTC (rev 12796)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/XmlPropertyId.java 2022-12-07 11:53:26 UTC (rev 12797)
@@ -49,7 +49,7 @@
};
@Override
- public String toStringUnparsed() {
+ public String getAttributeName() {
return XmlPropertyId.PROPERTY_NAME_LIST[this.ordinal()];
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|