1 17 18 19 20 package org.apache.fop.render.afp.extensions; 21 22 import java.util.HashMap ; 23 24 import org.apache.fop.fo.ElementMapping; 25 import org.apache.fop.fo.FONode; 26 27 28 36 public class AFPElementMapping extends ElementMapping { 37 38 public static final String PAGE = "page"; 39 40 public static final String PAGE_GROUP = "page-group"; 41 42 public static final String TAG_LOGICAL_ELEMENT = "tag-logical-element"; 43 44 public static final String INCLUDE_PAGE_OVERLAY = "include-page-overlay"; 45 46 public static final String INCLUDE_PAGE_SEGMENT = "include-page-segment"; 47 48 51 public static final String NAMESPACE = "http://xmlgraphics.apache.org/fop/extensions/afp"; 52 53 56 public static final String NAMESPACE_PREFIX = "afp"; 57 58 59 public AFPElementMapping() { 60 this.namespaceURI = NAMESPACE; 61 } 62 63 67 protected void initialize() { 68 69 if (foObjs == null) { 70 foObjs = new HashMap (); 71 foObjs.put(PAGE, new AFPPageSetupMaker()); 72 foObjs.put( 74 TAG_LOGICAL_ELEMENT, 75 new AFPTagLogicalElementMaker()); 76 foObjs.put( 77 INCLUDE_PAGE_SEGMENT, 78 new AFPIncludePageSegmentMaker()); 79 foObjs.put( 80 INCLUDE_PAGE_OVERLAY, 81 new AFPIncludePageOverlayMaker()); 82 } 83 84 } 85 86 static class AFPPageSetupMaker extends ElementMapping.Maker { 87 public FONode make(FONode parent) { 88 return new AFPPageSetupElement(parent); 89 } 90 } 91 92 static class AFPIncludePageOverlayMaker extends ElementMapping.Maker { 93 public FONode make(FONode parent) { 94 return new AFPElement(parent, INCLUDE_PAGE_OVERLAY); 95 } 96 } 97 98 static class AFPIncludePageSegmentMaker extends ElementMapping.Maker { 99 public FONode make(FONode parent) { 100 return new AFPElement(parent, INCLUDE_PAGE_SEGMENT); 101 } 102 } 103 104 static class AFPTagLogicalElementMaker extends ElementMapping.Maker { 105 public FONode make(FONode parent) { 106 return new AFPElement(parent, TAG_LOGICAL_ELEMENT); 107 } 108 } 109 110 } 111 | Popular Tags |