1 51 package org.apache.fop.fo; 52 53 import java.util.HashMap ; 54 import java.util.Iterator ; 55 56 import org.apache.fop.fo.properties.FOPropertyMapping; 57 import org.apache.fop.fo.flow.*; 58 import org.apache.fop.fo.pagination.*; 59 60 public class StandardElementMapping implements ElementMapping { 61 private static HashMap foObjs = null; 62 63 private static synchronized void setupFO() { 64 65 if(foObjs == null) { 66 foObjs = new HashMap (); 67 68 foObjs.put("root", Root.maker()); 70 foObjs.put("declarations", Declarations.maker()); 71 foObjs.put("color-profile", ColorProfile.maker()); 72 foObjs.put("page-sequence", PageSequence.maker()); 73 foObjs.put("layout-master-set", LayoutMasterSet.maker()); 74 foObjs.put("page-sequence-master", 75 PageSequenceMaster.maker()); 76 foObjs.put("single-page-master-reference", 77 SinglePageMasterReference.maker()); 78 foObjs.put("repeatable-page-master-reference", 79 RepeatablePageMasterReference.maker()); 80 foObjs.put("repeatable-page-master-alternatives", 81 RepeatablePageMasterAlternatives.maker()); 82 foObjs.put("conditional-page-master-reference", 83 ConditionalPageMasterReference.maker()); 84 foObjs.put("simple-page-master", 85 SimplePageMaster.maker()); 86 foObjs.put("region-body", RegionBody.maker()); 87 foObjs.put("region-before", RegionBefore.maker()); 88 foObjs.put("region-after", RegionAfter.maker()); 89 foObjs.put("region-start", RegionStart.maker()); 90 foObjs.put("region-end", RegionEnd.maker()); 91 foObjs.put("flow", Flow.maker()); 92 foObjs.put("static-content", StaticContent.maker()); 93 foObjs.put("title", Title.maker()); 94 95 foObjs.put("block", Block.maker()); 97 foObjs.put("block-container", BlockContainer.maker()); 98 99 foObjs.put("bidi-override", BidiOverride.maker()); 101 foObjs.put("character", 102 org.apache.fop.fo.flow.Character.maker()); 103 foObjs.put("initial-property-set", 104 InitialPropertySet.maker()); 105 foObjs.put("external-graphic", ExternalGraphic.maker()); 106 foObjs.put("instream-foreign-object", 107 InstreamForeignObject.maker()); 108 foObjs.put("inline", Inline.maker()); 109 foObjs.put("inline-container", InlineContainer.maker()); 110 foObjs.put("leader", Leader.maker()); 111 foObjs.put("page-number", PageNumber.maker()); 112 foObjs.put("page-number-citation", 113 PageNumberCitation.maker()); 114 115 foObjs.put("table-and-caption", TableAndCaption.maker()); 117 foObjs.put("table", Table.maker()); 118 foObjs.put("table-column", TableColumn.maker()); 119 foObjs.put("table-caption", TableCaption.maker()); 120 foObjs.put("table-header", TableHeader.maker()); 121 foObjs.put("table-footer", TableFooter.maker()); 122 foObjs.put("table-body", TableBody.maker()); 123 foObjs.put("table-row", TableRow.maker()); 124 foObjs.put("table-cell", TableCell.maker()); 125 126 foObjs.put("list-block", ListBlock.maker()); 128 foObjs.put("list-item", ListItem.maker()); 129 foObjs.put("list-item-body", ListItemBody.maker()); 130 foObjs.put("list-item-label", ListItemLabel.maker()); 131 132 foObjs.put("basic-link", BasicLink.maker()); 134 foObjs.put("multi-switch", MultiSwitch.maker()); 135 foObjs.put("multi-case", MultiCase.maker()); 136 foObjs.put("multi-toggle", MultiToggle.maker()); 137 foObjs.put("multi-properties", MultiProperties.maker()); 138 foObjs.put("multi-property-set", 139 MultiPropertySet.maker()); 140 141 foObjs.put("float", 143 org.apache.fop.fo.flow.Float.maker()); 144 foObjs.put("footnote", Footnote.maker()); 145 foObjs.put("footnote-body", FootnoteBody.maker()); 146 147 foObjs.put("wrapper", Wrapper.maker()); 149 foObjs.put("marker", Marker.maker()); 150 foObjs.put("retrieve-marker", RetrieveMarker.maker()); 151 } 152 } 153 154 public void addToBuilder(TreeBuilder builder) { 155 setupFO(); 156 String uri = "http://www.w3.org/1999/XSL/Format"; 157 builder.addMapping(uri, foObjs); 158 159 builder.addPropertyList(uri, FOPropertyMapping.getGenericMappings()); 160 161 for (Iterator iter = FOPropertyMapping.getElementMappings().iterator(); 162 iter.hasNext(); ) { 163 String elem = (String )iter.next(); 164 builder.addElementPropertyList(uri, elem, 165 FOPropertyMapping.getElementMapping(elem)); 166 } 167 } 168 } 169 170 | Popular Tags |