org.apache.fop.render
Class AbstractGenericSVGHandler
java.lang.Object
org.apache.fop.render.AbstractGenericSVGHandler
- All Implemented Interfaces:
- RendererContextConstants, XMLHandler
- Direct Known Subclasses:
- AFPSVGHandler, PCLSVGHandler, PDFSVGHandler
- public abstract class AbstractGenericSVGHandler
- extends java.lang.Object
- implements XMLHandler, RendererContextConstants
Generic XML handler for SVG. Uses Apache Batik for SVG processing and simply paints to
a Graphics2DAdapter and thus ultimatively to Graphics2D interface that is presented.
To use this class, subclass it and implement the missing methods (supportsRenderer, for example).
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractGenericSVGHandler
public AbstractGenericSVGHandler()
handleXML
public void handleXML(RendererContext context,
org.w3c.dom.Document doc,
java.lang.String ns)
throws java.lang.Exception
- Description copied from interface:
XMLHandler
Handle an external xml document inside a Foreign Object Area.
This may throw an exception if for some reason it cannot be handled. The
caller is expected to deal with this exception.
The implementation may convert the XML document internally to another
XML dialect (SVG, for example) and call renderXML() on the AbstractRenderer
again (which can be retrieved through the RendererContext).
- Specified by:
handleXML
in interface XMLHandler
- Parameters:
context
- The RendererContext (contains the user agent)doc
- A DOM containing the foreign object to be
processedns
- The Namespace of the foreign object
- Throws:
java.lang.Exception
- If an error occurs during processing.- See Also:
XMLHandler
renderSVGDocument
protected void renderSVGDocument(RendererContext context,
org.w3c.dom.Document doc)
throws java.io.IOException
- Render the SVG document.
- Parameters:
context
- the renderer contextdoc
- the SVG document
- Throws:
java.io.IOException
- In case of an I/O error while painting the image
getNamespace
public java.lang.String getNamespace()
- Specified by:
getNamespace
in interface XMLHandler
- Returns:
- the XML namespace for the XML dialect this XMLHandler supports,
null if all XML content is handled by this instance.
- See Also:
XMLHandler.getNamespace()
Copyright 1999-2006 The Apache Software Foundation. All Rights Reserved.