diff options
Diffstat (limited to 'src/java/org/apache/fop/render/XMLHandler.java')
-rw-r--r-- | src/java/org/apache/fop/render/XMLHandler.java | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/src/java/org/apache/fop/render/XMLHandler.java b/src/java/org/apache/fop/render/XMLHandler.java index 4942a5ae3..683479e93 100644 --- a/src/java/org/apache/fop/render/XMLHandler.java +++ b/src/java/org/apache/fop/render/XMLHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 1999-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,11 +26,18 @@ import org.w3c.dom.Document; */ public interface XMLHandler { + /** Used to indicate that all MIME types or XML namespaces are handled. */ + String HANDLE_ALL = "*"; + /** - * Handle an external xml document inside a Foreign Object Area. <p> - * - * This may throw an exception if for some reason it cannot be handled. The - * caller is expected to deal with this exception.</p> + * <p>Handle an external xml document inside a Foreign Object Area. + * </p> + * <p>This may throw an exception if for some reason it cannot be handled. The + * caller is expected to deal with this exception. + * </p> + * <p>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).</p> * * @param context The RendererContext (contains the user agent) * @param doc A DOM containing the foreign object to be @@ -38,8 +45,18 @@ public interface XMLHandler { * @param ns The Namespace of the foreign object * @exception Exception If an error occurs during processing. */ - void handleXML(RendererContext context, Document doc, String ns) - throws Exception; + void handleXML(RendererContext context, + Document doc, String ns) throws Exception; + + /** + * @return the MIME type for which this XMLHandler was written + */ + String getMimeType(); + /** + * @return the XML namespace for the XML dialect this XMLHandler supports, + * null if all XML content is handled by this instance. + */ + String getNamespace(); } |