package org.apache.fop.render.pdf.extensions;
import org.apache.fop.fo.ElementMapping;
import org.apache.fop.fo.FONode;
public class PDFElementMapping extends ElementMapping {
public static final String NAMESPACE = "http://xmlgraphics.apache.org/fop/extensions/pdf";
public PDFElementMapping() {
this.namespaceURI = NAMESPACE;
}
protected void initialize() {
if (foObjs == null) {
foObjs = new java.util.HashMap<String, Maker>();
foObjs.put(PDFDictionaryType.Action.elementName(), new PDFActionElementMaker());
foObjs.put(PDFObjectType.Array.elementName(), new PDFArrayElementMaker());
foObjs.put(PDFObjectType.Boolean.elementName(), new PDFCollectionEntryElementMaker(PDFObjectType.Boolean));
foObjs.put(PDFDictionaryType.Catalog.elementName(), new PDFCatalogElementMaker());
foObjs.put(PDFDictionaryType.Dictionary.elementName(), new PDFDictionaryElementMaker());
foObjs.put(PDFEmbeddedFileElement.ELEMENT, new PDFEmbeddedFileElementMaker());
foObjs.put(PDFObjectType.Name.elementName(), new PDFCollectionEntryElementMaker(PDFObjectType.Name));
foObjs.put(PDFObjectType.Number.elementName(), new PDFCollectionEntryElementMaker(PDFObjectType.Number));
foObjs.put(PDFDictionaryType.Navigator.elementName(), new PDFNavigatorElementMaker());
foObjs.put(PDFDictionaryType.Layer.elementName(), new PDFLayerElementMaker());
foObjs.put(PDFDictionaryType.Page.elementName(), new PDFPageElementMaker());
foObjs.put(PDFObjectType.Reference.elementName(), new PDFReferenceElementMaker());
foObjs.put(PDFObjectType.String.elementName(), new PDFCollectionEntryElementMaker(PDFObjectType.String));
foObjs.put(PDFDictionaryType.Info.elementName(), new PDFDocumentInformationElementMaker());
foObjs.put(PDFDictionaryType.VT.elementName(), new PDFVTElementMaker());
foObjs.put(PDFDictionaryType.PagePiece.elementName(), new PDFPagePieceElementMaker());
}
}
static class PDFActionElementMaker extends ElementMapping.Maker {
public FONode make(FONode parent) {
return new PDFActionElement(parent);
}
}
static class PDFArrayElementMaker extends ElementMapping.Maker {
public FONode make(FONode parent) {
return new PDFArrayElement(parent);
}
}
static class PDFCatalogElementMaker extends ElementMapping.Maker {
public FONode make(FONode parent) {
return new PDFCatalogElement(parent);
}
}
static class PDFDocumentInformationElementMaker extends ElementMapping.Maker {
public FONode make(FONode parent) {
return new PDFDocumentInformationElement(parent);
}
}
static class PDFDictionaryElementMaker extends ElementMapping.Maker {
public FONode make(FONode parent) {
return new PDFDictionaryElement(parent, PDFDictionaryType.Dictionary);
}
}
static class PDFEmbeddedFileElementMaker extends ElementMapping.Maker {
public FONode make(FONode parent) {
return new PDFEmbeddedFileElement(parent);
}
}
static class PDFLayerElementMaker extends ElementMapping.Maker {
public FONode make(FONode parent) {
return new PDFLayerElement(parent);
}
}
static class PDFNavigatorElementMaker extends ElementMapping.Maker {
public FONode make(FONode parent) {
return new PDFNavigatorElement(parent);
}
}
static class PDFPageElementMaker extends ElementMapping.Maker {
public FONode make(FONode parent) {
return new PDFPageElement(parent);
}
}
static class PDFCollectionEntryElementMaker extends ElementMapping.Maker {
private PDFObjectType entryType;
PDFCollectionEntryElementMaker(PDFObjectType entryType) {
this.entryType = entryType;
}
public FONode make(FONode parent) {
return new PDFCollectionEntryElement(parent, entryType);
}
}
static class PDFReferenceElementMaker extends ElementMapping.Maker {
public FONode make(FONode parent) {
return new PDFReferenceElement(parent);
}
}
static class PDFVTElementMaker extends ElementMapping.Maker {
public FONode make(FONode parent) {
return new PDFVTElement(parent);
}
}
static class PDFPagePieceElementMaker extends ElementMapping.Maker {
public FONode make(FONode parent) {
return new PDFPagePieceElement(parent);
}
}
}