diff options
Diffstat (limited to 'src/java/org/apache/fop/fo/pagination/Root.java')
-rw-r--r-- | src/java/org/apache/fop/fo/pagination/Root.java | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/java/org/apache/fop/fo/pagination/Root.java b/src/java/org/apache/fop/fo/pagination/Root.java index fcbb54abd..fb69dc2f1 100644 --- a/src/java/org/apache/fop/fo/pagination/Root.java +++ b/src/java/org/apache/fop/fo/pagination/Root.java @@ -47,8 +47,8 @@ public class Root extends FObj { private LayoutMasterSet layoutMasterSet; private Declarations declarations; private BookmarkTree bookmarkTree = null; - private List destinationList; - private List pageSequences; + private List<Destination> destinationList; + private List<PageSequence> pageSequences; // temporary until above list populated private boolean pageSequenceFound = false; @@ -77,11 +77,12 @@ public class Root extends FObj { */ public Root(FONode parent) { super(parent); - pageSequences = new java.util.ArrayList(); + pageSequences = new java.util.ArrayList<PageSequence>(); } /** {@inheritDoc} */ public void bind(PropertyList pList) throws FOPException { + super.bind(pList); mediaUsage = pList.get(PR_MEDIA_USAGE).getEnum(); } @@ -144,7 +145,11 @@ public class Root extends FObj { } - /** @inheritDoc */ + /** + * @param loc location in the source file + * @param child the {@link FONode} to validate against + * @throws ValidationException if the incoming node is not a valid child for the given FO + */ protected void validateChildNode(Locator loc, FONode child) throws ValidationException { if (child instanceof AbstractPageSequence) { pageSequenceFound = true; @@ -207,7 +212,8 @@ public class Root extends FObj { * @param additionalPages the total pages generated by the sequence (for statistics) * @throws IllegalArgumentException for negative additional page counts */ - public void notifyPageSequenceFinished(int lastPageNumber, int additionalPages) { + public void notifyPageSequenceFinished(int lastPageNumber, int additionalPages) + throws IllegalArgumentException { if (additionalPages >= 0) { totalPagesGenerated += additionalPages; @@ -238,7 +244,7 @@ public class Root extends FObj { return null; } if (currentIndex < (pageSequences.size() - 1)) { - return (PageSequence)pageSequences.get(currentIndex + 1); + return pageSequences.get(currentIndex + 1); } else { return null; } @@ -290,7 +296,7 @@ public class Root extends FObj { */ public void addDestination(Destination destination) { if (destinationList == null) { - destinationList = new java.util.ArrayList(); + destinationList = new java.util.ArrayList<Destination>(); } destinationList.add(destination); } |