1 51 package org.apache.fop.extensions; 52 53 import org.apache.fop.fo.ElementMapping; 54 import org.apache.fop.fo.TreeBuilder; 55 import org.apache.fop.fo.properties.ExtensionPropertyMapping; 56 57 import java.util.HashMap ; 58 import java.util.Iterator ; 59 60 public class ExtensionElementMapping implements ElementMapping { 61 62 public static final String URI = "http://xml.apache.org/fop/extensions"; 63 64 private static HashMap foObjs = null; 65 66 private static synchronized void setupExt() { 67 if(foObjs == null) { 68 foObjs = new HashMap (); 69 foObjs.put("outline", Outline.maker()); 70 foObjs.put("label", Label.maker()); 71 foObjs.put("continued-label", ContinuedLabel.maker()); 72 foObjs.put("destination", Destination.maker()); 73 } 74 } 75 76 public void addToBuilder(TreeBuilder builder) { 77 setupExt(); 78 builder.addMapping(URI, foObjs); 79 80 81 builder.addPropertyList(ExtensionElementMapping.URI, 82 ExtensionPropertyMapping.getGenericMappings()); 83 84 for (Iterator iter = ExtensionPropertyMapping.getElementMappings().iterator(); 85 iter.hasNext(); ) { 86 String elem = (String )iter.next(); 87 builder.addElementPropertyList(ExtensionElementMapping.URI, elem, 88 ExtensionPropertyMapping.getElementMapping(elem)); 89 } 90 } 91 92 } 93 94 | Popular Tags |