1 17 18 19 20 package org.apache.fop.fo.pagination.bookmarks; 21 22 import java.util.ArrayList ; 24 25 import org.xml.sax.Locator ; 26 27 import org.apache.fop.apps.FOPException; 28 import org.apache.fop.fo.FONode; 29 import org.apache.fop.fo.FObj; 30 import org.apache.fop.fo.ValidationException; 31 import org.apache.fop.fo.pagination.Root; 32 33 38 public class BookmarkTree extends FObj { 39 private ArrayList bookmarks = new ArrayList (); 40 41 44 public BookmarkTree(FONode parent) { 45 super(parent); 46 } 47 48 51 protected void addChildNode(FONode obj) { 52 if (obj instanceof Bookmark) { 53 bookmarks.add(obj); 54 } 55 } 56 57 60 protected void endOfNode() throws FOPException { 61 if (bookmarks == null) { 62 missingChildElementError("(fo:bookmark+)"); 63 } 64 ((Root) parent).setBookmarkTree(this); 65 } 66 67 71 protected void validateChildNode(Locator loc, String nsURI, String localName) 72 throws ValidationException { 73 if (!(FO_URI.equals(nsURI) && 74 localName.equals("bookmark"))) { 75 invalidChildError(loc, nsURI, localName); 76 } 77 } 78 79 public ArrayList getBookmarks() { 80 return bookmarks; 81 } 82 83 84 public String getLocalName() { 85 return "bookmark-tree"; 86 } 87 88 91 public int getNameId() { 92 return FO_BOOKMARK_TREE; 93 } 94 } 95 | Popular Tags |