You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ac...@apache.org on 2008/04/14 15:06:05 UTC
svn commit: r647787 [3/5] - in
/xmlgraphics/fop/branches/Temp_AFPGOCAResources: ./
examples/embedding/java/embedding/events/ lib/build/ src/codegen/java/
src/codegen/java/org/ src/codegen/java/org/apache/
src/codegen/java/org/apache/fop/ src/codegen/ja...
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/Table.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/Table.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/Table.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/Table.java Mon Apr 14 06:05:52 2008
@@ -22,6 +22,8 @@
import java.util.ArrayList;
import java.util.List;
+import org.xml.sax.Locator;
+
import org.apache.fop.apps.FOPException;
import org.apache.fop.datatypes.Length;
import org.apache.fop.datatypes.ValidationPercentBaseContext;
@@ -35,7 +37,6 @@
import org.apache.fop.fo.properties.LengthPairProperty;
import org.apache.fop.fo.properties.LengthRangeProperty;
import org.apache.fop.fo.properties.TableColLength;
-import org.xml.sax.Locator;
/**
* Class modelling the fo:table object.
@@ -126,20 +127,22 @@
orphanContentLimit = pList.get(PR_X_ORPHAN_CONTENT_LIMIT).getLength();
if (!blockProgressionDimension.getOptimum(null).isAuto()) {
- attributeWarning("only a value of \"auto\" for block-progression-dimension has a"
- + " well-specified behavior on fo:table. Falling back to \"auto\"");
+ TableEventProducer eventProducer = TableEventProducer.Provider.get(
+ getUserAgent().getEventBroadcaster());
+ eventProducer.nonAutoBPDOnTable(this, getLocator());
// Anyway, the bpd of a table is not used by the layout code
}
if (tableLayout == EN_AUTO) {
- attributeWarning("table-layout=\"auto\" is currently not supported by FOP");
+ getFOValidationEventProducer().unimplementedFeature(this, getName(),
+ "table-layout=\"auto\"", getLocator());
}
if (!isSeparateBorderModel()
&& getCommonBorderPaddingBackground().hasPadding(
ValidationPercentBaseContext.getPseudoContext())) {
//See "17.6.2 The collapsing border model" in CSS2
- attributeWarning("In collapsing border model a table does not have padding"
- + " (see http://www.w3.org/TR/REC-CSS2/tables.html#collapsing-borders)"
- + ", but a non-zero value for padding was found. The padding will be ignored.");
+ TableEventProducer eventProducer = TableEventProducer.Provider.get(
+ getUserAgent().getEventBroadcaster());
+ eventProducer.noTablePaddingWithCollapsingBorderModel(this, getLocator());
}
/* Store reference to the property list, so
@@ -163,7 +166,7 @@
* XSL Content Model: (marker*,table-column*,table-header?,table-footer?,table-body+)
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
- throws ValidationException {
+ throws ValidationException {
if (FO_URI.equals(nsURI)) {
if ("marker".equals(localName)) {
if (tableColumnFound || tableHeaderFound || tableFooterFound
@@ -193,15 +196,11 @@
} else {
tableFooterFound = true;
if (tableBodyFound) {
- if (getUserAgent().validateStrictly()) {
- nodesOutOfOrderError(loc, "fo:table-footer", "(table-body+)");
- } else if (!isSeparateBorderModel()) {
- nodesOutOfOrderError(loc, "fo:table-footer", "(table-body+)."
- + " This table uses the collapsing border"
- + " model. In order to resolve borders in an efficient way"
- + " the table-footer must be known before any table-body"
- + " is parsed. Either put the footer at the correct place"
- + " or switch to the separate border model");
+ nodesOutOfOrderError(loc, "fo:table-footer", "(table-body+)", true);
+ if (!isSeparateBorderModel()) {
+ TableEventProducer eventProducer = TableEventProducer.Provider.get(
+ getUserAgent().getEventBroadcaster());
+ eventProducer.footerOrderCannotRecover(this, getName(), getLocator());
}
}
}
@@ -210,8 +209,6 @@
} else {
invalidChildError(loc, nsURI, localName);
}
- } else {
- invalidChildError(loc, nsURI, localName);
}
}
@@ -224,6 +221,10 @@
missingChildElementError(
"(marker*,table-column*,table-header?,table-footer?"
+ ",table-body+)");
+ }
+ if (!hasChildren()) {
+ getParent().removeChild(this);
+ return;
}
if (!inMarker()) {
rowGroupBuilder.endTable();
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java Mon Apr 14 06:05:52 2008
@@ -62,7 +62,8 @@
super(parent);
if (!notImplementedWarningGiven) {
- log.warn("fo:table-and-caption is not yet implemented.");
+ getFOValidationEventProducer().unimplementedFeature(this, getName(),
+ "fo:table-and-caption", getLocator());
notImplementedWarningGiven = true;
}
}
@@ -83,30 +84,32 @@
* XSL Content Model: marker* table-caption? table
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
- throws ValidationException {
+ throws ValidationException {
- if (FO_URI.equals(nsURI) && localName.equals("marker")) {
- if (tableCaptionFound) {
- nodesOutOfOrderError(loc, "fo:marker", "fo:table-caption");
- } else if (tableFound) {
- nodesOutOfOrderError(loc, "fo:marker", "fo:table");
- }
- } else if (FO_URI.equals(nsURI) && localName.equals("table-caption")) {
- if (tableCaptionFound) {
- tooManyNodesError(loc, "fo:table-caption");
- } else if (tableFound) {
- nodesOutOfOrderError(loc, "fo:table-caption", "fo:table");
- } else {
- tableCaptionFound = true;
- }
- } else if (FO_URI.equals(nsURI) && localName.equals("table")) {
- if (tableFound) {
- tooManyNodesError(loc, "fo:table");
+ if (FO_URI.equals(nsURI)) {
+ if (localName.equals("marker")) {
+ if (tableCaptionFound) {
+ nodesOutOfOrderError(loc, "fo:marker", "fo:table-caption");
+ } else if (tableFound) {
+ nodesOutOfOrderError(loc, "fo:marker", "fo:table");
+ }
+ } else if (localName.equals("table-caption")) {
+ if (tableCaptionFound) {
+ tooManyNodesError(loc, "fo:table-caption");
+ } else if (tableFound) {
+ nodesOutOfOrderError(loc, "fo:table-caption", "fo:table");
+ } else {
+ tableCaptionFound = true;
+ }
+ } else if (localName.equals("table")) {
+ if (tableFound) {
+ tooManyNodesError(loc, "fo:table");
+ } else {
+ tableFound = true;
+ }
} else {
- tableFound = true;
+ invalidChildError(loc, nsURI, localName);
}
- } else {
- invalidChildError(loc, nsURI, localName);
}
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableBody.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableBody.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableBody.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableBody.java Mon Apr 14 06:05:52 2008
@@ -23,13 +23,14 @@
import java.util.LinkedList;
import java.util.List;
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+
import org.apache.fop.apps.FOPException;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.ValidationException;
import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
/**
* Class modelling the fo:table-body object.
@@ -119,13 +120,8 @@
getFOEventHandler().endBody(this);
if (!(tableRowsFound || tableCellsFound)) {
- if (getUserAgent().validateStrictly()) {
- missingChildElementError("marker* (table-row+|table-cell+)");
- } else {
- log.error("fo:table-body must not be empty. "
- + "Expected: marker* (table-row+|table-cell+)");
- getParent().removeChild(this);
- }
+ missingChildElementError("marker* (table-row+|table-cell+)", true);
+ getParent().removeChild(this);
} else {
finishLastRowGroup();
}
@@ -167,23 +163,20 @@
} else if (localName.equals("table-row")) {
tableRowsFound = true;
if (tableCellsFound) {
- invalidChildError(loc, nsURI, localName, "Either fo:table-rows"
- + " or fo:table-cells may be children of an " + getName()
- + " but not both");
+ TableEventProducer eventProducer = TableEventProducer.Provider.get(
+ getUserAgent().getEventBroadcaster());
+ eventProducer.noMixRowsAndCells(this, getName(), getLocator());
}
} else if (localName.equals("table-cell")) {
tableCellsFound = true;
if (tableRowsFound) {
- invalidChildError(loc, nsURI, localName,
- "Either fo:table-rows or fo:table-cells "
- + "may be children of an "
- + getName() + " but not both");
+ TableEventProducer eventProducer = TableEventProducer.Provider.get(
+ getUserAgent().getEventBroadcaster());
+ eventProducer.noMixRowsAndCells(this, getName(), getLocator());
}
} else {
invalidChildError(loc, nsURI, localName);
}
- } else {
- invalidChildError(loc, nsURI, localName);
}
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableCaption.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableCaption.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableCaption.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableCaption.java Mon Apr 14 06:05:52 2008
@@ -57,7 +57,8 @@
super(parent);
if (!notImplementedWarningGiven) {
- log.warn("fo:table-caption is not yet implemented.");
+ getFOValidationEventProducer().unimplementedFeature(this, getName(),
+ "fo:table-caption", getLocator());
notImplementedWarningGiven = true;
}
}
@@ -83,15 +84,17 @@
* XSL Content Model: marker* (%block;)
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
- throws ValidationException {
- if (FO_URI.equals(nsURI) && localName.equals("marker")) {
- if (blockItemFound) {
- nodesOutOfOrderError(loc, "fo:marker", "(%block;)");
+ throws ValidationException {
+ if (FO_URI.equals(nsURI)) {
+ if (localName.equals("marker")) {
+ if (blockItemFound) {
+ nodesOutOfOrderError(loc, "fo:marker", "(%block;)");
+ }
+ } else if (!isBlockItem(nsURI, localName)) {
+ invalidChildError(loc, nsURI, localName);
+ } else {
+ blockItemFound = true;
}
- } else if (!isBlockItem(nsURI, localName)) {
- invalidChildError(loc, nsURI, localName);
- } else {
- blockItemFound = true;
}
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableCell.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableCell.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableCell.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableCell.java Mon Apr 14 06:05:52 2008
@@ -102,17 +102,13 @@
*/
public void endOfNode() throws FOPException {
if (!blockItemFound) {
- if (getUserAgent().validateStrictly()) {
- missingChildElementError("marker* (%block;)+");
- } else if (firstChild != null) {
- log.warn("fo:table-cell content that is not "
- + "enclosed by a fo:block will be dropped/ignored.");
- }
+ missingChildElementError("marker* (%block;)+", true);
}
if ((startsRow() || endsRow())
&& getParent().getNameId() == FO_TABLE_ROW ) {
- log.warn("starts-row/ends-row for fo:table-cells "
- + "non-applicable for children of an fo:table-row.");
+ TableEventProducer eventProducer = TableEventProducer.Provider.get(
+ getUserAgent().getEventBroadcaster());
+ eventProducer.startEndRowUnderTableRowWarning(this, getLocator());
}
getFOEventHandler().endCell(this);
}
@@ -123,14 +119,16 @@
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
- if (FO_URI.equals(nsURI) && localName.equals("marker")) {
- if (blockItemFound) {
- nodesOutOfOrderError(loc, "fo:marker", "(%block;)");
+ if (FO_URI.equals(nsURI)) {
+ if (localName.equals("marker")) {
+ if (blockItemFound) {
+ nodesOutOfOrderError(loc, "fo:marker", "(%block;)");
+ }
+ } else if (!isBlockItem(nsURI, localName)) {
+ invalidChildError(loc, nsURI, localName);
+ } else {
+ blockItemFound = true;
}
- } else if (!isBlockItem(nsURI, localName)) {
- invalidChildError(loc, nsURI, localName);
- } else {
- blockItemFound = true;
}
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableCellContainer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableCellContainer.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableCellContainer.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableCellContainer.java Mon Apr 14 06:05:52 2008
@@ -24,7 +24,6 @@
import org.apache.fop.apps.FOPException;
import org.apache.fop.datatypes.Length;
import org.apache.fop.fo.FONode;
-import org.apache.fop.fo.ValidationException;
/**
* A common class for fo:table-body and fo:table-row which both can contain fo:table-cell.
@@ -47,9 +46,9 @@
Table t = getTable();
if (t.hasExplicitColumns()) {
if (colNumber + colSpan - 1 > t.getNumberOfColumns()) {
- throw new ValidationException(FONode.errorText(locator) + "column-number or "
- + "number of cells in the row overflows the number of fo:table-column "
- + "specified for the table.");
+ TableEventProducer eventProducer = TableEventProducer.Provider.get(
+ getUserAgent().getEventBroadcaster());
+ eventProducer.tooManyCells(this, getLocator());
}
} else {
t.ensureColumnNumber(colNumber + colSpan - 1);
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableColumn.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableColumn.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableColumn.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableColumn.java Mon Apr 14 06:05:52 2008
@@ -82,12 +82,16 @@
super.bind(pList);
if (numberColumnsRepeated <= 0) {
- throw new PropertyException("number-columns-repeated must be 1 or bigger, "
- + "but got " + numberColumnsRepeated);
+ TableEventProducer eventProducer = TableEventProducer.Provider.get(
+ getUserAgent().getEventBroadcaster());
+ eventProducer.valueMustBeBiggerGtEqOne(this,
+ "number-columns-repeated", numberColumnsRepeated, getLocator());
}
if (numberColumnsSpanned <= 0) {
- throw new PropertyException("number-columns-spanned must be 1 or bigger, "
- + "but got " + numberColumnsSpanned);
+ TableEventProducer eventProducer = TableEventProducer.Provider.get(
+ getUserAgent().getEventBroadcaster());
+ eventProducer.valueMustBeBiggerGtEqOne(this,
+ "number-columns-spanned", numberColumnsSpanned, getLocator());
}
/* check for unspecified width and replace with default of
@@ -96,8 +100,9 @@
*/
if (columnWidth.getEnum() == EN_AUTO) {
if (!this.implicitColumn && !getTable().isAutoLayout()) {
- log.warn("table-layout=\"fixed\" and column-width unspecified "
- + "=> falling back to proportional-column-width(1)");
+ TableEventProducer eventProducer = TableEventProducer.Provider.get(
+ getUserAgent().getEventBroadcaster());
+ eventProducer.warnImplicitColumns(this, getLocator());
}
columnWidth = new TableColLength(1.0, this);
}
@@ -146,7 +151,9 @@
protected void validateChildNode(Locator loc,
String nsURI, String localName)
throws ValidationException {
+ if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
+ }
}
/**
@@ -240,7 +247,7 @@
*
* @param propId the id for the property to retrieve
* @return the requested Property
- * @throws PropertyException
+ * @throws PropertyException if there is a problem evaluating the property
*/
public Property getProperty(int propId) throws PropertyException {
return this.pList.get(propId);
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableFObj.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableFObj.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableFObj.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableFObj.java Mon Apr 14 06:05:52 2008
@@ -58,9 +58,7 @@
super(parent);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {
super.bind(pList);
borderAfterPrecedence = pList.get(PR_BORDER_AFTER_PRECEDENCE).getNumeric();
@@ -71,9 +69,9 @@
&& getNameId() != FO_TABLE_CELL
&& getCommonBorderPaddingBackground().hasPadding(
ValidationPercentBaseContext.getPseudoContext())) {
- attributeWarning(
- "padding-* properties are not applicable to " + getName()
- + ", but a non-zero value for padding was found.");
+ TableEventProducer eventProducer = TableEventProducer.Provider.get(
+ getUserAgent().getEventBroadcaster());
+ eventProducer.paddingNotApplicable(this, getName(), getLocator());
}
}
@@ -156,17 +154,19 @@
ColumnNumberManager columnIndexManager = parent.getColumnNumberManager();
int columnIndex = p.getNumeric().getValue();
if (columnIndex <= 0) {
+ /* No warning necessary as the spec clearly defines how to handle these cases.
log.warn("Specified negative or zero value for "
+ "column-number on " + fo.getName() + ": "
+ columnIndex + " forced to "
- + columnIndexManager.getCurrentColumnNumber());
+ + columnIndexManager.getCurrentColumnNumber());*/
return NumberProperty.getInstance(columnIndexManager.getCurrentColumnNumber());
} else {
double tmpIndex = p.getNumeric().getNumericValue();
if (tmpIndex - columnIndex > 0.0) {
columnIndex = (int) Math.round(tmpIndex);
+ /* No warning necessary as the spec clearly defines how to handle these cases.
log.warn("Rounding specified column-number of "
- + tmpIndex + " to " + columnIndex);
+ + tmpIndex + " to " + columnIndex);*/
p = NumberProperty.getInstance(columnIndex);
}
}
@@ -179,16 +179,9 @@
/* if column-number is already in use by another
* cell/column => error!
*/
- StringBuffer errorMessage = new StringBuffer();
- errorMessage.append(fo.getName() + " overlaps in column ")
- .append(columnIndex + i);
- org.xml.sax.Locator loc = fo.getLocator();
- if (loc != null && loc.getLineNumber() != -1) {
- errorMessage.append(" (line #")
- .append(loc.getLineNumber()).append(", column #")
- .append(loc.getColumnNumber()).append(")");
- }
- throw new PropertyException(errorMessage.toString());
+ TableEventProducer eventProducer = TableEventProducer.Provider.get(
+ fo.getUserAgent().getEventBroadcaster());
+ eventProducer.cellOverlap(this, fo.getName(), columnIndex + 1, fo.getLocator());
}
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableRow.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableRow.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableRow.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableRow.java Mon Apr 14 06:05:52 2008
@@ -19,6 +19,9 @@
package org.apache.fop.fo.flow.table;
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+
import org.apache.fop.apps.FOPException;
import org.apache.fop.datatypes.Length;
import org.apache.fop.fo.FONode;
@@ -27,8 +30,6 @@
import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
import org.apache.fop.fo.properties.KeepProperty;
import org.apache.fop.fo.properties.LengthRangeProperty;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
/**
* Class modelling the fo:table-row object.
@@ -122,9 +123,11 @@
*/
protected void validateChildNode(Locator loc, String nsURI,
String localName)
- throws ValidationException {
- if (!(FO_URI.equals(nsURI) && localName.equals("table-cell"))) {
- invalidChildError(loc, nsURI, localName);
+ throws ValidationException {
+ if (FO_URI.equals(nsURI)) {
+ if (!localName.equals("table-cell")) {
+ invalidChildError(loc, nsURI, localName);
+ }
}
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java Mon Apr 14 06:05:52 2008
@@ -32,7 +32,9 @@
public abstract class AbstractPageSequence extends FObj {
// The value of properties relevant for fo:page-sequence.
+ /** the initial-page-number value */
protected Numeric initialPageNumber;
+ /** the force-page-count value */
protected int forcePageCount;
private String format;
private int letterValue;
@@ -43,6 +45,7 @@
private PageNumberGenerator pageNumberGenerator;
+ /** the first page number generated by the page sequence */
protected int startingPageNumber = 0;
/**
@@ -54,9 +57,7 @@
super(parent);
}
- /**
- * @see org.apache.fop.fo.FObj#bind(PropertyList)
- */
+ /** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {
super.bind(pList);
initialPageNumber = pList.get(PR_INITIAL_PAGE_NUMBER).getNumeric();
@@ -68,16 +69,14 @@
referenceOrientation = pList.get(PR_REFERENCE_ORIENTATION).getNumeric();
}
- /**
- * @see org.apache.fop.fo.FONode#startOfNode()
- */
+ /** {@inheritDoc} */
protected void startOfNode() throws FOPException {
this.pageNumberGenerator = new PageNumberGenerator(
format, groupingSeparator, groupingSize, letterValue);
}
- /** @see org.apache.fop.fo.FONode#endOfNode() */
+ /** {@inheritDoc} */
protected void endOfNode() throws FOPException {
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/ColorProfile.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/ColorProfile.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/ColorProfile.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/ColorProfile.java Mon Apr 14 06:05:52 2008
@@ -19,14 +19,14 @@
package org.apache.fop.fo.pagination;
+import org.xml.sax.Locator;
+
import org.apache.fop.apps.FOPException;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.ValidationException;
-import org.xml.sax.Locator;
-
/**
* The fo:color-profile formatting object.
* This loads the color profile when needed and resolves a requested color.
@@ -39,15 +39,15 @@
// End of property values
/**
+ * Creates a new color-profile element.
+ * @param parent the parent node
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
public ColorProfile(FONode parent) {
super(parent);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {
src = pList.get(PR_SRC).getString();
colorProfileName = pList.get(PR_COLOR_PROFILE_NAME).getString();
@@ -59,12 +59,15 @@
XSL 1.0/FOP: EMPTY (no child nodes permitted)
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
- throws ValidationException {
- invalidChildError(loc, nsURI, localName);
+ throws ValidationException {
+ if (FO_URI.equals(nsURI)) {
+ invalidChildError(loc, nsURI, localName);
+ }
}
/**
* Return the "color-profile-name" property.
+ * @return the color-profile-name property
*/
public String getColorProfileName() {
return colorProfileName;
@@ -75,9 +78,7 @@
return "color-profile";
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public int getNameId() {
return FO_COLOR_PROFILE;
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java Mon Apr 14 06:05:52 2008
@@ -45,15 +45,15 @@
// End of property values
/**
+ * Creates a new conditional-page-master-reference element.
+ * @param parent the parent node
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
public ConditionalPageMasterReference(FONode parent) {
super(parent);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {
masterReference = pList.get(PR_MASTER_REFERENCE).getString();
pagePosition = pList.get(PR_PAGE_POSITION).getEnum();
@@ -65,9 +65,7 @@
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void startOfNode() throws FOPException {
getConcreteParent().addConditionalPageMasterReference(this);
}
@@ -81,8 +79,10 @@
* XSL Content Model: empty
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
- throws ValidationException {
- invalidChildError(loc, nsURI, localName);
+ throws ValidationException {
+ if (FO_URI.equals(nsURI)) {
+ invalidChildError(loc, nsURI, localName);
+ }
}
/**
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/Declarations.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/Declarations.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/Declarations.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/Declarations.java Mon Apr 14 06:05:52 2008
@@ -42,6 +42,7 @@
private Map colorProfiles = null;
/**
+ * Creates a new declarations element.
* @param parent FONode that is the parent of this object
*/
public Declarations(FONode parent) {
@@ -49,9 +50,7 @@
((Root) parent).setDeclarations(this);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {
// No properties defined for fo:declarations
}
@@ -73,6 +72,7 @@
/**
* At the end of this element sort out the children into
* a hashmap of color profiles and a list of extension attachments.
+ * @throws FOPException if there's a problem during processing
*/
protected void endOfNode() throws FOPException {
if (firstChild != null) {
@@ -83,7 +83,8 @@
if (!"".equals(cp.getColorProfileName())) {
addColorProfile(cp);
} else {
- log.warn("color-profile-name required for color profile");
+ getFOValidationEventProducer().missingProperty(this,
+ cp.getName(), "color-profile-name", locator);
}
} else {
log.debug("Ignoring element " + node.getName()
@@ -100,22 +101,18 @@
}
if (colorProfiles.get(cp.getColorProfileName()) != null) {
// duplicate names
- log.warn("Duplicate fo:color-profile profile name: "
- + cp.getColorProfileName());
+ getFOValidationEventProducer().colorProfileNameNotUnique(this,
+ cp.getName(), cp.getColorProfileName(), locator);
}
colorProfiles.put(cp.getColorProfileName(), cp);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public String getLocalName() {
return "declarations";
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public int getNameId() {
return FO_DECLARATIONS;
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/Flow.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/Flow.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/Flow.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/Flow.java Mon Apr 14 06:05:52 2008
@@ -45,16 +45,12 @@
super(parent);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {
flowName = pList.get(PR_FLOW_NAME).getString();
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void startOfNode() throws FOPException {
if (flowName == null || flowName.equals("")) {
missingPropertyError("flow-name");
@@ -80,10 +76,7 @@
getFOEventHandler().startFlow(this);
}
- /**
- * Make sure content model satisfied, if so then tell the
- * FOEventHandler that we are at the end of the flow.
- */
+ /** {@inheritDoc} */
protected void endOfNode() throws FOPException {
if (!blockItemFound) {
missingChildElementError("marker* (%block;)+");
@@ -96,21 +89,21 @@
* XSL Content Model: marker* (%block;)+
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
- throws ValidationException {
- if (FO_URI.equals(nsURI) && localName.equals("marker")) {
- if (blockItemFound) {
- nodesOutOfOrderError(loc, "fo:marker", "(%block;)");
+ throws ValidationException {
+ if (FO_URI.equals(nsURI)) {
+ if (localName.equals("marker")) {
+ if (blockItemFound) {
+ nodesOutOfOrderError(loc, "fo:marker", "(%block;)");
+ }
+ } else if (!isBlockItem(nsURI, localName)) {
+ invalidChildError(loc, nsURI, localName);
+ } else {
+ blockItemFound = true;
}
- } else if (!isBlockItem(nsURI, localName)) {
- invalidChildError(loc, nsURI, localName);
- } else {
- blockItemFound = true;
}
}
- /**
- * @return true (Flow can generate reference areas)
- */
+ /** {@inheritDoc} */
public boolean generatesReferenceAreas() {
return true;
}
@@ -125,9 +118,7 @@
return "flow";
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public int getNameId() {
return FO_FLOW;
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java Mon Apr 14 06:05:52 2008
@@ -46,31 +46,27 @@
private Map pageSequenceMasters;
/**
+ * Creates a new layout-master-set element.
+ * @param parent the parent node
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
public LayoutMasterSet(FONode parent) {
super(parent);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {
// No properties in layout-master-set.
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void startOfNode() throws FOPException {
getRoot().setLayoutMasterSet(this);
simplePageMasters = new java.util.HashMap();
pageSequenceMasters = new java.util.HashMap();
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void endOfNode() throws FOPException {
if (firstChild == null) {
missingChildElementError("(simple-page-master|page-sequence-master)+");
@@ -83,14 +79,12 @@
XSL/FOP: (simple-page-master|page-sequence-master)+
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
- throws ValidationException {
+ throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (!localName.equals("simple-page-master")
&& !localName.equals("page-sequence-master")) {
invalidChildError(loc, nsURI, localName);
}
- } else {
- invalidChildError(loc, nsURI, localName);
}
}
@@ -104,23 +98,20 @@
Map allRegions = new java.util.HashMap();
for (Iterator spm = simplePageMasters.values().iterator();
spm.hasNext();) {
- SimplePageMaster simplePageMaster =
- (SimplePageMaster)spm.next();
+ SimplePageMaster simplePageMaster
+ = (SimplePageMaster)spm.next();
Map spmRegions = simplePageMaster.getRegions();
for (Iterator e = spmRegions.values().iterator();
e.hasNext();) {
Region region = (Region) e.next();
if (allRegions.containsKey(region.getRegionName())) {
- String defaultRegionName =
- (String) allRegions.get(region.getRegionName());
+ String defaultRegionName
+ = (String) allRegions.get(region.getRegionName());
if (!defaultRegionName.equals(region.getDefaultRegionName())) {
- throw new ValidationException("Region-name ("
- + region.getRegionName()
- + ") is being mapped to multiple "
- + "region-classes ("
- + defaultRegionName + " and "
- + region.getDefaultRegionName()
- + ")", locator);
+ getFOValidationEventProducer().regionNameMappedToMultipleRegionClasses(this,
+ region.getRegionName(),
+ defaultRegionName,
+ region.getDefaultRegionName(), getLocator());
}
}
allRegions.put(region.getRegionName(),
@@ -141,21 +132,16 @@
// check for duplication of master-name
String masterName = sPM.getMasterName();
if (existsName(masterName)) {
- throw new ValidationException("'master-name' ("
- + masterName
- + ") must be unique "
- + "across page-masters and page-sequence-masters", sPM.getLocator());
+ getFOValidationEventProducer().masterNameNotUnique(this,
+ getName(),
+ masterName, sPM.getLocator());
}
this.simplePageMasters.put(masterName, sPM);
}
private boolean existsName(String masterName) {
- if (simplePageMasters.containsKey(masterName)
- || pageSequenceMasters.containsKey(masterName)) {
- return true;
- } else {
- return false;
- }
+ return (simplePageMasters.containsKey(masterName)
+ || pageSequenceMasters.containsKey(masterName));
}
/**
@@ -181,10 +167,9 @@
throws ValidationException {
// check against duplication of master-name
if (existsName(masterName)) {
- throw new ValidationException("'master-name' ("
- + masterName
- + ") must be unique "
- + "across page-masters and page-sequence-masters", pSM.getLocator());
+ getFOValidationEventProducer().masterNameNotUnique(this,
+ getName(),
+ masterName, pSM.getLocator());
}
this.pageSequenceMasters.put(masterName, pSM);
}
@@ -220,9 +205,7 @@
return "layout-master-set";
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public int getNameId() {
return FO_LAYOUT_MASTER_SET;
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java Mon Apr 14 06:05:52 2008
@@ -43,7 +43,7 @@
private int minPadding = 0; // for decimal formats
// preloaded strings of zeros
- private String zeros[] = {
+ private String[] zeros = {
"", "0", "00", "000", "0000", "00000"
};
@@ -128,10 +128,10 @@
}
private String makeRoman(int num) {
- int arabic[] = {
+ int[] arabic = {
1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1
};
- String roman[] = {
+ String[] roman = {
"m", "cm", "d", "cd", "c", "xc", "l", "xl", "x", "ix", "v", "iv",
"i"
};
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageSequence.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageSequence.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageSequence.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageSequence.java Mon Apr 14 06:05:52 2008
@@ -78,9 +78,7 @@
super(parent);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {
super.bind(pList);
country = pList.get(PR_COUNTRY).getString();
@@ -93,9 +91,7 @@
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void startOfNode() throws FOPException {
super.startOfNode();
flowMap = new java.util.HashMap();
@@ -105,9 +101,8 @@
this.pageSequenceMaster
= getRoot().getLayoutMasterSet().getPageSequenceMaster(masterReference);
if (this.pageSequenceMaster == null) {
- throw new ValidationException("master-reference '" + masterReference
- + "' for fo:page-sequence matches no"
- + " simple-page-master or page-sequence-master", locator);
+ getFOValidationEventProducer().masterNotFound(this, getName(),
+ masterReference, getLocator());
}
}
@@ -128,7 +123,7 @@
XSL Content Model: (title?,static-content*,flow)
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
- throws ValidationException {
+ throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("title")) {
if (titleFO != null) {
@@ -149,8 +144,6 @@
} else {
invalidChildError(loc, nsURI, localName);
}
- } else {
- invalidChildError(loc, nsURI, localName);
}
}
@@ -184,18 +177,15 @@
String flowName = flow.getFlowName();
if (hasFlowName(flowName)) {
- throw new ValidationException("duplicate flow-name \""
- + flowName
- + "\" found within fo:page-sequence", flow.getLocator());
+ getFOValidationEventProducer().duplicateFlowNameInPageSequence(this, flow.getName(),
+ flowName, flow.getLocator());
}
if (!getRoot().getLayoutMasterSet().regionNameExists(flowName)
&& !flowName.equals("xsl-before-float-separator")
&& !flowName.equals("xsl-footnote-separator")) {
- throw new ValidationException("flow-name \""
- + flowName
- + "\" could not be mapped to a region-name in the"
- + " layout-master-set", flow.getLocator());
+ getFOValidationEventProducer().flowNameNotMapped(this, flow.getName(),
+ flowName, flow.getLocator());
}
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java Mon Apr 14 06:05:52 2008
@@ -29,6 +29,7 @@
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.ValidationException;
+import org.apache.fop.layoutmgr.BlockLevelEventProducer;
/**
* The page-sequence-master formatting object.
@@ -53,6 +54,8 @@
// but the actual FO's are MasterReferences.
/**
+ * Creates a new page-sequence-master element.
+ * @param parent the parent node
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
public PageSequenceMaster(FONode parent) {
@@ -95,20 +98,18 @@
* repeatable-page-master-alternatives)+
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
- throws ValidationException {
+ throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (!localName.equals("single-page-master-reference")
&& !localName.equals("repeatable-page-master-reference")
&& !localName.equals("repeatable-page-master-alternatives")) {
invalidChildError(loc, nsURI, localName);
}
- } else {
- invalidChildError(loc, nsURI, localName);
}
}
/**
- * Adds a new suqsequence specifier to the page sequence master.
+ * Adds a new subsequence specifier to the page sequence master.
* @param pageMasterReference the subsequence to add
*/
protected void addSubsequenceSpecifier(SubSequenceSpecifier pageMasterReference) {
@@ -199,8 +200,10 @@
if (currentSubSequence == null) {
currentSubSequence = getNextSubSequence();
if (currentSubSequence == null) {
- throw new FOPException("no subsequences in page-sequence-master '"
- + masterName + "'");
+ BlockLevelEventProducer eventProducer = BlockLevelEventProducer.Provider.get(
+ getUserAgent().getEventBroadcaster());
+ eventProducer.missingSubsequencesInPageSequenceMaster(this,
+ masterName, getLocator());
}
}
String pageMasterName = currentSubSequence
@@ -209,14 +212,10 @@
while (pageMasterName == null) {
SubSequenceSpecifier nextSubSequence = getNextSubSequence();
if (nextSubSequence == null) {
- if (!canRecover) {
- throw new FOPException("subsequences exhausted in page-sequence-master '"
- + masterName
- + "', cannot recover");
- }
- log.warn("subsequences exhausted in page-sequence-master '"
- + masterName
- + "', using previous subsequence");
+ BlockLevelEventProducer eventProducer = BlockLevelEventProducer.Provider.get(
+ getUserAgent().getEventBroadcaster());
+ eventProducer.pageSequenceMasterExhausted(this,
+ masterName, canRecover, getLocator());
currentSubSequence.reset();
canRecover = false;
} else {
@@ -228,9 +227,10 @@
SimplePageMaster pageMaster = this.layoutMasterSet
.getSimplePageMaster(pageMasterName);
if (pageMaster == null) {
- throw new FOPException("No simple-page-master matching '"
- + pageMasterName + "' in page-sequence-master '"
- + masterName + "'");
+ BlockLevelEventProducer eventProducer = BlockLevelEventProducer.Provider.get(
+ getUserAgent().getEventBroadcaster());
+ eventProducer.noMatchingPageMaster(this,
+ masterName, pageMasterName, getLocator());
}
return pageMaster;
}
@@ -240,9 +240,7 @@
return "page-sequence-master";
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public int getNameId() {
return FO_PAGE_SEQUENCE_MASTER;
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageSequenceWrapper.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageSequenceWrapper.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageSequenceWrapper.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageSequenceWrapper.java Mon Apr 14 06:05:52 2008
@@ -22,8 +22,8 @@
import org.xml.sax.Locator;
import org.apache.fop.apps.FOPException;
-import org.apache.fop.fo.FObj;
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.ValidationException;
@@ -39,15 +39,14 @@
// End of property values
/**
+ * Creates a new page-sequence-wrapper element.
* @param parent FONode that is the parent of this object
*/
public PageSequenceWrapper(FONode parent) {
super(parent);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {
super.bind(pList);
indexClass = pList.get(PR_INDEX_CLASS).getString();
@@ -59,10 +58,12 @@
XSL/FOP: (bookmark+)
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
- throws ValidationException {
- if (!(FO_URI.equals(nsURI) && (localName.equals("page-sequence") ||
- localName.equals("page-sequence-wrapper")))) {
+ throws ValidationException {
+ if (FO_URI.equals(nsURI)) {
+ if (!(localName.equals("page-sequence")
+ || localName.equals("page-sequence-wrapper"))) {
invalidChildError(loc, nsURI, localName);
+ }
}
}
@@ -81,9 +82,7 @@
return "page-sequence-wrapper";
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public int getNameId() {
return FO_PAGE_SEQUENCE_WRAPPER;
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/Region.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/Region.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/Region.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/Region.java Mon Apr 14 06:05:52 2008
@@ -30,7 +30,6 @@
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.ValidationException;
-import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
/**
@@ -50,6 +49,8 @@
private SimplePageMaster layoutMaster;
/**
+ * Creates a new Region.
+ * @param parent the parent node
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
protected Region(FONode parent) {
@@ -57,9 +58,7 @@
layoutMaster = (SimplePageMaster) parent;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {
commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
// clip = pList.get(PR_CLIP);
@@ -76,18 +75,16 @@
// check that name is OK. Not very pretty.
if (isReserved(getRegionName())
&& !getRegionName().equals(getDefaultRegionName())) {
- throw new ValidationException("region-name '" + regionName
- + "' for " + this.getName()
- + " is not permitted.", locator);
+ getFOValidationEventProducer().illegalRegionName(this, getName(),
+ regionName, getLocator());
}
}
//TODO do we need context for getBPPaddingAndBorder() and getIPPaddingAndBorder()?
- if (getUserAgent().validateStrictly()
- && (getCommonBorderPaddingBackground().getBPPaddingAndBorder(false, null) != 0
+ if ((getCommonBorderPaddingBackground().getBPPaddingAndBorder(false, null) != 0
|| getCommonBorderPaddingBackground().getIPPaddingAndBorder(false, null) != 0)) {
- throw new PropertyException("Border and padding for region \""
- + regionName + "\" must be '0' (See 6.4.13 in XSL 1.0).");
+ getFOValidationEventProducer().nonZeroBorderPaddingOnRegion(this, getName(),
+ regionName, true, getLocator());
}
}
@@ -96,8 +93,10 @@
* XSL Content Model: empty
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
- throws ValidationException {
+ throws ValidationException {
+ if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
+ }
}
/**
@@ -121,7 +120,7 @@
* @param name a region name to check
* @return true if the name parameter is a reserved region name
*/
- protected boolean isReserved(String name) /*throws FOPException*/ {
+ protected boolean isReserved(String name) {
return (name.equals("xsl-region-before")
|| name.equals("xsl-region-start")
|| name.equals("xsl-region-end")
@@ -130,9 +129,7 @@
|| name.equals("xsl-footnote-separator"));
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public boolean generatesReferenceAreas() {
return true;
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionAfter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionAfter.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionAfter.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionAfter.java Mon Apr 14 06:05:52 2008
@@ -34,15 +34,15 @@
public class RegionAfter extends RegionBA {
/**
+ * Creates a new region-after element.
+ * @param parent the parent node
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
public RegionAfter(FONode parent) {
super(parent);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public Rectangle getViewportRectangle (FODimension reldims, SimplePageMaster spm) {
/* Special rules apply to resolving extent as values are resolved relative
* to the page size and reference orientation.
@@ -82,9 +82,7 @@
return vpRect;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected String getDefaultRegionName() {
return "xsl-region-after";
}
@@ -94,9 +92,7 @@
return "region-after";
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public int getNameId() {
return FO_REGION_AFTER;
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionBA.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionBA.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionBA.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionBA.java Mon Apr 14 06:05:52 2008
@@ -36,15 +36,15 @@
// End of property values
/**
+ * Creates a new region (before or after).
+ * @param parent the parent node
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
protected RegionBA(FONode parent) {
super(parent);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {
super.bind(pList);
precedence = pList.get(PR_PRECEDENCE).getEnum();
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionBefore.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionBefore.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionBefore.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionBefore.java Mon Apr 14 06:05:52 2008
@@ -32,23 +32,22 @@
* The fo:region-before element.
*/
public class RegionBefore extends RegionBA {
+
/**
+ * Creates a new region-before element.
+ * @param parent the parent element
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
public RegionBefore(FONode parent) {
super(parent);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected String getDefaultRegionName() {
return "xsl-region-before";
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public Rectangle getViewportRectangle (FODimension reldims, SimplePageMaster spm) {
/* Special rules apply to resolving extent as values are resolved relative
* to the page size and reference orientation.
@@ -91,9 +90,7 @@
return "region-before";
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public int getNameId() {
return FO_REGION_BEFORE;
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionBody.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionBody.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionBody.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionBody.java Mon Apr 14 06:05:52 2008
@@ -43,29 +43,29 @@
// End of property values
/**
+ * Creates a new region-body element.
+ * @param parent the parent node
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
public RegionBody(FONode parent) {
super(parent);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {
super.bind(pList);
commonMarginBlock = pList.getMarginBlockProps();
columnCount = pList.get(PR_COLUMN_COUNT).getNumeric();
columnGap = pList.get(PR_COLUMN_GAP).getLength();
- if ((getColumnCount() > 1) && (getOverflow() == EN_SCROLL)) {
+ if ((getColumnCount() != 1) && (getOverflow() == EN_SCROLL)) {
/* This is an error (See XSL Rec, fo:region-body description).
* The Rec allows for acting as if "1" is chosen in
* these cases, but we will need to be able to change Numeric
* values in order to do this.
*/
- attributeError("If overflow property is set to \"scroll\","
- + " a column-count other than \"1\" may not be specified.");
+ getFOValidationEventProducer().columnCountErrorOnRegionBodyOverflowScroll(this,
+ getName(), getLocator());
}
}
@@ -93,9 +93,7 @@
return columnGap.getValue();
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public Rectangle getViewportRectangle (FODimension reldims, SimplePageMaster spm) {
/* Special rules apply to resolving margins in the page context.
* Contrary to normal margins in this case top and bottom margin
@@ -143,9 +141,7 @@
reldims.bpd - before - after);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected String getDefaultRegionName() {
return "xsl-region-body";
}
@@ -155,9 +151,7 @@
return "region-body";
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public int getNameId() {
return FO_REGION_BODY;
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionEnd.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionEnd.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionEnd.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionEnd.java Mon Apr 14 06:05:52 2008
@@ -22,26 +22,26 @@
// Java
import java.awt.Rectangle;
-// FOP
-import org.apache.fop.fo.FONode;
import org.apache.fop.datatypes.FODimension;
import org.apache.fop.datatypes.LengthBase;
import org.apache.fop.datatypes.SimplePercentBaseContext;
+import org.apache.fop.fo.FONode;
/**
* The fo:region-end element.
*/
public class RegionEnd extends RegionSE {
+
/**
+ * Creates a new region-end element.
+ * @param parent the parent node
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
public RegionEnd(FONode parent) {
super(parent);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public Rectangle getViewportRectangle (FODimension reldims, SimplePageMaster spm) {
/* Special rules apply to resolving extent as values are resolved relative
* to the page size and reference orientation.
@@ -80,9 +80,7 @@
return vpRect;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected String getDefaultRegionName() {
return "xsl-region-end";
}
@@ -92,9 +90,7 @@
return "region-end";
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public int getNameId() {
return FO_REGION_END;
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionSE.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionSE.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionSE.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionSE.java Mon Apr 14 06:05:52 2008
@@ -35,15 +35,15 @@
// End of property values
/**
+ * Creates a new region (start or end).
+ * @param parent the parent node
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
protected RegionSE(FONode parent) {
super(parent);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {
super.bind(pList);
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionStart.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionStart.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionStart.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RegionStart.java Mon Apr 14 06:05:52 2008
@@ -32,16 +32,17 @@
* The fo:region-start element.
*/
public class RegionStart extends RegionSE {
+
/**
+ * Creates a new region-start element.
+ * @param parent the parent node
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
public RegionStart(FONode parent) {
super(parent);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public Rectangle getViewportRectangle (FODimension reldims, SimplePageMaster spm) {
/* Special rules apply to resolving extent as values are resolved relative
* to the page size and reference orientation.
@@ -77,9 +78,7 @@
return vpRect;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected String getDefaultRegionName() {
return "xsl-region-start";
}
@@ -89,9 +88,7 @@
return "region-start";
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public int getNameId() {
return FO_REGION_START;
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java Mon Apr 14 06:05:52 2008
@@ -52,38 +52,29 @@
private boolean hasPagePositionOnly = false;
/**
+ * Creates a new repeatable-page-master-alternatives element.
+ * @param parent the parent node
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
public RepeatablePageMasterAlternatives(FONode parent) {
super(parent);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {
maximumRepeats = pList.get(PR_MAXIMUM_REPEATS);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void startOfNode() throws FOPException {
conditionalPageMasterRefs = new java.util.ArrayList();
- if (parent.getName().equals("fo:page-sequence-master")) {
- PageSequenceMaster pageSequenceMaster = (PageSequenceMaster)parent;
- pageSequenceMaster.addSubsequenceSpecifier(this);
- } else {
- throw new ValidationException("fo:repeatable-page-master-alternatives "
- + "must be child of fo:page-sequence-master, not "
- + parent.getName(), locator);
- }
+ assert parent.getName().equals("fo:page-sequence-master"); //Validation by the parent
+ PageSequenceMaster pageSequenceMaster = (PageSequenceMaster)parent;
+ pageSequenceMaster.addSubsequenceSpecifier(this);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void endOfNode() throws FOPException {
if (firstChild == null) {
missingChildElementError("(conditional-page-master-reference+)");
@@ -95,10 +86,11 @@
XSL/FOP: (conditional-page-master-reference+)
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
- throws ValidationException {
- if (!(FO_URI.equals(nsURI)
- && localName.equals("conditional-page-master-reference"))) {
- invalidChildError(loc, nsURI, localName);
+ throws ValidationException {
+ if (FO_URI.equals(nsURI)) {
+ if (!localName.equals("conditional-page-master-reference")) {
+ invalidChildError(loc, nsURI, localName);
+ }
}
}
@@ -117,11 +109,7 @@
}
}
- /**
- * Get the next matching page master from the conditional
- * page master references.
- * @see org.apache.fop.fo.pagination.SubSequenceSpecifier
- */
+ /** {@inheritDoc} */
public String getNextPageMasterName(boolean isOddPage,
boolean isFirstPage,
boolean isLastPage,
@@ -183,12 +171,11 @@
}
/** {@inheritDoc} */
- /** @see org.apache.fop.fo.pagination.SubSequenceSpecifier#hasPagePositionOnly() */
public boolean hasPagePositionOnly() {
return this.hasPagePositionOnly;
}
- /** @see org.apache.fop.fo.FONode#getLocalName() */
+ /** {@inheritDoc} */
public String getLocalName() {
return "repeatable-page-master-alternatives";
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java Mon Apr 14 06:05:52 2008
@@ -47,15 +47,15 @@
private int numberConsumed = 0;
/**
+ * Creates a new repeatable-page-master-reference element.
+ * @param parent the parent node
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
public RepeatablePageMasterReference(FONode parent) {
super(parent);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {
masterReference = pList.get(PR_MASTER_REFERENCE).getString();
maximumRepeats = pList.get(PR_MAXIMUM_REPEATS);
@@ -65,9 +65,7 @@
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void startOfNode() throws FOPException {
PageSequenceMaster pageSequenceMaster = (PageSequenceMaster) parent;
@@ -83,13 +81,13 @@
* XSL Content Model: empty
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
- throws ValidationException {
- invalidChildError(loc, nsURI, localName);
+ throws ValidationException {
+ if (FO_URI.equals(nsURI)) {
+ invalidChildError(loc, nsURI, localName);
+ }
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public String getNextPageMasterName(boolean isOddPage,
boolean isFirstPage,
boolean isLastPage,
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/Root.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/Root.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/Root.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/Root.java Mon Apr 14 06:05:52 2008
@@ -25,7 +25,6 @@
import org.xml.sax.Locator;
import org.apache.fop.apps.FOPException;
-import org.apache.fop.fo.ElementMapping;
import org.apache.fop.fo.FOEventHandler;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
@@ -62,7 +61,9 @@
*/
private FOEventHandler foEventHandler = null;
- /**
+ /**
+ * Creates a new root element.
+ * @param parent the parent node (must be null)
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
public Root(FONode parent) {
@@ -137,13 +138,6 @@
}
- /** @inheritDoc */
- protected void validateChildNode(Locator loc, FONode child) throws ValidationException {
- if (child instanceof AbstractPageSequence) {
- pageSequenceFound = true;
- }
- }
-
/**
* Sets the FOEventHandler object that this Root is attached to
* @param foEventHandler the FOEventHandler object
@@ -291,9 +285,7 @@
return bookmarkTree;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public Root getRoot() {
return this;
}
@@ -303,9 +295,7 @@
return "root";
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public int getNameId() {
return FO_ROOT;
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/SideRegion.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/SideRegion.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/SideRegion.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/SideRegion.java Mon Apr 14 06:05:52 2008
@@ -31,7 +31,11 @@
private Length extent;
- /** @see org.apache.fop.fo.FONode#FONode(FONode) */
+ /**
+ * Creates a new side region.
+ * @param parent the parent node
+ * @see org.apache.fop.fo.FONode#FONode(FONode)
+ */
protected SideRegion(FONode parent) {
super(parent);
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java?rev=647787&r1=647786&r2=647787&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java Mon Apr 14 06:05:52 2008
@@ -63,15 +63,15 @@
private boolean hasRegionEnd = false;
/**
+ * Creates a new simple-page-master element.
+ * @param parent the parent node
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
public SimplePageMaster(FONode parent) {
super(parent);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {
commonMarginBlock = pList.getMarginBlockProps();
masterName = pList.get(PR_MASTER_NAME).getString();
@@ -85,9 +85,7 @@
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void startOfNode() throws FOPException {
LayoutMasterSet layoutMasterSet = (LayoutMasterSet) parent;
@@ -101,9 +99,7 @@
regions = new HashMap(5);
}
- /**
- * Make sure content model satisfied.
- */
+ /** {@inheritDoc} */
protected void endOfNode() throws FOPException {
if (!hasRegionBody) {
missingChildElementError(
@@ -116,72 +112,70 @@
* XSL Content Model: (region-body,region-before?,region-after?,region-start?,region-end?)
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
- throws ValidationException {
- if (FO_URI.equals(nsURI) && localName.equals("region-body")) {
- if (hasRegionBody) {
- tooManyNodesError(loc, "fo:region-body");
- } else {
- hasRegionBody = true;
- }
- } else if (FO_URI.equals(nsURI) && localName.equals("region-before")) {
- if (!hasRegionBody) {
- nodesOutOfOrderError(loc, "fo:region-body", "fo:region-before");
- } else if (hasRegionBefore) {
- tooManyNodesError(loc, "fo:region-before");
- } else if (hasRegionAfter) {
- nodesOutOfOrderError(loc, "fo:region-before", "fo:region-after");
- } else if (hasRegionStart) {
- nodesOutOfOrderError(loc, "fo:region-before", "fo:region-start");
- } else if (hasRegionEnd) {
- nodesOutOfOrderError(loc, "fo:region-before", "fo:region-end");
- } else {
- hasRegionBody = true;
- }
- } else if (FO_URI.equals(nsURI) && localName.equals("region-after")) {
- if (!hasRegionBody) {
- nodesOutOfOrderError(loc, "fo:region-body", "fo:region-after");
- } else if (hasRegionAfter) {
- tooManyNodesError(loc, "fo:region-after");
- } else if (hasRegionStart) {
- nodesOutOfOrderError(loc, "fo:region-after", "fo:region-start");
- } else if (hasRegionEnd) {
- nodesOutOfOrderError(loc, "fo:region-after", "fo:region-end");
- } else {
- hasRegionAfter = true;
- }
- } else if (FO_URI.equals(nsURI) && localName.equals("region-start")) {
- if (!hasRegionBody) {
- nodesOutOfOrderError(loc, "fo:region-body", "fo:region-start");
- } else if (hasRegionStart) {
- tooManyNodesError(loc, "fo:region-start");
- } else if (hasRegionEnd) {
- nodesOutOfOrderError(loc, "fo:region-start", "fo:region-end");
- } else {
- hasRegionStart = true;
- }
- } else if (FO_URI.equals(nsURI) && localName.equals("region-end")) {
- if (!hasRegionBody) {
- nodesOutOfOrderError(loc, "fo:region-body", "fo:region-end");
- } else if (hasRegionEnd) {
- tooManyNodesError(loc, "fo:region-end");
+ throws ValidationException {
+ if (FO_URI.equals(nsURI)) {
+ if (localName.equals("region-body")) {
+ if (hasRegionBody) {
+ tooManyNodesError(loc, "fo:region-body");
+ } else {
+ hasRegionBody = true;
+ }
+ } else if (localName.equals("region-before")) {
+ if (!hasRegionBody) {
+ nodesOutOfOrderError(loc, "fo:region-body", "fo:region-before");
+ } else if (hasRegionBefore) {
+ tooManyNodesError(loc, "fo:region-before");
+ } else if (hasRegionAfter) {
+ nodesOutOfOrderError(loc, "fo:region-before", "fo:region-after");
+ } else if (hasRegionStart) {
+ nodesOutOfOrderError(loc, "fo:region-before", "fo:region-start");
+ } else if (hasRegionEnd) {
+ nodesOutOfOrderError(loc, "fo:region-before", "fo:region-end");
+ } else {
+ hasRegionBody = true;
+ }
+ } else if (localName.equals("region-after")) {
+ if (!hasRegionBody) {
+ nodesOutOfOrderError(loc, "fo:region-body", "fo:region-after");
+ } else if (hasRegionAfter) {
+ tooManyNodesError(loc, "fo:region-after");
+ } else if (hasRegionStart) {
+ nodesOutOfOrderError(loc, "fo:region-after", "fo:region-start");
+ } else if (hasRegionEnd) {
+ nodesOutOfOrderError(loc, "fo:region-after", "fo:region-end");
+ } else {
+ hasRegionAfter = true;
+ }
+ } else if (localName.equals("region-start")) {
+ if (!hasRegionBody) {
+ nodesOutOfOrderError(loc, "fo:region-body", "fo:region-start");
+ } else if (hasRegionStart) {
+ tooManyNodesError(loc, "fo:region-start");
+ } else if (hasRegionEnd) {
+ nodesOutOfOrderError(loc, "fo:region-start", "fo:region-end");
+ } else {
+ hasRegionStart = true;
+ }
+ } else if (localName.equals("region-end")) {
+ if (!hasRegionBody) {
+ nodesOutOfOrderError(loc, "fo:region-body", "fo:region-end");
+ } else if (hasRegionEnd) {
+ tooManyNodesError(loc, "fo:region-end");
+ } else {
+ hasRegionEnd = true;
+ }
} else {
- hasRegionEnd = true;
+ invalidChildError(loc, nsURI, localName);
}
- } else {
- invalidChildError(loc, nsURI, localName);
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public boolean generatesReferenceAreas() {
return true;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void addChildNode(FONode child) throws FOPException {
if (child instanceof Region) {
addRegion((Region)child);
@@ -268,9 +262,7 @@
return "simple-page-master";
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public int getNameId() {
return FO_SIMPLE_PAGE_MASTER;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org