1 17 18 19 20 package org.apache.fop.fo.pagination; 21 22 import org.xml.sax.Locator ; 24 25 import org.apache.fop.apps.FOPException; 26 import org.apache.fop.fo.FONode; 27 import org.apache.fop.fo.ValidationException; 28 29 32 public class StaticContent extends Flow { 33 34 37 public StaticContent(FONode parent) { 38 super(parent); 39 } 40 41 44 protected void startOfNode() throws FOPException { 45 if (getFlowName() == null || getFlowName().equals("")) { 46 throw new ValidationException("A 'flow-name' is required for " 47 + getName() + ".", locator); 48 } 49 getFOEventHandler().startFlow(this); 50 } 51 52 57 protected void endOfNode() throws FOPException { 58 if (childNodes == null && getUserAgent().validateStrictly()) { 59 missingChildElementError("(%block;)+"); 60 } 61 getFOEventHandler().endFlow(this); 62 } 63 64 68 protected void validateChildNode(Locator loc, String nsURI, String localName) 69 throws ValidationException { 70 if (!isBlockItem(nsURI, localName)) { 71 invalidChildError(loc, nsURI, localName); 72 } 73 } 74 75 76 public String getLocalName() { 77 return "static-content"; 78 } 79 80 81 public int getNameId() { 82 return FO_STATIC_CONTENT; 83 } 84 } 85 | Popular Tags |