and column number, if available. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_20_2-maintain@196245 13f79535-47bb-0310-9956-ffa450edef68tags/fop-0_20_5rc3
@@ -1,5 +1,8 @@ | |||
============================================================================== | |||
Done since 0.20.4 release | |||
- Use Locator to make system id, line and column number available to | |||
FOs. Use it when throwing FOPExceptions. TBD: Use it in mesages, also | |||
catch RuntimeExceptions and wrap them. | |||
- Added PDF encryption. Available options: no printing, no copy, no | |||
edit, no annotations. | |||
Submitted by Patrick C. Lankswert <PLankswert@InsightBB.COM> |
@@ -4,16 +4,16 @@ | |||
Active committers | |||
Arved Sandstrom | |||
Bertrand Delacretaz | |||
Christian Geisert (release coordinator) | |||
Karen Lease | |||
Keiron Liddle | |||
Jeremias Maerki | |||
Joerg Pietschmann | |||
Arved Sandstrom | |||
Karen Lease | |||
Keiron Liddle | |||
Oleg Tkachenko | |||
Peter B. West | |||
Victor Mote | |||
Emeritus committers | |||
(They have not committed anything for six months, and so are considered |
@@ -61,6 +61,9 @@ public class FOPException extends Exception { | |||
private static final String EXCEPTION_SEPARATOR = "\n---------\n"; | |||
private Throwable _exception; | |||
private String systemId; | |||
private int line; | |||
private int column; | |||
/** | |||
* create a new FOP Exception | |||
@@ -69,16 +72,48 @@ public class FOPException extends Exception { | |||
*/ | |||
public FOPException(String message) { | |||
super(message); | |||
systemId = null; | |||
line = -1; | |||
column = -1; | |||
} | |||
public FOPException(String message, String systemId, int line, int column) { | |||
super(message); | |||
this.systemId = systemId; | |||
this.line = line; | |||
this.column = column; | |||
} | |||
public FOPException(Throwable e) { | |||
super(e.getMessage()); | |||
setException(e); | |||
systemId = null; | |||
line = -1; | |||
column = -1; | |||
} | |||
public FOPException(Throwable e, String systemId, int line, int column) { | |||
super(e.getMessage()); | |||
setException(e); | |||
this.systemId = systemId; | |||
this.line = line; | |||
this.column = column; | |||
} | |||
public FOPException(String message, Throwable e) { | |||
super(message); | |||
setException(e); | |||
systemId = null; | |||
line = -1; | |||
column = -1; | |||
} | |||
public FOPException(String message, Throwable e, String systemId, int line, int column) { | |||
super(message); | |||
setException(e); | |||
this.systemId = systemId; | |||
this.line = line; | |||
this.column = column; | |||
} | |||
protected void setException(Throwable t) { | |||
@@ -89,6 +124,16 @@ public class FOPException extends Exception { | |||
return _exception; | |||
} | |||
public void setLocation(String systemId, int line, int column) { | |||
this.systemId = systemId; | |||
this.line = line; | |||
this.column = column; | |||
} | |||
public boolean isLocationSet() { | |||
return line>=0; | |||
} | |||
protected Throwable getRootException() { | |||
Throwable result = _exception; | |||
@@ -105,7 +150,14 @@ public class FOPException extends Exception { | |||
return null; | |||
} | |||
public String getMessage() { | |||
if (line>=0) { | |||
return systemId+':'+line+':'+column+' '+super.getMessage(); | |||
} else { | |||
return super.getMessage(); | |||
} | |||
} | |||
public void printStackTrace() { | |||
synchronized (System.err) { | |||
super.printStackTrace(); | |||
@@ -128,7 +180,7 @@ public class FOPException extends Exception { | |||
_exception.printStackTrace(stream); | |||
} | |||
if (getRootException() != null) { | |||
System.err.println(EXCEPTION_SEPARATOR); | |||
stream.println(EXCEPTION_SEPARATOR); | |||
getRootException().printStackTrace(stream); | |||
} | |||
} | |||
@@ -142,7 +194,7 @@ public class FOPException extends Exception { | |||
_exception.printStackTrace(writer); | |||
} | |||
if (getRootException() != null) { | |||
System.err.println(EXCEPTION_SEPARATOR); | |||
writer.println(EXCEPTION_SEPARATOR); | |||
getRootException().printStackTrace(writer); | |||
} | |||
} |
@@ -50,6 +50,7 @@ | |||
*/ | |||
package org.apache.fop.extensions; | |||
import org.apache.fop.apps.FOPException; | |||
import org.apache.fop.datatypes.IDReferences; | |||
import org.apache.fop.fo.FObj; | |||
import org.apache.fop.fo.FONode; | |||
@@ -57,7 +58,6 @@ import org.apache.fop.fo.PropertyList; | |||
import org.apache.fop.fo.Status; | |||
import org.apache.fop.layout.Area; | |||
import org.apache.fop.layout.AreaTree; | |||
import org.apache.fop.apps.FOPException; | |||
/** | |||
* Implement continued labels for table header/footer. | |||
@@ -68,8 +68,11 @@ public class ContinuedLabel extends ExtensionObj { | |||
private FObj containingTable=null; | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, PropertyList propertyList) { | |||
return new ContinuedLabel(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new ContinuedLabel(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -78,8 +81,9 @@ public class ContinuedLabel extends ExtensionObj { | |||
return new ContinuedLabel.Maker(); | |||
} | |||
public ContinuedLabel(FObj parent, PropertyList propertyList) { | |||
super(parent, propertyList); | |||
public ContinuedLabel(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) { | |||
super(parent, propertyList, systemId, line, column); | |||
// Find ancestor table | |||
for (; parent!=null ; parent = parent.getParent()) { |
@@ -50,8 +50,10 @@ | |||
*/ | |||
package org.apache.fop.extensions; | |||
import org.apache.fop.apps.FOPException; | |||
import org.apache.fop.fo.FObj; | |||
import org.apache.fop.fo.PropertyList; | |||
/** | |||
* Provides support for PDF destinations, which allow external | |||
* files to link into a particular place within the generated | |||
@@ -59,25 +61,35 @@ import org.apache.fop.fo.PropertyList; | |||
* | |||
* @author Stefan Wachter (based on work by Lloyd McKenzie) | |||
*/ | |||
public class Destination extends ExtensionObj { | |||
private String internalDestination; | |||
private String destinationName; | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, PropertyList propertyList) { | |||
return new Destination(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new Destination(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
public static FObj.Maker maker() { | |||
return new Destination.Maker(); | |||
} | |||
public Destination(FObj parent, PropertyList propertyList) { | |||
super(parent, propertyList); | |||
public Destination(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) { | |||
super(parent, propertyList, systemId, line, column); | |||
internalDestination = properties.get("internal-destination").getString(); | |||
if (internalDestination.equals("")) { | |||
log.warn("fox:destination requires an internal-destination."); | |||
} | |||
destinationName = properties.get("destination-name").getString(); | |||
} | |||
/** | |||
* Gets the name under which the destination may be referenced. | |||
*/ | |||
@@ -99,4 +111,4 @@ public class Destination extends ExtensionObj { | |||
return "fox:destination"; | |||
} | |||
} | |||
} |
@@ -64,8 +64,9 @@ public abstract class ExtensionObj extends FObj { | |||
* @param parent the parent formatting object | |||
* @param propertyList the explicit properties of this object | |||
*/ | |||
public ExtensionObj(FObj parent, PropertyList propertyList) { | |||
super(parent, propertyList); | |||
public ExtensionObj(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
/** |
@@ -50,6 +50,7 @@ | |||
*/ | |||
package org.apache.fop.extensions; | |||
import org.apache.fop.apps.FOPException; | |||
import org.apache.fop.fo.*; | |||
@@ -62,8 +63,10 @@ public class Label extends ExtensionObj { | |||
private StringBuffer textBuffer; | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, PropertyList propertyList) { | |||
return new Label(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new Label(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -72,8 +75,9 @@ public class Label extends ExtensionObj { | |||
return new Label.Maker(); | |||
} | |||
public Label(FObj parent, PropertyList propertyList) { | |||
super(parent, propertyList); | |||
public Label(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
protected void addCharacters(char data[], int start, int length) { |
@@ -50,6 +50,7 @@ | |||
*/ | |||
package org.apache.fop.extensions; | |||
import org.apache.fop.apps.FOPException; | |||
import org.apache.fop.fo.*; | |||
import java.util.*; | |||
@@ -77,8 +78,10 @@ public class Outline extends ExtensionObj { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, PropertyList propertyList) { | |||
return new Outline(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new Outline(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -87,8 +90,9 @@ public class Outline extends ExtensionObj { | |||
return new Outline.Maker(); | |||
} | |||
public Outline(FObj parent, PropertyList propertyList) { | |||
super(parent, propertyList); | |||
public Outline(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) { | |||
super(parent, propertyList, systemId, line, column); | |||
_internalDestination = | |||
this.properties.get("internal-destination").getString(); | |||
@@ -135,7 +139,9 @@ public class Outline extends ExtensionObj { | |||
} | |||
public Label getLabel() { | |||
return _label == null ? new Label(this, this.properties) : _label; | |||
return _label == null ? new Label(this, this.properties, | |||
systemId, line, column) | |||
: _label; | |||
} | |||
public ArrayList getOutlines() { |
@@ -56,9 +56,11 @@ import org.apache.fop.apps.FOPException; | |||
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 FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new ColorProfile(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -66,9 +68,10 @@ public class ColorProfile extends FObj { | |||
return new ColorProfile.Maker(); | |||
} | |||
protected ColorProfile(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected ColorProfile(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
log.warn("color profile not implemented"); | |||
// this.properties.get("src"); | |||
// this.properties.get("color-profile-name"); |
@@ -56,9 +56,10 @@ import org.apache.fop.apps.FOPException; | |||
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 FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new Declarations(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -66,9 +67,9 @@ public class Declarations extends FObj { | |||
return new Declarations.Maker(); | |||
} | |||
protected Declarations(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected Declarations(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
log.warn("declarations not implemented"); | |||
} | |||
@@ -63,6 +63,7 @@ import org.apache.avalon.framework.logger.Logger; | |||
import org.xml.sax.helpers.DefaultHandler; | |||
import org.xml.sax.SAXException; | |||
import org.xml.sax.Attributes; | |||
import org.xml.sax.Locator; | |||
// Java | |||
import java.util.HashMap; | |||
@@ -118,12 +119,16 @@ public class FOTreeBuilder extends DefaultHandler implements TreeBuilder { | |||
private Logger log; | |||
private Locator locator; | |||
public FOTreeBuilder() {} | |||
public void setLogger(Logger logger) { | |||
log = logger; | |||
} | |||
public void setStreamRenderer(StreamRenderer streamRenderer) { | |||
this.streamRenderer = streamRenderer; | |||
} | |||
@@ -239,6 +244,9 @@ public class FOTreeBuilder extends DefaultHandler implements TreeBuilder { | |||
streamRenderer.stopRenderer(); | |||
} | |||
public void setDocumentLocator(Locator locator) { | |||
this.locator = locator; | |||
} | |||
/** | |||
* SAX Handler for the start of an element | |||
*/ | |||
@@ -260,6 +268,14 @@ public class FOTreeBuilder extends DefaultHandler implements TreeBuilder { | |||
(PropertyListBuilder)this.propertylistTable.get(uri); | |||
boolean foreignXML = false; | |||
String systemId=null; | |||
int line = -1; | |||
int column = -1; | |||
if (locator!=null) { | |||
systemId = locator.getSystemId(); | |||
line = locator.getLineNumber(); | |||
column = locator.getColumnNumber(); | |||
} | |||
if (fobjMaker == null) { | |||
String fullName = uri + "^" + localName; | |||
if (!this.unknownFOs.containsKey(fullName)) { | |||
@@ -287,11 +303,12 @@ public class FOTreeBuilder extends DefaultHandler implements TreeBuilder { | |||
list = new DirectPropertyListBuilder.AttrPropertyList(attlist); | |||
} else { | |||
if(currentFObj == null) { | |||
throw new FOPException("Invalid XML or missing namespace"); | |||
throw new FOPException("Invalid XML or missing namespace", | |||
systemId, line, column); | |||
} | |||
list = currentFObj.properties; | |||
} | |||
fobj = fobjMaker.make(currentFObj, list); | |||
fobj = fobjMaker.make(currentFObj, list, systemId, line, column); | |||
fobj.setLogger(log); | |||
} catch (FOPException e) { | |||
throw new SAXException(e); | |||
@@ -302,7 +319,8 @@ public class FOTreeBuilder extends DefaultHandler implements TreeBuilder { | |||
if (!fobj.getName().equals("fo:root")) { | |||
throw new SAXException(new FOPException("Root element must" | |||
+ " be root, not " | |||
+ fobj.getName())); | |||
+ fobj.getName(), | |||
systemId, line, column)); | |||
} | |||
} else if(!(fobj instanceof org.apache.fop.fo.pagination.PageSequence)) { | |||
currentFObj.addChild(fobj); |
@@ -64,22 +64,30 @@ import java.util.HashSet; | |||
public abstract class FObj extends FONode { | |||
public abstract static class Maker { | |||
public abstract FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException; | |||
public abstract FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException; | |||
} | |||
// protected PropertyList properties; | |||
public PropertyList properties; | |||
protected PropertyManager propMgr; | |||
protected String systemId; | |||
protected int line; | |||
protected int column; | |||
// markers | |||
private HashSet markerClassNames; | |||
protected FObj(FObj parent, PropertyList propertyList) { | |||
protected FObj(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) { | |||
super(parent); | |||
this.properties = propertyList; // TO BE REMOVED!!! | |||
propertyList.setFObj(this); | |||
this.propMgr = makePropertyManager(propertyList); | |||
this.systemId = systemId; | |||
this.line = line; | |||
this.column = column; | |||
setWritingMode(); | |||
} | |||
@@ -199,7 +207,7 @@ public abstract class FObj extends FONode { | |||
FONode child = (FONode)children.get(i); | |||
if (!child.mayPrecedeMarker()) { | |||
throw new FOPException("A fo:marker must be an initial child of '" | |||
+ getName()+"'"); | |||
+ getName()+"'", systemId, line, column); | |||
} | |||
} | |||
} | |||
@@ -211,7 +219,8 @@ public abstract class FObj extends FONode { | |||
} else { | |||
throw new FOPException("marker-class-name '" | |||
+ markerClassName | |||
+ "' already exists for this parent"); | |||
+ "' already exists for this parent", | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -65,9 +65,10 @@ public abstract class FObjMixed extends FObj { | |||
private StringBuffer textBuffer; | |||
protected FObjMixed(FObj parent, PropertyList propertyList) | |||
protected FObjMixed(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList); | |||
super(parent, propertyList, systemId, line, column); | |||
textState = propMgr.getTextDecoration(parent); | |||
} | |||
@@ -110,8 +111,17 @@ public abstract class FObjMixed extends FObj { | |||
String id = prop.getString(); | |||
if (this.marker == START) { | |||
if (area.getIDReferences() != null) | |||
area.getIDReferences().createID(id); | |||
if (area.getIDReferences() != null) { | |||
try { | |||
area.getIDReferences().createID(id); | |||
} | |||
catch(FOPException e) { | |||
if (!e.isLocationSet()) { | |||
e.setLocation(systemId, line, column); | |||
} | |||
throw e; | |||
} | |||
} | |||
this.marker = 0; | |||
} | |||
@@ -61,9 +61,10 @@ import org.apache.fop.apps.FOPException; | |||
public class Title extends ToBeImplementedElement { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new Title(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new Title(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -72,9 +73,10 @@ public class Title extends ToBeImplementedElement { | |||
return new Title.Maker(); | |||
} | |||
protected Title(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected Title(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { |
@@ -58,9 +58,10 @@ import org.apache.fop.apps.FOPException; | |||
*/ | |||
public abstract class ToBeImplementedElement extends FObj { | |||
protected ToBeImplementedElement(FObj parent, PropertyList propertyList) | |||
protected ToBeImplementedElement(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList); | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public int layout(Area area) throws FOPException { |
@@ -63,9 +63,10 @@ import org.apache.fop.apps.FOPException; | |||
public class Unknown extends FObj { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new Unknown(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new Unknown(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -74,9 +75,10 @@ public class Unknown extends FObj { | |||
return new Unknown.Maker(); | |||
} | |||
protected Unknown(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected Unknown(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { |
@@ -76,9 +76,11 @@ public class UnknownXMLObj extends XMLObj { | |||
* | |||
* @return the unknown xml object | |||
*/ | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new UnknownXMLObj(parent, propertyList, space, tag); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new UnknownXMLObj(parent, propertyList, space, tag, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -97,8 +99,10 @@ 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 namespace, String name) { | |||
super(parent, propertyList, name); | |||
protected UnknownXMLObj(FObj parent, PropertyList propertyList, | |||
String namespace, String name, | |||
String systemId, int line, int column) { | |||
super(parent, propertyList, name, systemId, line, column); | |||
this.namespace = namespace; | |||
} | |||
@@ -79,9 +79,11 @@ public class XMLElement extends XMLObj { | |||
* | |||
* @return the XML object | |||
*/ | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new XMLElement(parent, propertyList, tag); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new XMLElement(parent, propertyList, tag, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -100,8 +102,9 @@ public class XMLElement extends XMLObj { | |||
* @param parent the parent formatting object | |||
* @param propertyList the explicit properties of this object | |||
*/ | |||
public XMLElement(FObj parent, PropertyList propertyList, String tag) { | |||
super(parent, propertyList, tag); | |||
public XMLElement(FObj parent, PropertyList propertyList, String tag, | |||
String systemId, int line, int column) { | |||
super(parent, propertyList, tag, systemId, line, column); | |||
init(); | |||
} | |||
@@ -120,7 +123,8 @@ public class XMLElement extends XMLObj { | |||
if (!(area instanceof ForeignObjectArea)) { | |||
// this is an error | |||
throw new FOPException("XML not in fo:instream-foreign-object"); | |||
throw new FOPException("XML not in fo:instream-foreign-object", | |||
systemId, line, column); | |||
} | |||
/* return status */ |
@@ -79,8 +79,9 @@ public abstract class XMLObj extends FObj { | |||
* @param parent the parent formatting object | |||
* @param propertyList the explicit properties of this object | |||
*/ | |||
public XMLObj(FObj parent, PropertyList propertyList, String tag) { | |||
super(parent, propertyList); | |||
public XMLObj(FObj parent, PropertyList propertyList, String tag, | |||
String systemId, int line, int column) { | |||
super(parent, propertyList, systemId, line, column); | |||
tagName = tag; | |||
} | |||
@@ -90,15 +90,15 @@ public abstract class AbstractFlow extends FObj { | |||
private int _status = Status.AREA_FULL_NONE; | |||
protected AbstractFlow(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected AbstractFlow(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
if (parent.getName().equals("fo:page-sequence")) { | |||
this.pageSequence = (PageSequence)parent; | |||
} else { | |||
throw new FOPException("flow must be child of page-sequence, not " | |||
+ parent.getName()); | |||
+ parent.getName(), systemId, line, column); | |||
} | |||
} | |||
@@ -124,7 +124,8 @@ public abstract class AbstractFlow extends FObj { | |||
int numChildren = this.children.size(); | |||
if (numChildren == 0) { | |||
throw new FOPException("fo:flow must contain block-level children"); | |||
throw new FOPException("fo:flow must contain block-level children", | |||
systemId, line, column); | |||
} | |||
for (int i = this.marker; i < numChildren; i++) { | |||
FObj fo = (FObj)children.get(i); |
@@ -71,12 +71,14 @@ public abstract class AbstractTableBody extends FObj { | |||
AreaContainer areaContainer; | |||
public AbstractTableBody(FObj parent, PropertyList propertyList) | |||
public AbstractTableBody(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList); | |||
super(parent, propertyList, systemId, line, column); | |||
if (!(parent instanceof Table)) { | |||
throw new FOPException("A table body must be child of fo:table," | |||
+ " not " + parent.getName()); | |||
+ " not " + parent.getName(), | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -124,7 +126,15 @@ public abstract class AbstractTableBody extends FObj { | |||
this.properties.get("space-after.optimum").getLength().mvalue(); | |||
this.id = this.properties.get("id").getString(); | |||
area.getIDReferences().createID(id); | |||
try { | |||
area.getIDReferences().createID(id); | |||
} | |||
catch(FOPException e) { | |||
if (!e.isLocationSet()) { | |||
e.setLocation(systemId, line, column); | |||
} | |||
throw e; | |||
} | |||
if (area instanceof BlockArea) { | |||
area.end(); | |||
@@ -186,7 +196,7 @@ public abstract class AbstractTableBody extends FObj { | |||
continue; | |||
} | |||
if (!(child instanceof TableRow)) { | |||
throw new FOPException("Currently only Table Rows are supported in table body, header and footer"); | |||
throw new FOPException("Currently only Table Rows are supported in table body, header and footer", systemId, line, column); | |||
} | |||
TableRow row = (TableRow)child; | |||
@@ -59,9 +59,10 @@ import org.apache.fop.layout.*; | |||
public class BasicLink extends Inline { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new BasicLink(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new BasicLink(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -69,9 +70,9 @@ public class BasicLink extends Inline { | |||
return new BasicLink.Maker(); | |||
} | |||
public BasicLink(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
public BasicLink(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { | |||
@@ -132,13 +133,21 @@ public class BasicLink extends Inline { | |||
} | |||
} | |||
} else { | |||
throw new FOPException("internal-destination or external-destination must be specified in basic-link"); | |||
throw new FOPException("internal-destination or external-destination must be specified in basic-link", systemId, line, column); | |||
} | |||
if (this.marker == START) { | |||
// initialize id | |||
String id = this.properties.get("id").getString(); | |||
area.getIDReferences().initializeID(id, area); | |||
try { | |||
area.getIDReferences().initializeID(id, area); | |||
} | |||
catch(FOPException e) { | |||
if (!e.isLocationSet()) { | |||
e.setLocation(systemId, line, column); | |||
} | |||
throw e; | |||
} | |||
this.marker = 0; | |||
} | |||
@@ -157,7 +166,7 @@ public class BasicLink extends Inline { | |||
//System.err.println("Using currentColumnArea as AC for link"); | |||
} | |||
if (ac == null) { | |||
throw new FOPException("Couldn't get ancestor AreaContainer when processing basic-link"); | |||
throw new FOPException("Couldn't get ancestor AreaContainer when processing basic-link", systemId, line, column); | |||
} | |||
int numChildren = this.children.size(); |
@@ -60,9 +60,10 @@ import org.apache.fop.apps.FOPException; | |||
public class BidiOverride extends ToBeImplementedElement { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new BidiOverride(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new BidiOverride(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -70,9 +71,10 @@ public class BidiOverride extends ToBeImplementedElement { | |||
return new BidiOverride.Maker(); | |||
} | |||
protected BidiOverride(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected BidiOverride(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { |
@@ -73,9 +73,10 @@ import org.apache.fop.apps.FOPException; | |||
public class Block extends FObjMixed { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new Block(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new Block(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -108,10 +109,10 @@ public class Block extends FObjMixed { | |||
//Added to see how long it's been since nothing was laid out. | |||
int noLayoutCount = 0; | |||
public Block(FObj parent, PropertyList propertyList) | |||
public Block(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList); | |||
super(parent, propertyList, systemId, line, column); | |||
this.span = this.properties.get("span").getEnum(); | |||
} | |||
@@ -138,7 +139,8 @@ public class Block extends FObjMixed { | |||
if (noLayoutCount > infLoopThreshhold) { | |||
throw new FOPException( | |||
"No meaningful layout in block after many attempts. "+ | |||
"Infinite loop is assumed. Processing halted."); | |||
"Infinite loop is assumed. Processing halted.", | |||
systemId, line, column); | |||
} | |||
// log.error(" b:LAY[" + marker + "] "); | |||
@@ -197,7 +199,15 @@ public class Block extends FObjMixed { | |||
} | |||
if (area.getIDReferences() != null) { | |||
area.getIDReferences().createID(id); | |||
try { | |||
area.getIDReferences().createID(id); | |||
} | |||
catch(FOPException e) { | |||
if (!e.isLocationSet()) { | |||
e.setLocation(systemId, line, column); | |||
} | |||
throw e; | |||
} | |||
} | |||
this.marker = 0; |
@@ -73,9 +73,11 @@ public class BlockContainer extends FObj { | |||
AreaContainer areaContainer; | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new BlockContainer(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new BlockContainer(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -86,9 +88,10 @@ public class BlockContainer extends FObj { | |||
PageSequence pageSequence; | |||
protected BlockContainer(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected BlockContainer(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
this.span = this.properties.get("span").getEnum(); | |||
} | |||
@@ -138,7 +141,15 @@ public class BlockContainer extends FObj { | |||
// initialize id | |||
String id = this.properties.get("id").getString(); | |||
area.getIDReferences().initializeID(id, area); | |||
try { | |||
area.getIDReferences().initializeID(id, area); | |||
} | |||
catch(FOPException e) { | |||
if (!e.isLocationSet()) { | |||
e.setLocation(systemId, line, column); | |||
} | |||
throw e; | |||
} | |||
} | |||
boolean prevChildMustKeepWithNext = false; |
@@ -78,9 +78,10 @@ public class Character extends FObj { | |||
public static final int DOESNOT_FIT = 1; | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new Character(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new Character(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -88,8 +89,9 @@ public class Character extends FObj { | |||
return new Character.Maker(); | |||
} | |||
public Character(FObj parent, PropertyList propertyList) { | |||
super(parent, propertyList); | |||
public Character(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { | |||
@@ -171,7 +173,15 @@ public class Character extends FObj { | |||
// initialize id | |||
String id = this.properties.get("id").getString(); | |||
blockArea.getIDReferences().initializeID(id, blockArea); | |||
try { | |||
blockArea.getIDReferences().initializeID(id, blockArea); | |||
} | |||
catch(FOPException e) { | |||
if (!e.isLocationSet()) { | |||
e.setLocation(systemId, line, column); | |||
} | |||
throw e; | |||
} | |||
LineArea la = blockArea.getCurrentLineArea(); | |||
if (la == null) { |
@@ -77,9 +77,11 @@ 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 FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new ExternalGraphic(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -87,8 +89,9 @@ public class ExternalGraphic extends FObj { | |||
return new ExternalGraphic.Maker(); | |||
} | |||
public ExternalGraphic(FObj parent, PropertyList propertyList) { | |||
super(parent, propertyList); | |||
public ExternalGraphic(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { | |||
@@ -159,7 +162,15 @@ public class ExternalGraphic extends FObj { | |||
this.id = this.properties.get("id").getString(); | |||
area.getIDReferences().createID(id); | |||
try { | |||
area.getIDReferences().createID(id); | |||
} | |||
catch(FOPException e) { | |||
if (!e.isLocationSet()) { | |||
e.setLocation(systemId, line, column); | |||
} | |||
throw e; | |||
} | |||
/* | |||
* if (area instanceof BlockArea) { | |||
* area.end(); |
@@ -60,9 +60,10 @@ import org.apache.fop.apps.FOPException; | |||
public class Float extends ToBeImplementedElement { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new Float(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new Float(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -71,9 +72,10 @@ public class Float extends ToBeImplementedElement { | |||
return new Float.Maker(); | |||
} | |||
protected Float(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected Float(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { |
@@ -57,9 +57,10 @@ import org.apache.fop.apps.FOPException; | |||
public class Flow extends AbstractFlow { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new Flow(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new Flow(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -67,9 +68,9 @@ public class Flow extends AbstractFlow { | |||
return new Flow.Maker(); | |||
} | |||
protected Flow(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected Flow(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
setFlowName(getProperty("flow-name").getString()); | |||
pageSequence.addFlow(this); | |||
} |
@@ -61,9 +61,10 @@ import java.util.ArrayList; | |||
public class Footnote extends FObj { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new Footnote(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new Footnote(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -72,9 +73,9 @@ public class Footnote extends FObj { | |||
return new Footnote.Maker(); | |||
} | |||
public Footnote(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
public Footnote(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { |
@@ -67,9 +67,11 @@ public class FootnoteBody extends FObj { | |||
int textIndent; | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new FootnoteBody(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new FootnoteBody(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -78,9 +80,10 @@ public class FootnoteBody extends FObj { | |||
return new FootnoteBody.Maker(); | |||
} | |||
public FootnoteBody(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
public FootnoteBody(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
this.areaClass = AreaClass.setAreaClass(AreaClass.XSL_FOOTNOTE); | |||
} | |||
@@ -60,9 +60,11 @@ import org.apache.fop.apps.FOPException; | |||
public class InitialPropertySet extends ToBeImplementedElement { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new InitialPropertySet(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new InitialPropertySet(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -71,9 +73,10 @@ public class InitialPropertySet extends ToBeImplementedElement { | |||
return new InitialPropertySet.Maker(); | |||
} | |||
protected InitialPropertySet(FObj parent, PropertyList propertyList) | |||
throws FOPException { | |||
super(parent, propertyList); | |||
protected InitialPropertySet(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { |
@@ -58,9 +58,10 @@ import org.apache.fop.apps.FOPException; | |||
public class Inline extends FObjMixed { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new Inline(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new Inline(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -69,12 +70,13 @@ public class Inline extends FObjMixed { | |||
return new Inline.Maker(); | |||
} | |||
public Inline(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
public Inline(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
if (parent.getName().equals("fo:flow")) { | |||
throw new FOPException("inline formatting objects cannot" | |||
+ " be directly under flow"); | |||
+ " be directly under flow", | |||
systemId, line, column); | |||
} | |||
// Common Accessibility Properties |
@@ -60,9 +60,11 @@ import org.apache.fop.apps.FOPException; | |||
public class InlineContainer extends ToBeImplementedElement { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new InlineContainer(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new InlineContainer(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -70,9 +72,10 @@ public class InlineContainer extends ToBeImplementedElement { | |||
return new InlineContainer.Maker(); | |||
} | |||
protected InlineContainer(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected InlineContainer(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
// Common Border, Padding, and Background Properties | |||
BorderAndPadding bap = propMgr.getBorderAndPadding(); |
@@ -73,9 +73,11 @@ public class InstreamForeignObject extends FObj { | |||
* | |||
* @return the SVG object | |||
*/ | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new InstreamForeignObject(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new InstreamForeignObject(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -113,8 +115,9 @@ public class InstreamForeignObject extends FObj { | |||
* @param parent the parent formatting object | |||
* @param propertyList the explicit properties of this object | |||
*/ | |||
public InstreamForeignObject(FObj parent, PropertyList propertyList) { | |||
super(parent, propertyList); | |||
public InstreamForeignObject(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { | |||
@@ -206,7 +209,15 @@ public class InstreamForeignObject extends FObj { | |||
this.scaling = this.properties.get("scaling").getEnum(); | |||
area.getIDReferences().createID(id); | |||
try { | |||
area.getIDReferences().createID(id); | |||
} | |||
catch(FOPException e) { | |||
if (!e.isLocationSet()) { | |||
e.setLocation(systemId, line, column); | |||
} | |||
throw e; | |||
} | |||
if (this.areaCurrent == null) { | |||
this.areaCurrent = | |||
new ForeignObjectArea(propMgr.getFontState(area.getFontInfo()), | |||
@@ -229,7 +240,7 @@ public class InstreamForeignObject extends FObj { | |||
int numChildren = this.children.size(); | |||
if (numChildren > 1) { | |||
throw new FOPException("Only one child element is allowed in an instream-foreign-object"); | |||
throw new FOPException("Only one child element is allowed in an instream-foreign-object", systemId, line, column); | |||
} | |||
/* layout foreign object */ | |||
if (this.children.size() > 0) { |
@@ -68,9 +68,10 @@ import org.apache.fop.apps.FOPException; | |||
public class Leader extends FObjMixed { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new Leader(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new Leader(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -79,9 +80,10 @@ public class Leader extends FObjMixed { | |||
return new Leader.Maker(); | |||
} | |||
public Leader(FObj parent, PropertyList propertyList) | |||
throws FOPException { | |||
super(parent, propertyList); | |||
public Leader(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { | |||
@@ -185,8 +187,16 @@ public class Leader extends FObjMixed { | |||
// initialize id | |||
String id = this.properties.get("id").getString(); | |||
blockArea.getIDReferences().initializeID(id, blockArea); | |||
try { | |||
blockArea.getIDReferences().initializeID(id, blockArea); | |||
} | |||
catch(FOPException e) { | |||
if (!e.isLocationSet()) { | |||
e.setLocation(systemId, line, column); | |||
} | |||
throw e; | |||
} | |||
// adds leader to blockarea, there the leaderArea is generated | |||
int succeeded = addLeader(blockArea, | |||
propMgr.getFontState(area.getFontInfo()), |
@@ -59,9 +59,11 @@ import org.apache.fop.apps.FOPException; | |||
public class ListBlock extends FObj { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new ListBlock(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new ListBlock(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -81,8 +83,9 @@ public class ListBlock extends FObj { | |||
int spaceAfter; | |||
int spaceBetweenListRows = 0; | |||
public ListBlock(FObj parent, PropertyList propertyList) { | |||
super(parent, propertyList); | |||
public ListBlock(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { | |||
@@ -149,7 +152,15 @@ public class ListBlock extends FObj { | |||
// initialize id | |||
String id = this.properties.get("id").getString(); | |||
area.getIDReferences().initializeID(id, area); | |||
try { | |||
area.getIDReferences().initializeID(id, area); | |||
} | |||
catch(FOPException e) { | |||
if (!e.isLocationSet()) { | |||
e.setLocation(systemId, line, column); | |||
} | |||
throw e; | |||
} | |||
} | |||
BlockArea blockArea = |
@@ -59,9 +59,10 @@ import org.apache.fop.apps.FOPException; | |||
public class ListItem extends FObj { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new ListItem(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new ListItem(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -82,8 +83,9 @@ public class ListItem extends FObj { | |||
String id; | |||
BlockArea blockArea; | |||
public ListItem(FObj parent, PropertyList propertyList) { | |||
super(parent, propertyList); | |||
public ListItem(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { | |||
@@ -127,7 +129,15 @@ public class ListItem extends FObj { | |||
this.properties.get("space-after.optimum").getLength().mvalue(); | |||
this.id = this.properties.get("id").getString(); | |||
area.getIDReferences().createID(id); | |||
try { | |||
area.getIDReferences().createID(id); | |||
} | |||
catch(FOPException e) { | |||
if (!e.isLocationSet()) { | |||
e.setLocation(systemId, line, column); | |||
} | |||
throw e; | |||
} | |||
this.marker = 0; | |||
} | |||
@@ -169,7 +179,8 @@ public class ListItem extends FObj { | |||
int numChildren = this.children.size(); | |||
if (numChildren != 2) { | |||
throw new FOPException("list-item must have exactly two children"); | |||
throw new FOPException("list-item must have exactly two children", | |||
systemId, line, column); | |||
} | |||
ListItemLabel label = (ListItemLabel)children.get(0); | |||
ListItemBody body = (ListItemBody)children.get(1); |
@@ -58,9 +58,11 @@ import org.apache.fop.apps.FOPException; | |||
public class ListItemBody extends FObj { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new ListItemBody(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new ListItemBody(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -69,8 +71,9 @@ public class ListItemBody extends FObj { | |||
return new ListItemBody.Maker(); | |||
} | |||
public ListItemBody(FObj parent, PropertyList propertyList) { | |||
super(parent, propertyList); | |||
public ListItemBody(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { | |||
@@ -89,7 +92,15 @@ public class ListItemBody extends FObj { | |||
this.marker = 0; | |||
// initialize id | |||
String id = this.properties.get("id").getString(); | |||
area.getIDReferences().initializeID(id, area); | |||
try { | |||
area.getIDReferences().initializeID(id, area); | |||
} | |||
catch(FOPException e) { | |||
if (!e.isLocationSet()) { | |||
e.setLocation(systemId, line, column); | |||
} | |||
throw e; | |||
} | |||
} | |||
/* |
@@ -58,9 +58,11 @@ import org.apache.fop.apps.FOPException; | |||
public class ListItemLabel extends FObj { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new ListItemLabel(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new ListItemLabel(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -69,8 +71,9 @@ public class ListItemLabel extends FObj { | |||
return new ListItemLabel.Maker(); | |||
} | |||
public ListItemLabel(FObj parent, PropertyList propertyList) { | |||
super(parent, propertyList); | |||
public ListItemLabel(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { | |||
@@ -81,7 +84,7 @@ public class ListItemLabel extends FObj { | |||
int numChildren = this.children.size(); | |||
if (numChildren != 1) { | |||
throw new FOPException("list-item-label must have exactly one block in this version of FOP"); | |||
throw new FOPException("list-item-label must have exactly one block in this version of FOP", systemId, line, column); | |||
} | |||
// Common Accessibility Properties | |||
@@ -92,7 +95,15 @@ public class ListItemLabel extends FObj { | |||
// initialize id | |||
String id = this.properties.get("id").getString(); | |||
area.getIDReferences().initializeID(id, area); | |||
try { | |||
area.getIDReferences().initializeID(id, area); | |||
} | |||
catch(FOPException e) { | |||
if (!e.isLocationSet()) { | |||
e.setLocation(systemId, line, column); | |||
} | |||
throw e; | |||
} | |||
Block block = (Block)children.get(0); | |||
@@ -63,9 +63,10 @@ public class Marker extends FObjMixed { | |||
private boolean isLast; | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new Marker(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new Marker(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -74,9 +75,10 @@ public class Marker extends FObjMixed { | |||
return new Marker.Maker(); | |||
} | |||
public Marker(FObj parent, PropertyList propertyList) | |||
throws FOPException { | |||
super(parent, propertyList); | |||
public Marker(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
// do check to see that 'this' is under fo:flow | |||
@@ -60,9 +60,10 @@ import org.apache.fop.apps.FOPException; | |||
public class MultiCase extends ToBeImplementedElement { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new MultiCase(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new MultiCase(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -70,9 +71,10 @@ public class MultiCase extends ToBeImplementedElement { | |||
return new MultiCase.Maker(); | |||
} | |||
protected MultiCase(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected MultiCase(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { |
@@ -60,9 +60,10 @@ import org.apache.fop.apps.FOPException; | |||
public class MultiProperties extends ToBeImplementedElement { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new MultiProperties(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new MultiProperties(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -71,9 +72,10 @@ public class MultiProperties extends ToBeImplementedElement { | |||
return new MultiProperties.Maker(); | |||
} | |||
protected MultiProperties(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected MultiProperties(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { |
@@ -60,9 +60,11 @@ import org.apache.fop.apps.FOPException; | |||
public class MultiPropertySet extends ToBeImplementedElement { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new MultiPropertySet(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new MultiPropertySet(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -71,8 +73,9 @@ public class MultiPropertySet extends ToBeImplementedElement { | |||
return new MultiPropertySet.Maker(); | |||
} | |||
protected MultiPropertySet(FObj parent, PropertyList propertyList) | |||
throws FOPException { | |||
protected MultiPropertySet(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList); | |||
} | |||
@@ -60,9 +60,10 @@ import org.apache.fop.apps.FOPException; | |||
public class MultiSwitch extends ToBeImplementedElement { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new MultiSwitch(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new MultiSwitch(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -71,9 +72,10 @@ public class MultiSwitch extends ToBeImplementedElement { | |||
return new MultiSwitch.Maker(); | |||
} | |||
protected MultiSwitch(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected MultiSwitch(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { |
@@ -60,9 +60,10 @@ import org.apache.fop.apps.FOPException; | |||
public class MultiToggle extends ToBeImplementedElement { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new MultiToggle(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new MultiToggle(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -71,9 +72,10 @@ public class MultiToggle extends ToBeImplementedElement { | |||
return new MultiToggle.Maker(); | |||
} | |||
protected MultiToggle(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected MultiToggle(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { |
@@ -60,9 +60,10 @@ import org.apache.fop.apps.FOPException; | |||
public class PageNumber extends FObj { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new PageNumber(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new PageNumber(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -78,8 +79,9 @@ public class PageNumber extends FObj { | |||
int whiteSpaceCollapse; | |||
TextState ts; | |||
public PageNumber(FObj parent, PropertyList propertyList) { | |||
super(parent, propertyList); | |||
public PageNumber(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { | |||
@@ -141,7 +143,15 @@ public class PageNumber extends FObj { | |||
// initialize id | |||
String id = this.properties.get("id").getString(); | |||
area.getIDReferences().initializeID(id, area); | |||
try { | |||
area.getIDReferences().initializeID(id, area); | |||
} | |||
catch(FOPException e) { | |||
if (!e.isLocationSet()) { | |||
e.setLocation(systemId, line, column); | |||
} | |||
throw e; | |||
} | |||
} | |||
String p = area.getPage().getFormattedNumber(); |
@@ -115,9 +115,11 @@ import org.apache.fop.apps.FOPException; | |||
public class PageNumberCitation extends FObj { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new PageNumberCitation(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new PageNumberCitation(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -138,8 +140,9 @@ public class PageNumberCitation extends FObj { | |||
TextState ts; | |||
public PageNumberCitation(FObj parent, PropertyList propertyList) { | |||
super(parent, propertyList); | |||
public PageNumberCitation(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { | |||
@@ -204,12 +207,20 @@ public class PageNumberCitation extends FObj { | |||
this.refId = this.properties.get("ref-id").getString(); | |||
if (this.refId.equals("")) { | |||
throw new FOPException("page-number-citation must contain \"ref-id\""); | |||
throw new FOPException("page-number-citation must contain \"ref-id\"", systemId, line, column); | |||
} | |||
// create id | |||
this.id = this.properties.get("id").getString(); | |||
idReferences.createID(id); | |||
try { | |||
idReferences.createID(id); | |||
} | |||
catch(FOPException e) { | |||
if (!e.isLocationSet()) { | |||
e.setLocation(systemId, line, column); | |||
} | |||
throw e; | |||
} | |||
ts = new TextState(); | |||
this.marker = 0; |
@@ -73,9 +73,11 @@ public class RetrieveMarker extends FObj { | |||
private Marker bestMarker; | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new RetrieveMarker(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new RetrieveMarker(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -84,8 +86,9 @@ public class RetrieveMarker extends FObj { | |||
return new RetrieveMarker.Maker(); | |||
} | |||
public RetrieveMarker(FObj parent, PropertyList propertyList) { | |||
super(parent, propertyList); | |||
public RetrieveMarker(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) { | |||
super(parent, propertyList, systemId, line, column); | |||
this.retrieveClassName = | |||
this.properties.get("retrieve-class-name").getString(); | |||
@@ -123,7 +126,7 @@ public class RetrieveMarker extends FObj { | |||
} else if (retrieveBoundary == RetrieveBoundary.DOCUMENT) { | |||
return layoutBestMarker(areaTree.getDocumentMarkers(),area); | |||
} else if (retrieveBoundary != RetrieveBoundary.PAGE) { | |||
throw new FOPException("Illegal 'retrieve-boundary' value"); | |||
throw new FOPException("Illegal 'retrieve-boundary' value", systemId, line, column); | |||
} | |||
} else if (bestMarker != null) { | |||
return bestMarker.layoutMarker(area); | |||
@@ -191,7 +194,7 @@ public class RetrieveMarker extends FObj { | |||
} | |||
} else { | |||
throw new FOPException("Illegal 'retrieve-position' value"); | |||
throw new FOPException("Illegal 'retrieve-position' value", systemId, line, column); | |||
} | |||
return null; | |||
} |
@@ -59,9 +59,11 @@ import org.apache.fop.apps.FOPException; | |||
public class StaticContent extends AbstractFlow { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new StaticContent(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new StaticContent(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -69,12 +71,12 @@ public class StaticContent extends AbstractFlow { | |||
return new StaticContent.Maker(); | |||
} | |||
protected StaticContent(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected StaticContent(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
setFlowName(getProperty("flow-name").getString()); | |||
pageSequence.addStaticContent(this); | |||
// ((PageSequence)parent).setIsFlowSet(false); // hacquery of sorts | |||
} | |||
public String getName() { | |||
@@ -130,7 +132,7 @@ public class StaticContent extends AbstractFlow { | |||
protected void setFlowName(String name) throws FOPException { | |||
if (name == null || name.equals("")) { | |||
throw new FOPException("A 'flow-name' is required for " | |||
+ getName() + "."); | |||
+ getName() + ".", systemId, line, column); | |||
} else { | |||
_flowName = name; | |||
} |
@@ -63,9 +63,10 @@ import java.util.ArrayList; | |||
public class Table extends FObj { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new Table(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new Table(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -100,8 +101,9 @@ public class Table extends FObj { | |||
AreaContainer areaContainer; | |||
public Table(FObj parent, PropertyList propertyList) { | |||
super(parent, propertyList); | |||
public Table(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { | |||
@@ -176,9 +178,17 @@ public class Table extends FObj { | |||
if (area instanceof BlockArea) { | |||
area.end(); | |||
} | |||
if (this.areaContainer | |||
== null) { // check if anything was previously laid out | |||
area.getIDReferences().createID(id); | |||
// check if anything was previously laid out | |||
if (this.areaContainer == null) { | |||
try { | |||
area.getIDReferences().createID(id); | |||
} | |||
catch(FOPException e) { | |||
if (!e.isLocationSet()) { | |||
e.setLocation(systemId, line, column); | |||
} | |||
throw e; | |||
} | |||
} | |||
@@ -60,9 +60,11 @@ import org.apache.fop.apps.FOPException; | |||
public class TableAndCaption extends ToBeImplementedElement { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new TableAndCaption(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new TableAndCaption(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -71,9 +73,10 @@ public class TableAndCaption extends ToBeImplementedElement { | |||
return new TableAndCaption.Maker(); | |||
} | |||
protected TableAndCaption(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected TableAndCaption(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { |
@@ -57,9 +57,10 @@ import org.apache.fop.apps.FOPException; | |||
public class TableBody extends AbstractTableBody { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new TableBody(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new TableBody(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -68,9 +69,10 @@ public class TableBody extends AbstractTableBody { | |||
return new TableBody.Maker(); | |||
} | |||
public TableBody(FObj parent, PropertyList propertyList) | |||
public TableBody(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList); | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { |
@@ -60,9 +60,11 @@ import org.apache.fop.apps.FOPException; | |||
public class TableCaption extends ToBeImplementedElement { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new TableCaption(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new TableCaption(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -71,9 +73,10 @@ public class TableCaption extends ToBeImplementedElement { | |||
return new TableCaption.Maker(); | |||
} | |||
protected TableCaption(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected TableCaption(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { |
@@ -59,9 +59,10 @@ import org.apache.fop.apps.FOPException; | |||
public class TableCell extends FObj { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new TableCell(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new TableCell(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -137,12 +138,13 @@ public class TableCell extends FObj { | |||
AreaContainer cellArea; | |||
public TableCell(FObj parent, PropertyList propertyList) | |||
public TableCell(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList); | |||
super(parent, propertyList, systemId, line, column); | |||
if (!(parent instanceof TableRow)) { | |||
throw new FOPException("A table cell must be child of fo:table-row," | |||
+ " not " + parent.getName()); | |||
+ " not " + parent.getName(), systemId, line, column); | |||
} | |||
doSetup(); // init some basic property values | |||
} | |||
@@ -257,7 +259,15 @@ public class TableCell extends FObj { | |||
// Calculate cell borders | |||
// calcBorders(propMgr.getBorderAndPadding()); | |||
area.getIDReferences().createID(id); | |||
try { | |||
area.getIDReferences().createID(id); | |||
} | |||
catch(FOPException e) { | |||
if (!e.isLocationSet()) { | |||
e.setLocation(systemId, line, column); | |||
} | |||
throw e; | |||
} | |||
this.marker = 0; | |||
this.bDone=false; |
@@ -70,9 +70,11 @@ public class TableColumn extends FObj { | |||
AreaContainer areaContainer; | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new TableColumn(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new TableColumn(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -80,12 +82,13 @@ public class TableColumn extends FObj { | |||
return new TableColumn.Maker(); | |||
} | |||
public TableColumn(FObj parent, PropertyList propertyList) | |||
public TableColumn(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList); | |||
super(parent, propertyList, systemId, line, column); | |||
if (!(parent instanceof Table)) { | |||
throw new FOPException("A table column must be child of fo:table, not " | |||
+ parent.getName()); | |||
+ parent.getName(), systemId, line, column); | |||
} | |||
} | |||
@@ -143,7 +146,15 @@ public class TableColumn extends FObj { | |||
// initialize id | |||
String id = this.properties.get("id").getString(); | |||
area.getIDReferences().initializeID(id, area); | |||
try { | |||
area.getIDReferences().initializeID(id, area); | |||
} | |||
catch(FOPException e) { | |||
if (!e.isLocationSet()) { | |||
e.setLocation(systemId, line, column); | |||
} | |||
throw e; | |||
} | |||
setup = true; | |||
} |
@@ -57,9 +57,11 @@ import org.apache.fop.apps.FOPException; | |||
public class TableFooter extends AbstractTableBody { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new TableFooter(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new TableFooter(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -68,9 +70,10 @@ public class TableFooter extends AbstractTableBody { | |||
return new TableFooter.Maker(); | |||
} | |||
public TableFooter(FObj parent, PropertyList propertyList) | |||
public TableFooter(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList); | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { |
@@ -57,9 +57,11 @@ import org.apache.fop.apps.FOPException; | |||
public class TableHeader extends AbstractTableBody { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new TableHeader(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new TableHeader(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -68,9 +70,10 @@ public class TableHeader extends AbstractTableBody { | |||
return new TableHeader.Maker(); | |||
} | |||
public TableHeader(FObj parent, PropertyList propertyList) | |||
public TableHeader(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList); | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { |
@@ -63,9 +63,10 @@ import java.util.ArrayList; | |||
public class TableRow extends FObj { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new TableRow(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new TableRow(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -175,13 +176,14 @@ public class TableRow extends FObj { | |||
} | |||
public TableRow(FObj parent, PropertyList propertyList) | |||
public TableRow(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList); | |||
super(parent, propertyList, systemId, line, column); | |||
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 " | |||
+ parent.getName()); | |||
+ parent.getName(), systemId, line, column); | |||
} | |||
} | |||
@@ -271,7 +273,15 @@ public class TableRow extends FObj { | |||
// laid out yet (with an id created already) | |||
} | |||
// create ID also in case the row has been reset | |||
area.getIDReferences().createID(id); | |||
try { | |||
area.getIDReferences().createID(id); | |||
} | |||
catch(FOPException e) { | |||
if (!e.isLocationSet()) { | |||
e.setLocation(systemId, line, column); | |||
} | |||
throw e; | |||
} | |||
this.marker = 0; | |||
int breakStatus = propMgr.checkBreakBefore(area); |
@@ -65,9 +65,10 @@ import org.apache.fop.apps.FOPException; | |||
public class Wrapper extends FObjMixed { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new Wrapper(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new Wrapper(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -79,9 +80,10 @@ public class Wrapper extends FObjMixed { | |||
return "fo:wrapper"; | |||
} | |||
public Wrapper(FObj parent, PropertyList propertyList) | |||
public Wrapper(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList); | |||
super(parent, propertyList, systemId, line, column); | |||
// check that this occurs inside an fo:flow | |||
} | |||
@@ -64,9 +64,11 @@ import org.apache.fop.apps.FOPException; | |||
public class ConditionalPageMasterReference extends FObj { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new ConditionalPageMasterReference(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new ConditionalPageMasterReference(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -83,9 +85,10 @@ public class ConditionalPageMasterReference extends FObj { | |||
private int oddOrEven; | |||
private int blankOrNotBlank; | |||
public ConditionalPageMasterReference(FObj parent, PropertyList propertyList) | |||
throws FOPException { | |||
super(parent, propertyList); | |||
public ConditionalPageMasterReference(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
if (getProperty("master-reference") != null) { | |||
this.masterName = getProperty("master-reference").getString(); | |||
@@ -101,7 +104,7 @@ public class ConditionalPageMasterReference extends FObj { | |||
} else { | |||
throw new FOPException("fo:conditional-page-master-reference must be child " | |||
+ "of fo:repeatable-page-master-alternatives, not " | |||
+ parent.getName()); | |||
+ parent.getName(), systemId, line, column); | |||
} | |||
this.pagePosition = this.properties.get("page-position").getEnum(); | |||
this.oddOrEven = this.properties.get("odd-or-even").getEnum(); |
@@ -68,9 +68,11 @@ import java.util.Iterator; | |||
public class LayoutMasterSet extends FObj { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new LayoutMasterSet(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new LayoutMasterSet(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -84,9 +86,10 @@ public class LayoutMasterSet extends FObj { | |||
private Root root; | |||
protected LayoutMasterSet(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected LayoutMasterSet(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
this.simplePageMasters = new HashMap(); | |||
this.pageSequenceMasters = new HashMap(); | |||
@@ -96,7 +99,7 @@ public class LayoutMasterSet extends FObj { | |||
root.setLayoutMasterSet(this); | |||
} else { | |||
throw new FOPException("fo:layout-master-set must be child of fo:root, not " | |||
+ parent.getName()); | |||
+ parent.getName(), systemId, line, column); | |||
} | |||
allRegions = new HashMap(); | |||
@@ -113,7 +116,7 @@ public class LayoutMasterSet extends FObj { | |||
throw new FOPException("'master-name' (" | |||
+ simplePageMaster.getMasterName() | |||
+ ") must be unique " | |||
+ "across page-masters and page-sequence-masters"); | |||
+ "across page-masters and page-sequence-masters", systemId, line, column); | |||
this.simplePageMasters.put(simplePageMaster.getMasterName(), | |||
simplePageMaster); | |||
} | |||
@@ -128,7 +131,7 @@ public class LayoutMasterSet extends FObj { | |||
if (existsName(masterName)) | |||
throw new FOPException("'master-name' (" + masterName | |||
+ ") must be unique " | |||
+ "across page-masters and page-sequence-masters"); | |||
+ "across page-masters and page-sequence-masters", systemId, line, column); | |||
this.pageSequenceMasters.put(masterName, pageSequenceMaster); | |||
} | |||
@@ -165,7 +168,7 @@ public class LayoutMasterSet extends FObj { | |||
+ "to the same region-class (" | |||
+ localClass + "!=" | |||
+ region.getRegionClass() | |||
+ ")"); | |||
+ ")", systemId, line, column); | |||
} | |||
} | |||
allRegions.put(region.getRegionName(), |
@@ -63,9 +63,10 @@ public abstract class PageMasterReference extends FObj | |||
protected String masterName; | |||
public PageMasterReference(FObj parent, PropertyList propertyList) | |||
public PageMasterReference(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList); | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getMasterName() { |
@@ -78,9 +78,11 @@ public class PageSequence extends FObj { | |||
// Factory methods | |||
// | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new PageSequence(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new PageSequence(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -152,16 +154,17 @@ public class PageSequence extends FObj { | |||
private SimplePageMaster currentSimplePageMaster; | |||
private PageSequenceMaster pageSequenceMaster; | |||
protected PageSequence(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected PageSequence(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
if (parent.getName().equals("fo:root")) { | |||
this.root = (Root)parent; | |||
} | |||
else { | |||
throw new FOPException("page-sequence must be child of root, not " | |||
+ parent.getName()); | |||
+ parent.getName(), systemId, line, column); | |||
} | |||
layoutMasterSet = root.getLayoutMasterSet(); | |||
@@ -189,7 +192,7 @@ public class PageSequence extends FObj { | |||
this.firstPageNumber = (pageStart > 0) ? pageStart : 1; | |||
} catch (NumberFormatException nfe) { | |||
throw new FOPException("The value '" + ipnValue | |||
+ "' is not valid for initial-page-number"); | |||
+ "' is not valid for initial-page-number", systemId, line, column); | |||
} | |||
} | |||
@@ -216,10 +219,10 @@ public class PageSequence extends FObj { | |||
public void addFlow(Flow flow) throws FOPException { | |||
if (this.flow!=null) { | |||
throw new FOPException("Only a single fo:flow permitted per fo:page-sequence"); | |||
throw new FOPException("Only a single fo:flow permitted per fo:page-sequence", systemId, line, column); | |||
} | |||
if (flowMap.containsKey(flow.getFlowName())) { | |||
throw new FOPException("flow-names must be unique within an fo:page-sequence"); | |||
throw new FOPException("flow-names must be unique within an fo:page-sequence", systemId, line, column); | |||
} | |||
this.flow = flow; | |||
} | |||
@@ -229,10 +232,11 @@ public class PageSequence extends FObj { | |||
if (this.flow!=null) { | |||
throw new FOPException("Static content ('" | |||
+ staticContent.getFlowName() | |||
+ "') is not allowed after fo:flow"); | |||
+ "') is not allowed after fo:flow", | |||
systemId, line, column); | |||
} | |||
if (flowMap.containsKey(staticContent.getFlowName())) { | |||
throw new FOPException("flow-names must be unique within an fo:page-sequence"); | |||
throw new FOPException("flow-names must be unique within an fo:page-sequence", systemId, line, column); | |||
} | |||
String flowName = staticContent.getFlowName(); | |||
if (!this.layoutMasterSet.regionNameExists(flowName) | |||
@@ -251,7 +255,7 @@ public class PageSequence extends FObj { | |||
*/ | |||
public void format(AreaTree areaTree) throws FOPException { | |||
if (flow == null) { | |||
throw new FOPException("No flow in page-sequence"); | |||
throw new FOPException("No flow in page-sequence", systemId, line, column); | |||
} | |||
PageSequence previousPageSequence=this.root.getPageSequence(); | |||
if( previousPageSequence!=null ) { | |||
@@ -301,7 +305,7 @@ public class PageSequence extends FObj { | |||
this.layoutMasterSet.getPageSequenceMaster(masterName); | |||
if (this.pageSequenceMaster==null) { | |||
throw new FOPException("master-reference '" + masterName | |||
+ "' for fo:page-sequence matches no simple-page-master or page-sequence-master"); | |||
+ "' for fo:page-sequence matches no simple-page-master or page-sequence-master", systemId, line, column); | |||
} | |||
pageSequenceMaster.reset(); | |||
} else { | |||
@@ -310,7 +314,7 @@ public class PageSequence extends FObj { | |||
if (!flow.getFlowName().equals(region.getRegionName())) { | |||
throw new FOPException("Flow '" + flow.getFlowName() | |||
+ "' does not map to the region-body in page-master '" | |||
+ currentSimplePageMaster.getMasterName() + "'"); | |||
+ currentSimplePageMaster.getMasterName() + "'", systemId, line, column); | |||
} | |||
} | |||
@@ -375,7 +379,7 @@ public class PageSequence extends FObj { | |||
if (!flow.getFlowName().equals(region.getRegionName())) { | |||
throw new FOPException("Flow '" + flow.getFlowName() | |||
+ "' does not map to the region-body in page-master '" | |||
+ currentSimplePageMaster.getMasterName() + "'"); | |||
+ currentSimplePageMaster.getMasterName() + "'", systemId, line, column); | |||
} | |||
} | |||
Page newPage = this.currentSimplePageMaster.getPageMaster() |
@@ -67,9 +67,11 @@ import java.util.ArrayList; | |||
public class PageSequenceMaster extends FObj { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new PageSequenceMaster(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new PageSequenceMaster(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -90,9 +92,10 @@ public class PageSequenceMaster extends FObj { | |||
// references to page-masters. So the methods use the former | |||
// terminology ('sub-sequence-specifiers', or SSS), | |||
// but the actual FO's are MasterReferences. | |||
protected PageSequenceMaster(FObj parent, PropertyList propertyList) | |||
protected PageSequenceMaster(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList); | |||
super(parent, propertyList, systemId, line, column); | |||
if (parent.getName().equals("fo:layout-master-set")) { | |||
this.layoutMasterSet = (LayoutMasterSet)parent; | |||
@@ -106,7 +109,7 @@ public class PageSequenceMaster extends FObj { | |||
} else { | |||
throw new FOPException("fo:page-sequence-master must be child " | |||
+ "of fo:layout-master-set, not " | |||
+ parent.getName()); | |||
+ parent.getName(), systemId, line, column); | |||
} | |||
subSequenceSpecifiers = new ArrayList(); | |||
currentSubSequenceNumber = -1; | |||
@@ -143,7 +146,7 @@ public class PageSequenceMaster extends FObj { | |||
currentSubSequence = getNextSubSequence(); | |||
if (currentSubSequence==null) { | |||
throw new FOPException("no subsequences in page-sequence-master '" | |||
+ masterName + "'"); | |||
+ masterName + "'", systemId, line, column); | |||
} | |||
firstPage = true; | |||
} | |||
@@ -157,7 +160,7 @@ public class PageSequenceMaster extends FObj { | |||
if (!canRecover) { | |||
throw new FOPException("subsequences exhausted in page-sequence-master '" | |||
+ masterName | |||
+ "', cannot recover"); | |||
+ "', cannot recover", systemId, line, column); | |||
} | |||
log.warn("subsequences exhausted in page-sequence-master '" | |||
+ masterName | |||
@@ -175,7 +178,7 @@ public class PageSequenceMaster extends FObj { | |||
if (pageMaster==null) { | |||
throw new FOPException("No simple-page-master matching '" | |||
+ pageMasterName + "' in page-sequence-master '" | |||
+ masterName +"'"); | |||
+ masterName +"'", systemId, line, column); | |||
} | |||
return pageMaster; | |||
} |
@@ -65,9 +65,10 @@ public abstract class Region extends FObj { | |||
private SimplePageMaster _layoutMaster; | |||
private String _regionName; | |||
protected Region(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected Region(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
// regions may have name, or default | |||
if (null == this.properties.get(PROP_REGION_NAME)) { | |||
@@ -81,7 +82,7 @@ public abstract class Region extends FObj { | |||
&&!getRegionName().equals(getDefaultRegionName())) { | |||
throw new FOPException(PROP_REGION_NAME + " '" + _regionName | |||
+ "' for " + this.getName() | |||
+ " not permitted."); | |||
+ " not permitted.", systemId, line, column); | |||
} | |||
} | |||
@@ -91,7 +92,7 @@ public abstract class Region extends FObj { | |||
} else { | |||
throw new FOPException(getName() + " must be child " | |||
+ "of simple-page-master, not " | |||
+ parent.getName()); | |||
+ parent.getName(), systemId, line, column); | |||
} | |||
} | |||
@@ -68,9 +68,11 @@ import org.apache.fop.layout.BackgroundProps; | |||
public class RegionAfter extends Region { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new RegionAfter(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new RegionAfter(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -83,9 +85,10 @@ public class RegionAfter extends Region { | |||
private int precedence; | |||
protected RegionAfter(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected RegionAfter(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
precedence = this.properties.get("precedence").getEnum(); | |||
} | |||
@@ -68,9 +68,11 @@ import org.apache.fop.apps.FOPException; | |||
public class RegionBefore extends Region { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new RegionBefore(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new RegionBefore(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -83,9 +85,10 @@ public class RegionBefore extends Region { | |||
private int precedence; | |||
protected RegionBefore(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected RegionBefore(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
precedence = this.properties.get("precedence").getEnum(); | |||
} | |||
@@ -72,9 +72,10 @@ public class RegionBody extends Region { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new RegionBody(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new RegionBody(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -85,9 +86,10 @@ public class RegionBody extends Region { | |||
public static final String REGION_CLASS = "body"; | |||
protected RegionBody(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected RegionBody(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { |
@@ -67,9 +67,11 @@ import org.apache.fop.apps.FOPException; | |||
public class RegionEnd extends Region { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new RegionEnd(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new RegionEnd(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -81,9 +83,10 @@ public class RegionEnd extends Region { | |||
public static final String REGION_CLASS = "end"; | |||
protected RegionEnd(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected RegionEnd(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { |
@@ -67,9 +67,11 @@ import org.apache.fop.apps.FOPException; | |||
public class RegionStart extends Region { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new RegionStart(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new RegionStart(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -81,9 +83,10 @@ public class RegionStart extends Region { | |||
public static final String REGION_CLASS = "start"; | |||
protected RegionStart(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected RegionStart(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
} | |||
public String getName() { |
@@ -70,9 +70,11 @@ public class RepeatablePageMasterAlternatives extends FObj | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new RepeatablePageMasterAlternatives(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new RepeatablePageMasterAlternatives(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -92,9 +94,10 @@ public class RepeatablePageMasterAlternatives extends FObj | |||
private ArrayList conditionalPageMasterRefs; | |||
public RepeatablePageMasterAlternatives(FObj parent, PropertyList propertyList) | |||
throws FOPException { | |||
super(parent, propertyList); | |||
public RepeatablePageMasterAlternatives(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
if (parent.getName().equals("fo:page-sequence-master")) { | |||
this.pageSequenceMaster = (PageSequenceMaster)parent; | |||
@@ -102,7 +105,7 @@ public class RepeatablePageMasterAlternatives extends FObj | |||
} else { | |||
throw new FOPException("A fo:repeatable-page-master-alternatives" | |||
+ "must be child of fo:page-sequence-master, not " | |||
+ parent.getName()); | |||
+ parent.getName(), systemId, line, column); | |||
} | |||
String mr = getProperty("maximum-repeats").getString(); | |||
@@ -117,7 +120,7 @@ public class RepeatablePageMasterAlternatives extends FObj | |||
} | |||
} catch (NumberFormatException nfe) { | |||
throw new FOPException("Invalid number for " | |||
+ "'maximum-repeats' property"); | |||
+ "'maximum-repeats' property", systemId, line, column); | |||
} | |||
} | |||
conditionalPageMasterRefs = new ArrayList(); |
@@ -66,9 +66,11 @@ public class RepeatablePageMasterReference extends PageMasterReference | |||
private static final int INFINITE = -1; | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new RepeatablePageMasterReference(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new RepeatablePageMasterReference(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -80,9 +82,10 @@ public class RepeatablePageMasterReference extends PageMasterReference | |||
private int maximumRepeats; | |||
private int numberConsumed = 0; | |||
public RepeatablePageMasterReference(FObj parent, PropertyList propertyList) | |||
throws FOPException { | |||
super(parent, propertyList); | |||
public RepeatablePageMasterReference(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
if (getProperty("master-reference") != null) { | |||
this.masterName = getProperty("master-reference").getString(); | |||
if (parent.getName().equals("fo:page-sequence-master")) { | |||
@@ -90,7 +93,7 @@ public class RepeatablePageMasterReference extends PageMasterReference | |||
pageSequenceMaster.addSubsequenceSpecifier(this); | |||
} else { | |||
throw new FOPException("A fo:repeatable-page-master-reference must be child of fo:page-sequence-master, not " | |||
+ parent.getName()); | |||
+ parent.getName(), systemId, line, column); | |||
} | |||
} else { | |||
log.warn("A fo:repeatable-page-master-reference does not have a master-reference and so is being ignored"); | |||
@@ -107,7 +110,8 @@ public class RepeatablePageMasterReference extends PageMasterReference | |||
} | |||
} catch (NumberFormatException nfe) { | |||
throw new FOPException("Invalid number '" + mr | |||
+ "'for 'maximum-repeats' property"); | |||
+ "'for 'maximum-repeats' property", | |||
systemId, line, column); | |||
} | |||
} | |||
} |
@@ -64,9 +64,10 @@ import org.apache.fop.apps.FOPException; | |||
public class Root extends FObj { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new Root(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new Root(parent, propertyList, systemId, line, column); | |||
} | |||
} | |||
@@ -82,13 +83,14 @@ public class Root extends FObj { | |||
*/ | |||
PageSequence pageSequence; | |||
protected Root(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
super(parent, propertyList); | |||
protected Root(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
// this.properties.get("media-usage"); | |||
if (parent != null) { | |||
throw new FOPException("root must be root element"); | |||
throw new FOPException("root must be root element", systemId, line, column); | |||
} | |||
} | |||
@@ -74,9 +74,11 @@ public class SimplePageMaster extends FObj { | |||
private static final int FALLBACK_PAGE_WIDTH = 576000; | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new SimplePageMaster(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new SimplePageMaster(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -100,9 +102,10 @@ public class SimplePageMaster extends FObj { | |||
int beforeExtent, afterExtent, startExtent, endExtent; | |||
boolean afterPrecedence = false; | |||
protected SimplePageMaster(FObj parent, PropertyList propertyList) | |||
throws FOPException { | |||
super(parent, propertyList); | |||
protected SimplePageMaster(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
if (parent.getName().equals("fo:layout-master-set")) { | |||
this.layoutMasterSet = (LayoutMasterSet)parent; | |||
@@ -116,7 +119,7 @@ public class SimplePageMaster extends FObj { | |||
} else { | |||
throw new FOPException("fo:simple-page-master must be child " | |||
+ "of fo:layout-master-set, not " | |||
+ parent.getName()); | |||
+ parent.getName(), systemId, line, column); | |||
} | |||
_regions = new HashMap(); | |||
@@ -212,7 +215,8 @@ public class SimplePageMaster extends FObj { | |||
if (_regions.containsKey(region.getRegionClass())) { | |||
throw new FOPException("Only one region of class " | |||
+ region.getRegionClass() | |||
+ " allowed within a simple-page-master."); | |||
+ " allowed within a simple-page-master.", | |||
systemId, line, column); | |||
} else { | |||
_regions.put(region.getRegionClass(), region); | |||
} |
@@ -63,9 +63,11 @@ import org.apache.fop.apps.FOPException; | |||
public class SinglePageMasterReference extends PageMasterReference { | |||
public static class Maker extends FObj.Maker { | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new SinglePageMasterReference(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new SinglePageMasterReference(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -79,9 +81,10 @@ public class SinglePageMasterReference extends PageMasterReference { | |||
private int state; | |||
public SinglePageMasterReference(FObj parent, PropertyList propertyList) | |||
throws FOPException { | |||
super(parent, propertyList); | |||
public SinglePageMasterReference(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
super(parent, propertyList, systemId, line, column); | |||
if (getProperty("master-reference") != null) { | |||
this.masterName = getProperty("master-reference").getString(); | |||
if (parent.getName().equals("fo:page-sequence-master")) { | |||
@@ -89,7 +92,7 @@ public class SinglePageMasterReference extends PageMasterReference { | |||
pageSequenceMaster.addSubsequenceSpecifier(this); | |||
} else { | |||
throw new FOPException("A fo:single-page-master-reference must be child of fo:page-sequence-master, not " | |||
+ parent.getName()); | |||
+ parent.getName(), systemId, line, column); | |||
} | |||
} else { | |||
log.warn("A fo:single-page-master-reference does not have a master-reference and so is being ignored"); |
@@ -89,9 +89,11 @@ public class SVGElement extends SVGObj { | |||
* | |||
* @return the SVG object | |||
*/ | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new SVGElement(parent, propertyList); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new SVGElement(parent, propertyList, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -112,8 +114,9 @@ public class SVGElement extends SVGObj { | |||
* @param parent the parent formatting object | |||
* @param propertyList the explicit properties of this object | |||
*/ | |||
public SVGElement(FObj parent, PropertyList propertyList) { | |||
super(parent, propertyList, "svg"); | |||
public SVGElement(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) { | |||
super(parent, propertyList, "svg", systemId, line, column); | |||
init(); | |||
} | |||
@@ -72,9 +72,11 @@ public class SVGObj extends XMLObj { | |||
* | |||
* @return the svg object | |||
*/ | |||
public FObj make(FObj parent, | |||
PropertyList propertyList) throws FOPException { | |||
return new SVGObj(parent, propertyList, tag); | |||
public FObj make(FObj parent, PropertyList propertyList, | |||
String systemId, int line, int column) | |||
throws FOPException { | |||
return new SVGObj(parent, propertyList, tag, | |||
systemId, line, column); | |||
} | |||
} | |||
@@ -93,8 +95,9 @@ public class SVGObj extends XMLObj { | |||
* @param parent the parent formatting object | |||
* @param propertyList the explicit properties of this object | |||
*/ | |||
protected SVGObj(FObj parent, PropertyList propertyList, String tag) { | |||
super(parent, propertyList, tag); | |||
protected SVGObj(FObj parent, PropertyList propertyList, String tag, | |||
String systemId, int line, int column) { | |||
super(parent, propertyList, tag, systemId, line, column); | |||
} | |||
public String getName() { |