1 17 18 19 20 package org.apache.fop.fo.extensions; 21 22 import org.apache.fop.fo.ElementMapping; 23 import org.apache.fop.fo.UnknownXMLObj; 24 import org.apache.fop.util.QName; 25 26 import java.util.HashMap ; 27 import java.util.Set ; 28 29 32 public class ExtensionElementMapping extends ElementMapping { 33 34 35 public static final String URI = "http://xmlgraphics.apache.org/fop/extensions"; 36 37 private static final Set propertyAttributes = new java.util.HashSet (); 38 39 static { 40 propertyAttributes.add("block-progression-unit"); 42 propertyAttributes.add("widow-content-limit"); 43 propertyAttributes.add("orphan-content-limit"); 44 } 45 46 49 public ExtensionElementMapping() { 50 namespaceURI = URI; 51 } 52 53 56 protected void initialize() { 57 if (foObjs == null) { 58 foObjs = new HashMap (); 59 foObjs.put("outline", new UnknownXMLObj.Maker(URI)); 60 foObjs.put("label", new UnknownXMLObj.Maker(URI)); 61 } 62 } 63 64 65 public String getStandardPrefix() { 66 return "fox"; 67 } 68 69 70 public boolean isAttributeProperty(QName attributeName) { 71 if (!URI.equals(attributeName.getNamespaceURI())) { 72 throw new IllegalArgumentException ("The namespace URIs don't match"); 73 } 74 return propertyAttributes.contains(attributeName.getLocalName()); 75 } 76 77 } 78 | Popular Tags |