Package org.apache.fop.render
Class XMLHandlerRegistry
java.lang.Object
org.apache.fop.render.XMLHandlerRegistry
This class holds references to various XML handlers used by FOP. It also
supports automatic discovery of additional XML handlers available through
the class path.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addXMLHandler
(String classname) Add an XML handler.private void
addXMLHandler
(String ns, XMLHandler handler) Add an XML handler for the given MIME type and XML namespace.void
addXMLHandler
(XMLHandler handler) Add an XML handler.private void
Discovers XMLHandler implementations through the classpath and dynamically registers them.getXMLHandler
(Renderer renderer, String ns) Returns an XMLHandler which handles an XML dialect of the given namespace and for a specified output format defined by its MIME type.private XMLHandler
getXMLHandler
(Renderer renderer, List<XMLHandler> lst) private void
setDefaultXMLHandler
(XMLHandler handler) Add a default XML handler which is able to handle any namespace.
-
Field Details
-
log
private static org.apache.commons.logging.Log logthe logger -
handlers
Map containing XML handlers for various document types
-
-
Constructor Details
-
XMLHandlerRegistry
public XMLHandlerRegistry()Default constructor.
-
-
Method Details
-
setDefaultXMLHandler
Add a default XML handler which is able to handle any namespace.- Parameters:
handler
- XMLHandler to use
-
addXMLHandler
Add an XML handler. The handler itself is inspected to find out what it supports.- Parameters:
classname
- the fully qualified class name
-
addXMLHandler
Add an XML handler. The handler itself is inspected to find out what it supports.- Parameters:
handler
- the XMLHandler instance
-
addXMLHandler
Add an XML handler for the given MIME type and XML namespace.- Parameters:
ns
- Namespace URIhandler
- XMLHandler to use
-
getXMLHandler
Returns an XMLHandler which handles an XML dialect of the given namespace and for a specified output format defined by its MIME type.- Parameters:
renderer
- the Renderer for which to retrieve a Rendererns
- the XML namespace associated with the XML to be rendered- Returns:
- the XMLHandler responsible for handling the XML or null if none is available
-
getXMLHandler
-
discoverXMLHandlers
private void discoverXMLHandlers()Discovers XMLHandler implementations through the classpath and dynamically registers them.
-