aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2007-11-13 12:35:31 +0000
committerJeremias Maerki <jeremias@apache.org>2007-11-13 12:35:31 +0000
commit11302bbf1166a44478b5ca64793060692ff7dfde (patch)
treeade360e9e81a383534f4bbb4a688a49057d83f3d
parente930caebf9d6879ac7845c03bf688d9568f00549 (diff)
downloadxmlgraphics-fop-11302bbf1166a44478b5ca64793060692ff7dfde.tar.gz
xmlgraphics-fop-11302bbf1166a44478b5ca64793060692ff7dfde.zip
Expose a method so I can easily extract the renderer configuration from outside the rendering domain (for a test tool).
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@594509 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/render/AbstractRendererConfigurator.java26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/java/org/apache/fop/render/AbstractRendererConfigurator.java b/src/java/org/apache/fop/render/AbstractRendererConfigurator.java
index 1e485735b..670881643 100644
--- a/src/java/org/apache/fop/render/AbstractRendererConfigurator.java
+++ b/src/java/org/apache/fop/render/AbstractRendererConfigurator.java
@@ -53,14 +53,6 @@ public abstract class AbstractRendererConfigurator {
* @return the requested configuration subtree, null if there's no configuration
*/
protected Configuration getRendererConfig(Renderer renderer) {
- Configuration cfg = userAgent.getFactory().getUserConfig();
- if (cfg == null) {
- if (log.isDebugEnabled()) {
- log.debug("userconfig is null");
- }
- return null;
- }
-
String mimeType = renderer.getMimeType();
if (mimeType == null) {
if (log.isInfoEnabled()) {
@@ -69,6 +61,24 @@ public abstract class AbstractRendererConfigurator {
return null;
}
+ return getRendererConfig(userAgent, mimeType);
+ }
+
+ /**
+ * Returns the configuration subtree for a specific renderer.
+ * @param userAgent the user agent containing the user configuration
+ * @param mimeType the MIME type of the renderer
+ * @return the requested configuration subtree, null if there's no configuration
+ */
+ public static Configuration getRendererConfig(FOUserAgent userAgent, String mimeType) {
+ Configuration cfg = userAgent.getFactory().getUserConfig();
+ if (cfg == null) {
+ if (log.isDebugEnabled()) {
+ log.debug("userconfig is null");
+ }
+ return null;
+ }
+
Configuration userRendererConfig = null;
Configuration[] cfgs