aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fo/FObj.java
diff options
context:
space:
mode:
authorGlen Mazza <gmazza@apache.org>2003-12-26 22:11:17 +0000
committerGlen Mazza <gmazza@apache.org>2003-12-26 22:11:17 +0000
commit76e4b6356c06ab387c6220c11998441bb38d161c (patch)
tree430a72cf1933e16871f8ff379155a0cda5aaf8e5 /src/java/org/apache/fop/fo/FObj.java
parent51b606aa9153e0d4d0bf43055625beaf5a079a9b (diff)
downloadxmlgraphics-fop-76e4b6356c06ab387c6220c11998441bb38d161c.tar.gz
xmlgraphics-fop-76e4b6356c06ab387c6220c11998441bb38d161c.zip
----------------------------------------------------------------------
Bug #25646 (Patch by Finn Bock): setting SAX Locator (line and column index of input fo stream) for debugging and better error feedback. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197054 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/FObj.java')
-rw-r--r--src/java/org/apache/fop/fo/FObj.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/fo/FObj.java b/src/java/org/apache/fop/fo/FObj.java
index 79a6fdcd0..8066ff138 100644
--- a/src/java/org/apache/fop/fo/FObj.java
+++ b/src/java/org/apache/fop/fo/FObj.java
@@ -61,6 +61,7 @@ import org.apache.fop.apps.FOPException;
import org.apache.fop.fo.flow.Marker;
import org.apache.fop.fo.properties.FOPropertyMapping;
import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
/**
* Base class for representation of formatting objects and their processing.
@@ -130,6 +131,12 @@ public class FObj extends FONode {
name = "fo:" + str;
}
+ public void setLocation(Locator locator) {
+ line = locator.getLineNumber();
+ column = locator.getColumnNumber();
+ systemId = locator.getSystemId();
+ }
+
/**
* Handle the attributes for this element.
* The attributes must be used immediately as the sax attributes
@@ -420,5 +427,13 @@ public class FObj extends FONode {
public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveFObj(this);
}
+
+ /**
+ * Return a string representation of the fo element.
+ */
+ public String toString() {
+ return getName() + " at line " + line + ":" + column;
+ }
+
}