/** * Creates a new ContentHandler instance that you can send the area tree XML to. The parsed * pages are added to the AreaTreeModel instance you pass in as a parameter. * @param treeModel the AreaTreeModel that the parsed pages are added to * @param userAgent the user agent * @return the ContentHandler instance to receive the SAX stream from the area tree XML */ public ContentHandler getContentHandler(AreaTreeModel treeModel, FOUserAgent userAgent) { ElementMappingRegistry elementMappingRegistry = userAgent.getElementMappingRegistry(); return new Handler(treeModel, userAgent, elementMappingRegistry); }
/** * Creates a new ContentHandler instance that you can send the area tree XML to. The parsed * pages are added to the AreaTreeModel instance you pass in as a parameter. * @param documentHandler the intermediate format document handler used to process the IF events * @param userAgent the user agent * @return the ContentHandler instance to receive the SAX stream from the area tree XML */ public ContentHandler getContentHandler(IFDocumentHandler documentHandler, FOUserAgent userAgent) { ElementMappingRegistry elementMappingRegistry = userAgent.getElementMappingRegistry(); return new Handler(documentHandler, userAgent, elementMappingRegistry); }
convertAttributeToProperty(attributes, attributeName, attributeValue); } else if (!userAgent.isNamespaceIgnored(attributeNS)) { ElementMapping mapping = userAgent.getElementMappingRegistry().getElementMapping( attributeNS); QName attr = new QName(attributeNS, attributeName);
/** * <code>FOTreeBuilder</code> constructor * * @param outputFormat the MIME type of the output format to use (ex. "application/pdf"). * @param foUserAgent the {@link FOUserAgent} in effect for this process * @param stream the <code>OutputStream</code> to direct the results to * @throws FOPException if the <code>FOTreeBuilder</code> cannot be properly created */ public FOTreeBuilder( String outputFormat, FOUserAgent foUserAgent, OutputStream stream) throws FOPException { this.userAgent = foUserAgent; this.elementMappingRegistry = userAgent.getElementMappingRegistry(); //This creates either an AreaTreeHandler and ultimately a Renderer, or //one of the RTF-, MIF- etc. Handlers. foEventHandler = foUserAgent.getRendererFactory().createFOEventHandler( foUserAgent, outputFormat, stream); if (userAgent.isAccessibilityEnabled()) { foEventHandler = new FO2StructureTreeConverter( foUserAgent.getStructureTreeEventHandler(), foEventHandler); } builderContext = new FOTreeBuilderContext(); builderContext.setPropertyListMaker(new PropertyListMaker() { public PropertyList make(FObj fobj, PropertyList parentPropertyList) { return new StaticPropertyList(fobj, parentPropertyList); } }); }