Package org.apache.fop.render.svg
Class AbstractSVGDocumentHandler
- java.lang.Object
-
- org.apache.fop.render.intermediate.AbstractIFDocumentHandler
-
- org.apache.fop.render.intermediate.AbstractXMLWritingIFDocumentHandler
-
- org.apache.fop.render.svg.AbstractSVGDocumentHandler
-
- All Implemented Interfaces:
IFDocumentHandler
,SVGConstants
,XMLConstants
- Direct Known Subclasses:
SVGDocumentHandler
,SVGPrintDocumentHandler
public abstract class AbstractSVGDocumentHandler extends AbstractXMLWritingIFDocumentHandler implements SVGConstants
Abstract base class for SVG Painter implementations.
-
-
Field Summary
Fields Modifier and Type Field Description protected FontInfo
fontInfo
Font configurationprivate static org.apache.commons.logging.Log
log
logging instanceprivate int
mode
private static int
MODE_NORMAL
private static int
MODE_TEXT
protected IFState
state
Holds the intermediate format state-
Fields inherited from class org.apache.fop.render.intermediate.AbstractXMLWritingIFDocumentHandler
handler, tFactory
-
Fields inherited from interface org.apache.fop.render.svg.SVGConstants
FILE_EXTENSION_SVG, MIME_SVG_PRINT, MIME_TYPE, NAMESPACE, SVG_ELEMENT
-
Fields inherited from interface org.apache.fop.util.XMLConstants
CDATA, XLINK_HREF, XLINK_NAMESPACE, XLINK_PREFIX, XML_NAMESPACE, XML_PREFIX, XML_SPACE, XMLNS_NAMESPACE_URI, XMLNS_PREFIX
-
-
Constructor Summary
Constructors Constructor Description AbstractSVGDocumentHandler(IFContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endDocumentHeader()
Indicates the end of the document header.IFDocumentHandlerConfigurator
getConfigurator()
Returns the configurator for this document handler, if any.FontInfo
getFontInfo()
Returns the font set to work with.protected java.lang.String
getMainNamespace()
Returns the main namespace used for generated XML content.void
handleExtensionObject(java.lang.Object extension)
Handles an extension object.void
setDefaultFontInfo(FontInfo fontInfo)
Sets the default font set (with no custom configuration).void
setFontInfo(FontInfo fontInfo)
Sets the font set to work with.void
startDocumentHeader()
Indicates the start of the document header.-
Methods inherited from class org.apache.fop.render.intermediate.AbstractXMLWritingIFDocumentHandler
createContentHandler, setResult
-
Methods inherited from class org.apache.fop.render.intermediate.AbstractIFDocumentHandler
endDocumentTrailer, endPageHeader, endPageTrailer, getContext, getDocumentNavigationHandler, getStructureTreeEventHandler, getUserAgent, setDocumentLocale, startDocument, startDocumentTrailer, startPageHeader, startPageTrailer
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.fop.render.intermediate.IFDocumentHandler
endDocument, endPage, endPageContent, endPageSequence, getMimeType, startPage, startPageContent, startPageSequence, supportsPagesOutOfOrder
-
-
-
-
Field Detail
-
log
private static org.apache.commons.logging.Log log
logging instance
-
fontInfo
protected FontInfo fontInfo
Font configuration
-
state
protected IFState state
Holds the intermediate format state
-
MODE_NORMAL
private static final int MODE_NORMAL
- See Also:
- Constant Field Values
-
MODE_TEXT
private static final int MODE_TEXT
- See Also:
- Constant Field Values
-
mode
private int mode
-
-
Constructor Detail
-
AbstractSVGDocumentHandler
public AbstractSVGDocumentHandler(IFContext context)
-
-
Method Detail
-
getMainNamespace
protected java.lang.String getMainNamespace()
Returns the main namespace used for generated XML content.- Specified by:
getMainNamespace
in classAbstractXMLWritingIFDocumentHandler
- Returns:
- the main namespace
-
getFontInfo
public FontInfo getFontInfo()
Returns the font set to work with.- Specified by:
getFontInfo
in interfaceIFDocumentHandler
- Returns:
- the font info object
-
setFontInfo
public void setFontInfo(FontInfo fontInfo)
Sets the font set to work with.- Specified by:
setFontInfo
in interfaceIFDocumentHandler
- Parameters:
fontInfo
- the font info object
-
setDefaultFontInfo
public void setDefaultFontInfo(FontInfo fontInfo)
Sets the default font set (with no custom configuration).- Specified by:
setDefaultFontInfo
in interfaceIFDocumentHandler
- Parameters:
fontInfo
- the font info object to populate
-
getConfigurator
public IFDocumentHandlerConfigurator getConfigurator()
Returns the configurator for this document handler, if any.- Specified by:
getConfigurator
in interfaceIFDocumentHandler
- Returns:
- the configurator or null if there's no configurator
-
startDocumentHeader
public void startDocumentHeader() throws IFException
Indicates the start of the document header. This method is called right after theIFDocumentHandler.startDocument()
method. Extensions sent to this painter betweenIFDocumentHandler.startDocumentHeader()
andIFDocumentHandler.endDocumentHeader()
apply to the document as a whole (like document metadata).- Specified by:
startDocumentHeader
in interfaceIFDocumentHandler
- Overrides:
startDocumentHeader
in classAbstractIFDocumentHandler
- Throws:
IFException
- if an error occurs while handling this event
-
endDocumentHeader
public void endDocumentHeader() throws IFException
Indicates the end of the document header. This method is called before the first page sequence.- Specified by:
endDocumentHeader
in interfaceIFDocumentHandler
- Overrides:
endDocumentHeader
in classAbstractIFDocumentHandler
- Throws:
IFException
- if an error occurs while handling this event
-
handleExtensionObject
public void handleExtensionObject(java.lang.Object extension) throws IFException
Handles an extension object. This can be a DOM document or any arbitrary object. If an implementation doesn't know how to handle a particular extension it is simply ignored.- Specified by:
handleExtensionObject
in interfaceIFDocumentHandler
- Parameters:
extension
- the extension object- Throws:
IFException
- if an error occurs while handling this event
-
-