Browse Source

FOP-2733: Drop dependency on Avalon-Framework


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1851806 13f79535-47bb-0310-9956-ffa450edef
pull/47/head
ssteiner 5 months ago
parent
commit
bd7d504878
73 changed files with 863 additions and 396 deletions
  1. 0
    10
      fop-core/pom.xml
  2. 48
    0
      fop-core/src/main/java/org/apache/fop/activity/ContainerUtil.java
  3. 24
    0
      fop-core/src/main/java/org/apache/fop/activity/Initializable.java
  4. 2
    2
      fop-core/src/main/java/org/apache/fop/apps/FOUserAgent.java
  5. 3
    3
      fop-core/src/main/java/org/apache/fop/apps/FopConfParser.java
  6. 1
    1
      fop-core/src/main/java/org/apache/fop/apps/FopFactory.java
  7. 1
    2
      fop-core/src/main/java/org/apache/fop/apps/FopFactoryBuilder.java
  8. 1
    2
      fop-core/src/main/java/org/apache/fop/apps/FopFactoryConfig.java
  9. 0
    3
      fop-core/src/main/java/org/apache/fop/cli/Main.java
  10. 24
    0
      fop-core/src/main/java/org/apache/fop/configuration/Configurable.java
  11. 61
    0
      fop-core/src/main/java/org/apache/fop/configuration/Configuration.java
  12. 30
    0
      fop-core/src/main/java/org/apache/fop/configuration/ConfigurationException.java
  13. 293
    0
      fop-core/src/main/java/org/apache/fop/configuration/DefaultConfiguration.java
  14. 76
    0
      fop-core/src/main/java/org/apache/fop/configuration/DefaultConfigurationBuilder.java
  15. 124
    0
      fop-core/src/main/java/org/apache/fop/configuration/NullConfiguration.java
  16. 2
    2
      fop-core/src/main/java/org/apache/fop/fonts/DefaultFontConfig.java
  17. 2
    3
      fop-core/src/main/java/org/apache/fop/fonts/FontConfig.java
  18. 2
    2
      fop-core/src/main/java/org/apache/fop/fonts/FontManagerConfigurator.java
  19. 1
    2
      fop-core/src/main/java/org/apache/fop/fonts/substitute/FontSubstitutionsConfigurator.java
  20. 1
    2
      fop-core/src/main/java/org/apache/fop/render/RendererConfig.java
  21. 2
    0
      fop-core/src/main/java/org/apache/fop/render/RendererConfigOption.java
  22. 2
    2
      fop-core/src/main/java/org/apache/fop/render/XMLHandlerConfigurator.java
  23. 3
    3
      fop-core/src/main/java/org/apache/fop/render/afp/AFPFontConfig.java
  24. 1
    2
      fop-core/src/main/java/org/apache/fop/render/afp/AFPInfo.java
  25. 2
    2
      fop-core/src/main/java/org/apache/fop/render/afp/AFPRendererConfig.java
  26. 2
    3
      fop-core/src/main/java/org/apache/fop/render/afp/AFPRendererContext.java
  27. 5
    0
      fop-core/src/main/java/org/apache/fop/render/afp/AFPRendererOption.java
  28. 1
    1
      fop-core/src/main/java/org/apache/fop/render/afp/AFPShadingMode.java
  29. 13
    3
      fop-core/src/main/java/org/apache/fop/render/bitmap/BitmapRendererConfig.java
  30. 1
    2
      fop-core/src/main/java/org/apache/fop/render/bitmap/PNGRendererConfig.java
  31. 1
    2
      fop-core/src/main/java/org/apache/fop/render/bitmap/TIFFRendererConfig.java
  32. 1
    2
      fop-core/src/main/java/org/apache/fop/render/intermediate/IFRendererConfig.java
  33. 1
    2
      fop-core/src/main/java/org/apache/fop/render/java2d/Java2DRendererConfig.java
  34. 5
    0
      fop-core/src/main/java/org/apache/fop/render/java2d/Java2DRendererOption.java
  35. 17
    6
      fop-core/src/main/java/org/apache/fop/render/pcl/Java2DRendererOption.java
  36. 1
    2
      fop-core/src/main/java/org/apache/fop/render/pcl/PCLRendererConfig.java
  37. 8
    4
      fop-core/src/main/java/org/apache/fop/render/pdf/PDFRendererConfig.java
  38. 1
    1
      fop-core/src/main/java/org/apache/fop/render/pdf/PDFSVGHandler.java
  39. 2
    2
      fop-core/src/main/java/org/apache/fop/render/ps/PSRendererConfig.java
  40. 1
    2
      fop-core/src/main/java/org/apache/fop/render/ps/PSSVGHandler.java
  41. 1
    2
      fop-core/src/main/java/org/apache/fop/render/txt/TxtRendererConfig.java
  42. 4
    4
      fop-core/src/main/java/org/apache/fop/svg/AbstractFOPTranscoder.java
  43. 2
    3
      fop-core/src/main/java/org/apache/fop/svg/PDFDocumentGraphics2DConfigurator.java
  44. 1
    2
      fop-core/src/main/java/org/apache/fop/svg/PDFTranscoder.java
  45. 2
    3
      fop-core/src/test/java/org/apache/fop/apps/AbstractRendererConfigParserTester.java
  46. 1
    2
      fop-core/src/test/java/org/apache/fop/apps/AbstractRendererConfiguratorTest.java
  47. 1
    2
      fop-core/src/test/java/org/apache/fop/apps/MutableConfig.java
  48. 1
    1
      fop-core/src/test/java/org/apache/fop/config/BaseUserConfigTest.java
  49. 4
    4
      fop-core/src/test/java/org/apache/fop/threading/AvalonAdapter.java
  50. 20
    18
      fop-core/src/test/java/org/apache/fop/threading/FOPTestbed.java
  51. 12
    8
      fop-core/src/test/java/org/apache/fop/threading/FOProcessorImpl.java
  52. 13
    8
      fop-core/src/test/java/org/apache/fop/threading/IFProcessorImpl.java
  53. 6
    7
      fop-core/src/test/java/org/apache/fop/threading/Main.java
  54. 4
    1
      fop-core/src/test/java/org/apache/fop/threading/Processor.java
  55. 3
    3
      fop-core/src/test/java/org/apache/fop/visual/AbstractPSPDFBitmapProducer.java
  56. 4
    4
      fop-core/src/test/java/org/apache/fop/visual/BatchDiffer.java
  57. 3
    1
      fop-core/src/test/java/org/apache/fop/visual/BitmapProducer.java
  58. 3
    3
      fop-core/src/test/java/org/apache/fop/visual/BitmapProducerJava2D.java
  59. 3
    4
      fop-core/src/test/java/org/apache/fop/visual/ReferenceBitmapLoader.java
  60. 0
    12
      fop-servlet/pom.xml
  61. 0
    11
      fop-transcoder-allinone/pom.xml
  62. 0
    4
      fop-transcoder-allinone/src/tools/resources/assembly/assembly.xml
  63. 1
    8
      fop/build.xml
  64. 0
    1
      fop/examples/embedding/build.xml
  65. 1
    3
      fop/examples/embedding/java/embedding/ExampleAWTViewer.java
  66. 4
    4
      fop/examples/embedding/java/embedding/ExampleEPS.java
  67. 3
    3
      fop/examples/embedding/java/embedding/ExampleJava2D2PDF.java
  68. 0
    8
      fop/lib/README.txt
  69. BIN
      fop/lib/avalon-framework-api-4.3.1.jar
  70. BIN
      fop/lib/avalon-framework-impl-4.3.1.jar
  71. 0
    175
      fop/lib/avalon-framework.LICENSE.txt
  72. 0
    11
      fop/lib/avalon-framework.NOTICE.TXT
  73. 0
    1
      pom.xml

+ 0
- 10
fop-core/pom.xml View File

@@ -88,16 +88,6 @@
88 88
       <version>1.8.2</version>
89 89
     </dependency>
90 90
     <dependency>
91
-      <groupId>org.apache.avalon.framework</groupId>
92
-      <artifactId>avalon-framework-api</artifactId>
93
-      <version>${avalon.version}</version>
94
-    </dependency>
95
-    <dependency>
96
-      <groupId>org.apache.avalon.framework</groupId>
97
-      <artifactId>avalon-framework-impl</artifactId>
98
-      <version>${avalon.version}</version>
99
-    </dependency>
100
-    <dependency>
101 91
       <groupId>org.apache.pdfbox</groupId>
102 92
       <artifactId>fontbox</artifactId>
103 93
       <version>2.0.13</version>

+ 48
- 0
fop-core/src/main/java/org/apache/fop/activity/ContainerUtil.java View File

@@ -0,0 +1,48 @@
1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *      http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+/* $Id: Accessibility.java 1343632 2012-05-29 09:48:03Z vhennebert $ */
19
+package org.apache.fop.activity;
20
+
21
+import org.apache.fop.configuration.Configurable;
22
+import org.apache.fop.configuration.Configuration;
23
+import org.apache.fop.configuration.ConfigurationException;
24
+
25
+public final class ContainerUtil {
26
+
27
+    private ContainerUtil() {
28
+        // Never invoked.
29
+    }
30
+
31
+    public static void configure(Configurable configurable, Configuration configuration) {
32
+        try {
33
+            configurable.configure(configuration);
34
+        } catch (ConfigurationException e) {
35
+            e.printStackTrace();
36
+            throw new IllegalStateException(e);
37
+        }
38
+    }
39
+
40
+    public static void initialize(Initializable initializable) {
41
+        try {
42
+            initializable.initialize();
43
+        } catch (Exception e) {
44
+            e.printStackTrace();
45
+            throw new IllegalStateException(e);
46
+        }
47
+    }
48
+}

+ 24
- 0
fop-core/src/main/java/org/apache/fop/activity/Initializable.java View File

@@ -0,0 +1,24 @@
1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *      http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+/* $Id: Accessibility.java 1343632 2012-05-29 09:48:03Z vhennebert $ */
19
+package org.apache.fop.activity;
20
+
21
+public interface Initializable {
22
+
23
+    void initialize() throws Exception;
24
+}

+ 2
- 2
fop-core/src/main/java/org/apache/fop/apps/FOUserAgent.java View File

@@ -30,8 +30,6 @@ import java.util.Map;
30 30
 import javax.xml.transform.Source;
31 31
 import javax.xml.transform.stream.StreamSource;
32 32
 
33
-import org.apache.avalon.framework.configuration.Configuration;
34
-import org.apache.avalon.framework.configuration.ConfigurationException;
35 33
 import org.apache.commons.logging.Log;
36 34
 import org.apache.commons.logging.LogFactory;
37 35
 
@@ -47,6 +45,8 @@ import org.apache.fop.accessibility.Accessibility;
47 45
 import org.apache.fop.accessibility.DummyStructureTreeEventHandler;
48 46
 import org.apache.fop.accessibility.StructureTreeEventHandler;
49 47
 import org.apache.fop.apps.io.InternalResourceResolver;
48
+import org.apache.fop.configuration.Configuration;
49
+import org.apache.fop.configuration.ConfigurationException;
50 50
 import org.apache.fop.events.DefaultEventBroadcaster;
51 51
 import org.apache.fop.events.Event;
52 52
 import org.apache.fop.events.EventBroadcaster;

+ 3
- 3
fop-core/src/main/java/org/apache/fop/apps/FopConfParser.java View File

@@ -31,9 +31,6 @@ import java.util.Map;
31 31
 
32 32
 import org.xml.sax.SAXException;
33 33
 
34
-import org.apache.avalon.framework.configuration.Configuration;
35
-import org.apache.avalon.framework.configuration.ConfigurationException;
36
-import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
37 34
 import org.apache.commons.logging.Log;
38 35
 import org.apache.commons.logging.LogFactory;
39 36
 
@@ -43,6 +40,9 @@ import org.apache.xmlgraphics.io.ResourceResolver;
43 40
 
44 41
 import org.apache.fop.apps.io.InternalResourceResolver;
45 42
 import org.apache.fop.apps.io.ResourceResolverFactory;
43
+import org.apache.fop.configuration.Configuration;
44
+import org.apache.fop.configuration.ConfigurationException;
45
+import org.apache.fop.configuration.DefaultConfigurationBuilder;
46 46
 import org.apache.fop.fonts.FontManagerConfigurator;
47 47
 import org.apache.fop.hyphenation.HyphenationTreeCache;
48 48
 import org.apache.fop.hyphenation.Hyphenator;

+ 1
- 1
fop-core/src/main/java/org/apache/fop/apps/FopFactory.java View File

@@ -30,7 +30,6 @@ import java.util.Set;
30 30
 
31 31
 import org.xml.sax.SAXException;
32 32
 
33
-import org.apache.avalon.framework.configuration.Configuration;
34 33
 import org.apache.commons.logging.Log;
35 34
 import org.apache.commons.logging.LogFactory;
36 35
 
@@ -41,6 +40,7 @@ import org.apache.xmlgraphics.util.UnitConv;
41 40
 
42 41
 import org.apache.fop.apps.io.InternalResourceResolver;
43 42
 import org.apache.fop.apps.io.ResourceResolverFactory;
43
+import org.apache.fop.configuration.Configuration;
44 44
 import org.apache.fop.fo.ElementMapping;
45 45
 import org.apache.fop.fo.ElementMappingRegistry;
46 46
 import org.apache.fop.fonts.FontManager;

+ 1
- 2
fop-core/src/main/java/org/apache/fop/apps/FopFactoryBuilder.java View File

@@ -26,8 +26,6 @@ import java.util.HashSet;
26 26
 import java.util.Map;
27 27
 import java.util.Set;
28 28
 
29
-import org.apache.avalon.framework.configuration.Configuration;
30
-
31 29
 import org.apache.xmlgraphics.image.loader.ImageContext;
32 30
 import org.apache.xmlgraphics.image.loader.ImageManager;
33 31
 import org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext.FallbackResolver;
@@ -35,6 +33,7 @@ import org.apache.xmlgraphics.io.ResourceResolver;
35 33
 
36 34
 import org.apache.fop.apps.io.InternalResourceResolver;
37 35
 import org.apache.fop.apps.io.ResourceResolverFactory;
36
+import org.apache.fop.configuration.Configuration;
38 37
 import org.apache.fop.fonts.FontManager;
39 38
 import org.apache.fop.layoutmgr.LayoutManagerMaker;
40 39
 

+ 1
- 2
fop-core/src/main/java/org/apache/fop/apps/FopFactoryConfig.java View File

@@ -23,13 +23,12 @@ import java.net.URI;
23 23
 import java.util.Map;
24 24
 import java.util.Set;
25 25
 
26
-import org.apache.avalon.framework.configuration.Configuration;
27
-
28 26
 import org.apache.xmlgraphics.image.loader.ImageManager;
29 27
 import org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext.FallbackResolver;
30 28
 import org.apache.xmlgraphics.io.ResourceResolver;
31 29
 
32 30
 import org.apache.fop.apps.io.InternalResourceResolver;
31
+import org.apache.fop.configuration.Configuration;
33 32
 import org.apache.fop.fonts.FontManager;
34 33
 import org.apache.fop.layoutmgr.LayoutManagerMaker;
35 34
 

+ 0
- 3
fop-core/src/main/java/org/apache/fop/cli/Main.java View File

@@ -112,9 +112,6 @@ public final class Main {
112 112
         try {
113 113
             //System.out.println(Thread.currentThread().getContextClassLoader());
114 114
             Class clazz = Class.forName("org.apache.commons.io.IOUtils");
115
-            if (clazz != null) {
116
-                clazz = Class.forName("org.apache.avalon.framework.configuration.Configuration");
117
-            }
118 115
             return (clazz != null);
119 116
         } catch (Exception e) {
120 117
             return false;

+ 24
- 0
fop-core/src/main/java/org/apache/fop/configuration/Configurable.java View File

@@ -0,0 +1,24 @@
1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *      http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+/* $Id: Accessibility.java 1343632 2012-05-29 09:48:03Z vhennebert $ */
19
+package org.apache.fop.configuration;
20
+
21
+public interface Configurable {
22
+
23
+    void configure(Configuration cfg) throws ConfigurationException;
24
+}

+ 61
- 0
fop-core/src/main/java/org/apache/fop/configuration/Configuration.java View File

@@ -0,0 +1,61 @@
1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *      http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+/* $Id: Accessibility.java 1343632 2012-05-29 09:48:03Z vhennebert $ */
19
+package org.apache.fop.configuration;
20
+
21
+public interface Configuration {
22
+
23
+    Configuration getChild(String key);
24
+
25
+    Configuration getChild(String key, boolean required);
26
+
27
+    Configuration[] getChildren(String key);
28
+
29
+    String[] getAttributeNames();
30
+
31
+    String getAttribute(String key) throws ConfigurationException;
32
+
33
+    String getAttribute(String key, String defaultValue);
34
+
35
+    boolean getAttributeAsBoolean(String key, boolean defaultValue);
36
+
37
+    float getAttributeAsFloat(String key) throws ConfigurationException;
38
+
39
+    float getAttributeAsFloat(String key, float defaultValue);
40
+
41
+    int getAttributeAsInteger(String key, int defaultValue);
42
+
43
+    String getValue() throws ConfigurationException;
44
+
45
+    String getValue(String defaultValue);
46
+
47
+    boolean getValueAsBoolean() throws ConfigurationException;
48
+
49
+    boolean getValueAsBoolean(boolean defaultValue);
50
+
51
+    int getValueAsInteger() throws ConfigurationException;
52
+
53
+    int getValueAsInteger(int defaultValue);
54
+
55
+    float getValueAsFloat() throws ConfigurationException;
56
+
57
+    float getValueAsFloat(float defaultValue);
58
+
59
+    String getLocation();
60
+
61
+}

+ 30
- 0
fop-core/src/main/java/org/apache/fop/configuration/ConfigurationException.java View File

@@ -0,0 +1,30 @@
1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *      http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+/* $Id: Accessibility.java 1343632 2012-05-29 09:48:03Z vhennebert $ */
19
+package org.apache.fop.configuration;
20
+
21
+public class ConfigurationException extends Exception {
22
+
23
+    public ConfigurationException(String message) {
24
+        super(message);
25
+    }
26
+
27
+    public ConfigurationException(String message, Throwable cause) {
28
+        super(message, cause);
29
+    }
30
+}

+ 293
- 0
fop-core/src/main/java/org/apache/fop/configuration/DefaultConfiguration.java View File

@@ -0,0 +1,293 @@
1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *      http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+/* $Id: Accessibility.java 1343632 2012-05-29 09:48:03Z vhennebert $ */
19
+package org.apache.fop.configuration;
20
+
21
+import java.io.StringWriter;
22
+import java.util.ArrayList;
23
+import java.util.Collections;
24
+import java.util.List;
25
+
26
+import javax.xml.parsers.DocumentBuilder;
27
+import javax.xml.parsers.DocumentBuilderFactory;
28
+import javax.xml.parsers.ParserConfigurationException;
29
+import javax.xml.transform.OutputKeys;
30
+import javax.xml.transform.Transformer;
31
+import javax.xml.transform.TransformerException;
32
+import javax.xml.transform.TransformerFactory;
33
+import javax.xml.transform.dom.DOMSource;
34
+import javax.xml.transform.stream.StreamResult;
35
+
36
+import org.w3c.dom.Document;
37
+import org.w3c.dom.Element;
38
+import org.w3c.dom.NamedNodeMap;
39
+import org.w3c.dom.Node;
40
+import org.w3c.dom.NodeList;
41
+
42
+public class DefaultConfiguration implements Configuration {
43
+
44
+    static final DocumentBuilderFactory DBF = DocumentBuilderFactory.newInstance();
45
+
46
+    static {
47
+        DBF.setNamespaceAware(false);
48
+        DBF.setValidating(false);
49
+        DBF.setIgnoringComments(true);
50
+        DBF.setIgnoringElementContentWhitespace(true);
51
+        DBF.setExpandEntityReferences(true);
52
+    }
53
+
54
+    /**
55
+     * @deprecated For debug only.
56
+     */
57
+    public static String toString(Document document) {
58
+        try {
59
+            Transformer transformer = TransformerFactory.newInstance().newTransformer();
60
+            transformer.setOutputProperty(OutputKeys.INDENT, "yes");
61
+            transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
62
+            //initialize StreamResult with File object to save to file
63
+            StreamResult result = new StreamResult(new StringWriter());
64
+            DOMSource source = new DOMSource(document);
65
+            transformer.transform(source, result);
66
+            return result.getWriter().toString();
67
+        } catch (TransformerException e) {
68
+            throw new IllegalStateException(e);
69
+        }
70
+    }
71
+
72
+    private Element element;
73
+
74
+    public DefaultConfiguration(String key) {
75
+        DocumentBuilder builder = null;
76
+        try {
77
+            builder = DBF.newDocumentBuilder();
78
+        } catch (ParserConfigurationException e) {
79
+            e.printStackTrace();
80
+            throw new IllegalStateException(e);
81
+        }
82
+        Document doc = builder.newDocument();
83
+        // create the root element node
84
+        element = doc.createElement(key);
85
+        doc.appendChild(element);
86
+    }
87
+
88
+    DefaultConfiguration(Element element) {
89
+        this.element = element;
90
+    }
91
+
92
+    Element getElement() {
93
+        return element;
94
+    }
95
+
96
+    public void addChild(DefaultConfiguration configuration) {
97
+        Element node = (Element) element.getOwnerDocument().importNode(configuration.getElement(), true);
98
+        element.appendChild(node);
99
+    }
100
+
101
+    String getValue0() {
102
+        String result = element.getTextContent();
103
+        if (result == null) {
104
+            result = "";
105
+        }
106
+        return result;
107
+    }
108
+
109
+    @Override
110
+    public Configuration getChild(String key) {
111
+        NodeList nl = element.getElementsByTagName(key);
112
+        for (int i = 0; i < nl.getLength(); ++i) {
113
+            Node n = nl.item(i);
114
+            if (n.getNodeName().equals(key)) {
115
+                return new DefaultConfiguration((Element) n);
116
+            }
117
+        }
118
+        return NullConfiguration.INSTANCE;
119
+    }
120
+
121
+    @Override
122
+    public Configuration getChild(String key, boolean required) {
123
+        Configuration result = getChild(key);
124
+        if (!required && result == NullConfiguration.INSTANCE) {
125
+            return null;
126
+        }
127
+        if (required && (result == null || result == NullConfiguration.INSTANCE)) {
128
+            // throw new IllegalStateException("No child '" + key + "'");
129
+            return NullConfiguration.INSTANCE;
130
+        }
131
+        return result;
132
+    }
133
+
134
+    @Override
135
+    public Configuration[] getChildren(String key) {
136
+        NodeList nl = element.getElementsByTagName(key);
137
+        Configuration[] result = new Configuration[nl.getLength()];
138
+        for (int i = 0; i < nl.getLength(); ++i) {
139
+            Node n = nl.item(i);
140
+            result[i] = new DefaultConfiguration((Element) n);
141
+        }
142
+        return result;
143
+    }
144
+
145
+    @Override
146
+    public String[] getAttributeNames() {
147
+        NamedNodeMap nnm = element.getAttributes();
148
+        String[] result = new String[nnm.getLength()];
149
+        for (int i = 0; i < nnm.getLength(); ++i) {
150
+            Node n = nnm.item(i);
151
+            result[i] = n.getNodeName();
152
+        }
153
+        return result;
154
+    }
155
+
156
+    @Override
157
+    public String getAttribute(String key) {
158
+        String result = element.getAttribute(key);
159
+        if ("".equals(result)) {
160
+            result = null;
161
+        }
162
+        return result;
163
+    }
164
+
165
+    @Override
166
+    public String getAttribute(String key, String defaultValue) {
167
+        String result = getAttribute(key);
168
+        if (result == null || "".equals(result)) {
169
+            result = defaultValue;
170
+        }
171
+        return result;
172
+    }
173
+
174
+    @Override
175
+    public boolean getAttributeAsBoolean(String key, boolean defaultValue) {
176
+        String result = getAttribute(key);
177
+        if (result == null || "".equals(result)) {
178
+            return defaultValue;
179
+        }
180
+        return "true".equalsIgnoreCase(result) || "yes".equalsIgnoreCase(result);
181
+    }
182
+
183
+    @Override
184
+    public float getAttributeAsFloat(String key) throws ConfigurationException {
185
+        return Float.parseFloat(getAttribute(key));
186
+    }
187
+
188
+    @Override
189
+    public float getAttributeAsFloat(String key, float defaultValue) {
190
+        String result = getAttribute(key);
191
+        if (result == null || "".equals(result)) {
192
+            return defaultValue;
193
+        }
194
+        return Float.parseFloat(result);
195
+    }
196
+
197
+    @Override
198
+    public int getAttributeAsInteger(String key, int defaultValue) {
199
+        String result = getAttribute(key);
200
+        if (result == null || "".equals(result)) {
201
+            return defaultValue;
202
+        }
203
+        return Integer.parseInt(result);
204
+    }
205
+
206
+    @Override
207
+    public String getValue() throws ConfigurationException {
208
+        String result = getValue0();
209
+        if (result == null || "".equals(result)) {
210
+            throw new ConfigurationException("No value in " + element.getNodeName());
211
+        }
212
+        return result;
213
+    }
214
+
215
+    @Override
216
+    public String getValue(String defaultValue) {
217
+        String result = getValue0();
218
+        if (result == null || "".equals(result)) {
219
+            result = defaultValue;
220
+        }
221
+        return result;
222
+    }
223
+
224
+    @Override
225
+    public boolean getValueAsBoolean() throws ConfigurationException {
226
+        return Boolean.parseBoolean(getValue0());
227
+    }
228
+
229
+    @Override
230
+    public boolean getValueAsBoolean(boolean defaultValue) {
231
+        String result = getValue0().trim();
232
+        if ("".equals(result)) {
233
+            return defaultValue;
234
+        }
235
+        return Boolean.parseBoolean(result);
236
+    }
237
+
238
+    @Override
239
+    public int getValueAsInteger() throws ConfigurationException {
240
+        try {
241
+            return Integer.parseInt(getValue0());
242
+        } catch (NumberFormatException e) {
243
+            throw new ConfigurationException("Not an integer", e);
244
+        }
245
+    }
246
+
247
+    @Override
248
+    public int getValueAsInteger(int defaultValue) {
249
+        String result = getValue0();
250
+        if (result == null || "".equals(result)) {
251
+            return defaultValue;
252
+        }
253
+        return Integer.parseInt(result);
254
+    }
255
+
256
+    @Override
257
+    public float getValueAsFloat() throws ConfigurationException {
258
+        try {
259
+            return Float.parseFloat(getValue0());
260
+        } catch (NumberFormatException e) {
261
+            throw new ConfigurationException("Not a float", e);
262
+        }
263
+    }
264
+
265
+    @Override
266
+    public float getValueAsFloat(float defaultValue) {
267
+        String result = getValue0();
268
+        if (result == null || "".equals(result)) {
269
+            return defaultValue;
270
+        }
271
+        return Float.parseFloat(getValue0());
272
+    }
273
+
274
+    @Override
275
+    public String getLocation() {
276
+        List<String> path = new ArrayList<String>();
277
+        for (Node el = element; el != null; el = el.getParentNode()) {
278
+            if (el instanceof Element) {
279
+                path.add(((Element) el).getTagName());
280
+            }
281
+        }
282
+        Collections.reverse(path);
283
+
284
+        StringBuilder sb = new StringBuilder();
285
+        for (String s : path) {
286
+            if (sb.length() > 0) {
287
+                sb.append("/");
288
+            }
289
+            sb.append(s);
290
+        }
291
+        return sb.toString();
292
+    }
293
+}

+ 76
- 0
fop-core/src/main/java/org/apache/fop/configuration/DefaultConfigurationBuilder.java View File

@@ -0,0 +1,76 @@
1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *      http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+/* $Id: Accessibility.java 1343632 2012-05-29 09:48:03Z vhennebert $ */
19
+package org.apache.fop.configuration;
20
+
21
+import java.io.File;
22
+import java.io.IOException;
23
+import java.io.InputStream;
24
+
25
+import javax.xml.parsers.DocumentBuilder;
26
+import javax.xml.parsers.ParserConfigurationException;
27
+
28
+import org.w3c.dom.DOMException;
29
+import org.w3c.dom.Document;
30
+import org.xml.sax.SAXException;
31
+
32
+import org.apache.commons.logging.Log;
33
+import org.apache.commons.logging.LogFactory;
34
+
35
+public class DefaultConfigurationBuilder {
36
+
37
+    private static final Log LOG = LogFactory.getLog(DefaultConfigurationBuilder.class.getName());
38
+
39
+    public DefaultConfiguration build(InputStream confStream) throws ConfigurationException {
40
+        try {
41
+            DocumentBuilder builder = DefaultConfiguration.DBF.newDocumentBuilder();
42
+            Document document = builder.parse(confStream);
43
+            return new DefaultConfiguration(document.getDocumentElement());
44
+        } catch (DOMException e) {
45
+            throw new ConfigurationException("xml parse error", e);
46
+        } catch (ParserConfigurationException e) {
47
+            throw new ConfigurationException("xml parse error", e);
48
+        } catch (IOException e) {
49
+            throw new ConfigurationException("xml parse error", e);
50
+        } catch (SAXException e) {
51
+            throw new ConfigurationException("xml parse error", e);
52
+        } finally {
53
+            try {
54
+                confStream.close();
55
+            } catch (IOException e) {
56
+                throw new IllegalStateException(e);
57
+            }
58
+        }
59
+    }
60
+
61
+    public DefaultConfiguration buildFromFile(File file) throws ConfigurationException {
62
+        try {
63
+            DocumentBuilder builder = DefaultConfiguration.DBF.newDocumentBuilder();
64
+            Document document = builder.parse(file);
65
+            return new DefaultConfiguration(document.getDocumentElement());
66
+        } catch (DOMException e) {
67
+            throw new ConfigurationException("xml parse error", e);
68
+        } catch (ParserConfigurationException e) {
69
+            throw new ConfigurationException("xml parse error", e);
70
+        } catch (IOException e) {
71
+            throw new ConfigurationException("xml parse error", e);
72
+        } catch (SAXException e) {
73
+            throw new ConfigurationException("xml parse error", e);
74
+        }
75
+    }
76
+}

+ 124
- 0
fop-core/src/main/java/org/apache/fop/configuration/NullConfiguration.java View File

@@ -0,0 +1,124 @@
1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *      http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+/* $Id: Accessibility.java 1343632 2012-05-29 09:48:03Z vhennebert $ */
19
+package org.apache.fop.configuration;
20
+
21
+final class NullConfiguration implements Configuration {
22
+
23
+    static final NullConfiguration INSTANCE = new NullConfiguration();
24
+
25
+    private NullConfiguration() {
26
+
27
+    }
28
+
29
+    @Override
30
+    public Configuration getChild(String key) {
31
+        return INSTANCE;
32
+    }
33
+
34
+    @Override
35
+    public Configuration getChild(String key, boolean required) {
36
+        return INSTANCE;
37
+    }
38
+
39
+    @Override
40
+    public Configuration[] getChildren(String key) {
41
+        return new Configuration[0];
42
+    }
43
+
44
+    @Override
45
+    public String[] getAttributeNames() {
46
+        return new String[0];
47
+    }
48
+
49
+    @Override
50
+    public String getAttribute(String key) throws ConfigurationException {
51
+        return "";
52
+    }
53
+
54
+    @Override
55
+    public String getAttribute(String key, String defaultValue) {
56
+        return defaultValue;
57
+    }
58
+
59
+    @Override
60
+    public boolean getAttributeAsBoolean(String key, boolean defaultValue) {
61
+        return defaultValue;
62
+    }
63
+
64
+    @Override
65
+    public float getAttributeAsFloat(String key) throws ConfigurationException {
66
+        return 0;
67
+    }
68
+
69
+    @Override
70
+    public float getAttributeAsFloat(String key, float defaultValue) {
71
+        return defaultValue;
72
+    }
73
+
74
+    @Override
75
+    public int getAttributeAsInteger(String key, int defaultValue) {
76
+        return defaultValue;
77
+    }
78
+
79
+    @Override
80
+    public String getValue() throws ConfigurationException {
81
+        // return null;
82
+        throw new ConfigurationException("missing value");
83
+    }
84
+
85
+    @Override
86
+    public String getValue(String defaultValue) {
87
+        return defaultValue;
88
+    }
89
+
90
+    @Override
91
+    public boolean getValueAsBoolean() throws ConfigurationException {
92
+        return false;
93
+    }
94
+
95
+    @Override
96
+    public boolean getValueAsBoolean(boolean defaultValue) {
97
+        return defaultValue;
98
+    }
99
+
100
+    @Override
101
+    public int getValueAsInteger() throws ConfigurationException {
102
+        return 0;
103
+    }
104
+
105
+    @Override
106
+    public int getValueAsInteger(int defaultValue) {
107
+        return defaultValue;
108
+    }
109
+
110
+    @Override
111
+    public float getValueAsFloat() throws ConfigurationException {
112
+        return 0;
113
+    }
114
+
115
+    @Override
116
+    public float getValueAsFloat(float defaultValue) {
117
+        return defaultValue;
118
+    }
119
+
120
+    @Override
121
+    public String getLocation() {
122
+        return "<no-location>";
123
+    }
124
+}

+ 2
- 2
fop-core/src/main/java/org/apache/fop/fonts/DefaultFontConfig.java View File

@@ -23,12 +23,12 @@ import java.util.ArrayList;
23 23
 import java.util.Collections;
24 24
 import java.util.List;
25 25
 
26
-import org.apache.avalon.framework.configuration.Configuration;
27
-import org.apache.avalon.framework.configuration.ConfigurationException;
28 26
 import org.apache.commons.logging.Log;
29 27
 import org.apache.commons.logging.LogFactory;
30 28
 
31 29
 import org.apache.fop.apps.FOPException;
30
+import org.apache.fop.configuration.Configuration;
31
+import org.apache.fop.configuration.ConfigurationException;
32 32
 import org.apache.fop.events.EventProducer;
33 33
 import org.apache.fop.util.LogUtil;
34 34
 

+ 2
- 3
fop-core/src/main/java/org/apache/fop/fonts/FontConfig.java View File

@@ -19,9 +19,8 @@
19 19
 
20 20
 package org.apache.fop.fonts;
21 21
 
22
-import org.apache.avalon.framework.configuration.Configuration;
23
-
24 22
 import org.apache.fop.apps.FOPException;
23
+import org.apache.fop.configuration.Configuration;
25 24
 import org.apache.fop.events.EventProducer;
26 25
 
27 26
 /**
@@ -45,6 +44,6 @@ public interface FontConfig {
45 44
          * @throws FOPException if an error occurs creating the font configuration object
46 45
          */
47 46
         FontConfig parse(Configuration cfg, FontManager fontManager, boolean strict,
48
-                EventProducer eventProducer) throws FOPException;
47
+                         EventProducer eventProducer) throws FOPException;
49 48
     }
50 49
 }

+ 2
- 2
fop-core/src/main/java/org/apache/fop/fonts/FontManagerConfigurator.java View File

@@ -24,8 +24,6 @@ import java.net.URISyntaxException;
24 24
 import java.util.List;
25 25
 import java.util.regex.Pattern;
26 26
 
27
-import org.apache.avalon.framework.configuration.Configuration;
28
-import org.apache.avalon.framework.configuration.ConfigurationException;
29 27
 import org.apache.commons.logging.Log;
30 28
 import org.apache.commons.logging.LogFactory;
31 29
 
@@ -34,6 +32,8 @@ import org.apache.xmlgraphics.io.ResourceResolver;
34 32
 import org.apache.fop.apps.FOPException;
35 33
 import org.apache.fop.apps.io.InternalResourceResolver;
36 34
 import org.apache.fop.apps.io.ResourceResolverFactory;
35
+import org.apache.fop.configuration.Configuration;
36
+import org.apache.fop.configuration.ConfigurationException;
37 37
 import org.apache.fop.fonts.substitute.FontSubstitutions;
38 38
 import org.apache.fop.fonts.substitute.FontSubstitutionsConfigurator;
39 39
 import org.apache.fop.util.LogUtil;

+ 1
- 2
fop-core/src/main/java/org/apache/fop/fonts/substitute/FontSubstitutionsConfigurator.java View File

@@ -19,9 +19,8 @@
19 19
 
20 20
 package org.apache.fop.fonts.substitute;
21 21
 
22
-import org.apache.avalon.framework.configuration.Configuration;
23
-
24 22
 import org.apache.fop.apps.FOPException;
23
+import org.apache.fop.configuration.Configuration;
25 24
 
26 25
 /**
27 26
  * Configures a font substitution catalog

+ 1
- 2
fop-core/src/main/java/org/apache/fop/render/RendererConfig.java View File

@@ -19,10 +19,9 @@
19 19
 
20 20
 package org.apache.fop.render;
21 21
 
22
-import org.apache.avalon.framework.configuration.Configuration;
23
-
24 22
 import org.apache.fop.apps.FOPException;
25 23
 import org.apache.fop.apps.FOUserAgent;
24
+import org.apache.fop.configuration.Configuration;
26 25
 import org.apache.fop.fonts.FontConfig;
27 26
 
28 27
 /**

+ 2
- 0
fop-core/src/main/java/org/apache/fop/render/RendererConfigOption.java View File

@@ -26,4 +26,6 @@ package org.apache.fop.render;
26 26
 public interface RendererConfigOption {
27 27
     /** The name of the option. */
28 28
     String getName();
29
+
30
+    Object getDefaultValue();
29 31
 }

+ 2
- 2
fop-core/src/main/java/org/apache/fop/render/XMLHandlerConfigurator.java View File

@@ -19,13 +19,13 @@
19 19
 
20 20
 package org.apache.fop.render;
21 21
 
22
-import org.apache.avalon.framework.configuration.Configuration;
23
-import org.apache.avalon.framework.configuration.ConfigurationException;
24 22
 import org.apache.commons.logging.Log;
25 23
 import org.apache.commons.logging.LogFactory;
26 24
 
27 25
 import org.apache.fop.apps.FOPException;
28 26
 import org.apache.fop.apps.FOUserAgent;
27
+import org.apache.fop.configuration.Configuration;
28
+import org.apache.fop.configuration.ConfigurationException;
29 29
 
30 30
 /**
31 31
  * Configurator for XMLHandler objects.

+ 3
- 3
fop-core/src/main/java/org/apache/fop/render/afp/AFPFontConfig.java View File

@@ -27,8 +27,6 @@ import java.util.ArrayList;
27 27
 import java.util.Collections;
28 28
 import java.util.List;
29 29
 
30
-import org.apache.avalon.framework.configuration.Configuration;
31
-import org.apache.avalon.framework.configuration.ConfigurationException;
32 30
 import org.apache.commons.logging.Log;
33 31
 import org.apache.commons.logging.LogFactory;
34 32
 
@@ -44,6 +42,8 @@ import org.apache.fop.afp.fonts.RasterFont;
44 42
 import org.apache.fop.afp.util.AFPResourceAccessor;
45 43
 import org.apache.fop.apps.FOPException;
46 44
 import org.apache.fop.apps.io.InternalResourceResolver;
45
+import org.apache.fop.configuration.Configuration;
46
+import org.apache.fop.configuration.ConfigurationException;
47 47
 import org.apache.fop.events.EventProducer;
48 48
 import org.apache.fop.fonts.EmbedFontInfo;
49 49
 import org.apache.fop.fonts.FontConfig;
@@ -85,7 +85,7 @@ public final class AFPFontConfig implements FontConfig {
85 85
 
86 86
         /** {@inheritDoc}} */
87 87
         public AFPFontConfig parse(Configuration cfg, FontManager fontManager, boolean strict,
88
-                EventProducer eventProducer) throws FOPException {
88
+                                   EventProducer eventProducer) throws FOPException {
89 89
             try {
90 90
                 return new ParserHelper(cfg, fontManager, strict,
91 91
                         (AFPEventProducer) eventProducer).fontConfig;

+ 1
- 2
fop-core/src/main/java/org/apache/fop/render/afp/AFPInfo.java View File

@@ -19,12 +19,11 @@
19 19
 
20 20
 package org.apache.fop.render.afp;
21 21
 
22
-import org.apache.avalon.framework.configuration.Configuration;
23
-
24 22
 import org.apache.fop.afp.AFPGraphics2D;
25 23
 import org.apache.fop.afp.AFPPaintingState;
26 24
 import org.apache.fop.afp.AFPResourceInfo;
27 25
 import org.apache.fop.afp.AFPResourceManager;
26
+import org.apache.fop.configuration.Configuration;
28 27
 import org.apache.fop.fonts.FontInfo;
29 28
 
30 29
 /**

+ 2
- 2
fop-core/src/main/java/org/apache/fop/render/afp/AFPRendererConfig.java View File

@@ -23,8 +23,6 @@ import java.net.URI;
23 23
 import java.net.URISyntaxException;
24 24
 import java.util.EnumMap;
25 25
 
26
-import org.apache.avalon.framework.configuration.Configuration;
27
-import org.apache.avalon.framework.configuration.ConfigurationException;
28 26
 import org.apache.commons.logging.Log;
29 27
 import org.apache.commons.logging.LogFactory;
30 28
 
@@ -38,6 +36,8 @@ import org.apache.fop.apps.FOPException;
38 36
 import org.apache.fop.apps.FOUserAgent;
39 37
 import org.apache.fop.apps.MimeConstants;
40 38
 import org.apache.fop.apps.io.InternalResourceResolver;
39
+import org.apache.fop.configuration.Configuration;
40
+import org.apache.fop.configuration.ConfigurationException;
41 41
 import org.apache.fop.fonts.FontManager;
42 42
 import org.apache.fop.render.RendererConfig;
43 43
 import org.apache.fop.render.afp.AFPFontConfig.AFPFontInfoConfigParser;

+ 2
- 3
fop-core/src/main/java/org/apache/fop/render/afp/AFPRendererContext.java View File

@@ -21,12 +21,11 @@ package org.apache.fop.render.afp;
21 21
 
22 22
 import java.util.Map;
23 23
 
24
-import org.apache.avalon.framework.configuration.Configuration;
25
-
26 24
 import org.apache.fop.afp.AFPPaintingState;
27 25
 import org.apache.fop.afp.AFPResourceInfo;
28 26
 import org.apache.fop.afp.AFPResourceManager;
29 27
 import org.apache.fop.afp.modca.ResourceObject;
28
+import org.apache.fop.configuration.Configuration;
30 29
 import org.apache.fop.render.AbstractRenderer;
31 30
 import org.apache.fop.render.ImageHandlerUtil;
32 31
 import org.apache.fop.render.RendererContext;
@@ -58,7 +57,7 @@ public class AFPRendererContext extends RendererContext {
58 57
         info.setHeight((Integer) getProperty(RendererContextConstants.HEIGHT));
59 58
         info.setX((Integer) getProperty(RendererContextConstants.XPOS));
60 59
         info.setY((Integer) getProperty(RendererContextConstants.YPOS));
61
-        info.setHandlerConfiguration((Configuration)getProperty(
60
+        info.setHandlerConfiguration((Configuration) getProperty(
62 61
                 RendererContextConstants.HANDLER_CONFIGURATION));
63 62
         info.setFontInfo((org.apache.fop.fonts.FontInfo)getProperty(
64 63
                 AFPRendererContextConstants.AFP_FONT_INFO));

+ 5
- 0
fop-core/src/main/java/org/apache/fop/render/afp/AFPRendererOption.java View File

@@ -61,4 +61,9 @@ public enum AFPRendererOption implements RendererConfigOption {
61 61
     public Class<?> getType() {
62 62
         return type;
63 63
     }
64
+
65
+    @Override
66
+    public Object getDefaultValue() {
67
+        return null;
68
+    }
64 69
 }

+ 1
- 1
fop-core/src/main/java/org/apache/fop/render/afp/AFPShadingMode.java View File

@@ -49,7 +49,7 @@ public enum AFPShadingMode {
49 49
      * @return the enumeration object
50 50
      */
51 51
     public static AFPShadingMode getValueOf(String name) {
52
-        if (COLOR.getName().equalsIgnoreCase(name)) {
52
+        if (name == null || "".equals(name) || COLOR.getName().equalsIgnoreCase(name)) {
53 53
             return COLOR;
54 54
         } else if (DITHERED.getName().equalsIgnoreCase(name)) {
55 55
             return DITHERED;

+ 13
- 3
fop-core/src/main/java/org/apache/fop/render/bitmap/BitmapRendererConfig.java View File

@@ -23,10 +23,9 @@ import java.awt.Color;
23 23
 import java.awt.image.BufferedImage;
24 24
 import java.util.EnumMap;
25 25
 
26
-import org.apache.avalon.framework.configuration.Configuration;
27
-
28 26
 import org.apache.fop.apps.FOPException;
29 27
 import org.apache.fop.apps.FOUserAgent;
28
+import org.apache.fop.configuration.Configuration;
30 29
 import org.apache.fop.fonts.DefaultFontConfig;
31 30
 import org.apache.fop.fonts.DefaultFontConfig.DefaultFontConfigParser;
32 31
 import org.apache.fop.fonts.FontEventAdapter;
@@ -170,7 +169,18 @@ public class BitmapRendererConfig implements RendererConfig {
170 169
         }
171 170
 
172 171
         private String getValue(Configuration cfg, BitmapRendererOption option) {
173
-            return cfg.getChild(option.getName()).getValue(null);
172
+            Object defaultValue = option.getDefaultValue();
173
+            Object result = cfg.getChild(option.getName()).getValue(null);
174
+            if (result == null || "".equals(result)) {
175
+                result = defaultValue;
176
+            }
177
+            if (result == null) {
178
+                return null;
179
+            }
180
+            if (result instanceof Color) {
181
+                return ColorUtil.colorToString((Color) result);
182
+            }
183
+            return result.toString();
174 184
         }
175 185
 
176 186
         public String getMimeType() {

+ 1
- 2
fop-core/src/main/java/org/apache/fop/render/bitmap/PNGRendererConfig.java View File

@@ -17,12 +17,11 @@
17 17
 
18 18
 package org.apache.fop.render.bitmap;
19 19
 
20
-import org.apache.avalon.framework.configuration.Configuration;
21
-
22 20
 import org.apache.xmlgraphics.util.MimeConstants;
23 21
 
24 22
 import org.apache.fop.apps.FOPException;
25 23
 import org.apache.fop.apps.FOUserAgent;
24
+import org.apache.fop.configuration.Configuration;
26 25
 import org.apache.fop.fonts.DefaultFontConfig;
27 26
 import org.apache.fop.fonts.DefaultFontConfig.DefaultFontConfigParser;
28 27
 import org.apache.fop.fonts.FontEventAdapter;

+ 1
- 2
fop-core/src/main/java/org/apache/fop/render/bitmap/TIFFRendererConfig.java View File

@@ -21,13 +21,12 @@ package org.apache.fop.render.bitmap;
21 21
 
22 22
 import java.util.EnumMap;
23 23
 
24
-import org.apache.avalon.framework.configuration.Configuration;
25
-
26 24
 import org.apache.xmlgraphics.image.writer.Endianness;
27 25
 
28 26
 import org.apache.fop.apps.FOPException;
29 27
 import org.apache.fop.apps.FOUserAgent;
30 28
 import org.apache.fop.apps.MimeConstants;
29
+import org.apache.fop.configuration.Configuration;
31 30
 import org.apache.fop.fonts.DefaultFontConfig;
32 31
 import org.apache.fop.fonts.DefaultFontConfig.DefaultFontConfigParser;
33 32
 import org.apache.fop.fonts.FontEventAdapter;

+ 1
- 2
fop-core/src/main/java/org/apache/fop/render/intermediate/IFRendererConfig.java View File

@@ -19,10 +19,9 @@
19 19
 
20 20
 package org.apache.fop.render.intermediate;
21 21
 
22
-import org.apache.avalon.framework.configuration.Configuration;
23
-
24 22
 import org.apache.fop.apps.FOPException;
25 23
 import org.apache.fop.apps.FOUserAgent;
24
+import org.apache.fop.configuration.Configuration;
26 25
 import org.apache.fop.fonts.DefaultFontConfig;
27 26
 import org.apache.fop.fonts.DefaultFontConfig.DefaultFontConfigParser;
28 27
 import org.apache.fop.fonts.FontConfig;

+ 1
- 2
fop-core/src/main/java/org/apache/fop/render/java2d/Java2DRendererConfig.java View File

@@ -21,10 +21,9 @@ package org.apache.fop.render.java2d;
21 21
 
22 22
 import java.util.EnumMap;
23 23
 
24
-import org.apache.avalon.framework.configuration.Configuration;
25
-
26 24
 import org.apache.fop.apps.FOPException;
27 25
 import org.apache.fop.apps.FOUserAgent;
26
+import org.apache.fop.configuration.Configuration;
28 27
 import org.apache.fop.fonts.DefaultFontConfig;
29 28
 import org.apache.fop.fonts.DefaultFontConfig.DefaultFontConfigParser;
30 29
 import org.apache.fop.fonts.FontEventAdapter;

+ 5
- 0
fop-core/src/main/java/org/apache/fop/render/java2d/Java2DRendererOption.java View File

@@ -34,4 +34,9 @@ public enum Java2DRendererOption implements RendererConfigOption {
34 34
     public String getName() {
35 35
         return name;
36 36
     }
37
+
38
+    @Override
39
+    public Object getDefaultValue() {
40
+        return null;
41
+    }
37 42
 }

+ 17
- 6
fop-core/src/main/java/org/apache/fop/render/pcl/Java2DRendererOption.java View File

@@ -25,19 +25,25 @@ import org.apache.fop.render.RendererConfigOption;
25 25
  */
26 26
 public enum Java2DRendererOption implements RendererConfigOption {
27 27
 
28
-    RENDERING_MODE("rendering", PCLRenderingMode.class),
29
-    TEXT_RENDERING("text-rendering", Boolean.class),
30
-    DISABLE_PJL("disable-pjl", Boolean.class),
31
-    OPTIMIZE_RESOURCES("optimize-resources", Boolean.class),
32
-    MODE_COLOR("color", Boolean.class);
28
+    RENDERING_MODE("rendering", PCLRenderingMode.class, PCLRenderingMode.QUALITY),
29
+    TEXT_RENDERING("text-rendering", Boolean.class, Boolean.FALSE),
30
+    DISABLE_PJL("disable-pjl", Boolean.class, Boolean.FALSE),
31
+    OPTIMIZE_RESOURCES("optimize-resources", Boolean.class, Boolean.FALSE),
32
+    MODE_COLOR("color", Boolean.class, Boolean.FALSE);
33 33
 
34 34
     private final String name;
35 35
 
36 36
     private final Class<?> type;
37 37
 
38
-    private Java2DRendererOption(String name, Class<?> type) {
38
+    private final Object defaultValue;
39
+
40
+    private Java2DRendererOption(String name, Class<?> type, Object defaultValue) {
39 41
         this.name = name;
40 42
         this.type = type;
43
+        this.defaultValue = defaultValue;
44
+        if (defaultValue != null && !(type.isAssignableFrom(defaultValue.getClass()))) {
45
+            throw new IllegalArgumentException("default value " + defaultValue + " is not of type " + type);
46
+        }
41 47
     }
42 48
 
43 49
     /** {@inheritDoc} */
@@ -48,4 +54,9 @@ public enum Java2DRendererOption implements RendererConfigOption {
48 54
     Class<?> getType() {
49 55
         return type;
50 56
     }
57
+
58
+    @Override
59
+    public Object getDefaultValue() {
60
+        return defaultValue;
61
+    }
51 62
 }

+ 1
- 2
fop-core/src/main/java/org/apache/fop/render/pcl/PCLRendererConfig.java View File

@@ -22,11 +22,10 @@ package org.apache.fop.render.pcl;
22 22
 import java.util.EnumMap;
23 23
 import java.util.Map;
24 24
 
25
-import org.apache.avalon.framework.configuration.Configuration;
26
-
27 25
 import org.apache.fop.apps.FOPException;
28 26
 import org.apache.fop.apps.FOUserAgent;
29 27
 import org.apache.fop.apps.MimeConstants;
28
+import org.apache.fop.configuration.Configuration;
30 29
 import org.apache.fop.fonts.DefaultFontConfig;
31 30
 import org.apache.fop.fonts.DefaultFontConfig.DefaultFontConfigParser;
32 31
 import org.apache.fop.fonts.FontEventAdapter;

+ 8
- 4
fop-core/src/main/java/org/apache/fop/render/pdf/PDFRendererConfig.java View File

@@ -25,15 +25,14 @@ import java.util.HashMap;
25 25
 import java.util.List;
26 26
 import java.util.Map;
27 27
 
28
-import org.apache.avalon.framework.configuration.Configuration;
29
-import org.apache.avalon.framework.configuration.ConfigurationException;
30
-
31 28
 import org.apache.commons.logging.Log;
32 29
 import org.apache.commons.logging.LogFactory;
33 30
 
34 31
 import org.apache.fop.apps.FOPException;
35 32
 import org.apache.fop.apps.FOUserAgent;
36 33
 import org.apache.fop.apps.MimeConstants;
34
+import org.apache.fop.configuration.Configuration;
35
+import org.apache.fop.configuration.ConfigurationException;
37 36
 import org.apache.fop.fonts.DefaultFontConfig;
38 37
 import org.apache.fop.fonts.DefaultFontConfig.DefaultFontConfigParser;
39 38
 import org.apache.fop.fonts.FontEventAdapter;
@@ -217,7 +216,12 @@ public final class PDFRendererConfig implements RendererConfig {
217 216
 
218 217
         private String parseConfig(Configuration cfg, RendererConfigOption option) {
219 218
             Configuration child = cfg.getChild(option.getName());
220
-            return child.getValue(null);
219
+            String value = child.getValue(null);
220
+            if (value == null || "".equals(value)) {
221
+                Object v = option.getDefaultValue();
222
+                return v == null ? null : v.toString();
223
+            }
224
+            return value;
221 225
         }
222 226
 
223 227
         private boolean doesValueExist(Configuration cfg, RendererConfigOption option) {

+ 1
- 1
fop-core/src/main/java/org/apache/fop/render/pdf/PDFSVGHandler.java View File

@@ -22,10 +22,10 @@ package org.apache.fop.render.pdf;
22 22
 import java.io.OutputStream;
23 23
 import java.util.Map;
24 24
 
25
-import org.apache.avalon.framework.configuration.Configuration;
26 25
 import org.apache.commons.logging.Log;
27 26
 import org.apache.commons.logging.LogFactory;
28 27
 
28
+import org.apache.fop.configuration.Configuration;
29 29
 import org.apache.fop.fonts.FontInfo;
30 30
 import org.apache.fop.pdf.PDFDocument;
31 31
 import org.apache.fop.pdf.PDFPage;

+ 2
- 2
fop-core/src/main/java/org/apache/fop/render/ps/PSRendererConfig.java View File

@@ -22,14 +22,14 @@ package org.apache.fop.render.ps;
22 22
 import java.util.EnumMap;
23 23
 import java.util.Locale;
24 24
 
25
-import org.apache.avalon.framework.configuration.Configuration;
26
-import org.apache.avalon.framework.configuration.ConfigurationException;
27 25
 import org.apache.commons.logging.Log;
28 26
 import org.apache.commons.logging.LogFactory;
29 27
 
30 28
 import org.apache.fop.apps.FOPException;
31 29
 import org.apache.fop.apps.FOUserAgent;
32 30
 import org.apache.fop.apps.MimeConstants;
31
+import org.apache.fop.configuration.Configuration;
32
+import org.apache.fop.configuration.ConfigurationException;
33 33
 import org.apache.fop.fonts.DefaultFontConfig;
34 34
 import org.apache.fop.fonts.DefaultFontConfig.DefaultFontConfigParser;
35 35
 import org.apache.fop.fonts.FontEventAdapter;

+ 1
- 2
fop-core/src/main/java/org/apache/fop/render/ps/PSSVGHandler.java View File

@@ -26,8 +26,6 @@ import java.util.Map;
26 26
 
27 27
 import org.w3c.dom.Document;
28 28
 
29
-import org.apache.avalon.framework.configuration.Configuration;
30
-
31 29
 import org.apache.batik.bridge.BridgeContext;
32 30
 import org.apache.batik.bridge.GVTBuilder;
33 31
 import org.apache.batik.gvt.GraphicsNode;
@@ -35,6 +33,7 @@ import org.apache.batik.gvt.GraphicsNode;
35 33
 import org.apache.xmlgraphics.java2d.ps.PSGraphics2D;
36 34
 import org.apache.xmlgraphics.ps.PSGenerator;
37 35
 
36
+import org.apache.fop.configuration.Configuration;
38 37
 import org.apache.fop.fonts.FontInfo;
39 38
 import org.apache.fop.image.loader.batik.BatikUtil;
40 39
 import org.apache.fop.render.AbstractGenericSVGHandler;

+ 1
- 2
fop-core/src/main/java/org/apache/fop/render/txt/TxtRendererConfig.java View File

@@ -21,11 +21,10 @@ package org.apache.fop.render.txt;
21 21
 
22 22
 import java.util.EnumMap;
23 23
 
24
-import org.apache.avalon.framework.configuration.Configuration;
25
-
26 24
 import org.apache.fop.apps.FOPException;
27 25
 import org.apache.fop.apps.FOUserAgent;
28 26
 import org.apache.fop.apps.MimeConstants;
27
+import org.apache.fop.configuration.Configuration;
29 28
 import org.apache.fop.fonts.DefaultFontConfig;
30 29
 import org.apache.fop.fonts.DefaultFontConfig.DefaultFontConfigParser;
31 30
 import org.apache.fop.fonts.FontEventAdapter;

+ 4
- 4
fop-core/src/main/java/org/apache/fop/svg/AbstractFOPTranscoder.java View File

@@ -28,10 +28,6 @@ import javax.xml.transform.stream.StreamSource;
28 28
 import org.w3c.dom.DOMImplementation;
29 29
 import org.xml.sax.EntityResolver;
30 30
 
31
-import org.apache.avalon.framework.configuration.Configurable;
32
-import org.apache.avalon.framework.configuration.Configuration;
33
-import org.apache.avalon.framework.configuration.ConfigurationException;
34
-import org.apache.avalon.framework.configuration.DefaultConfiguration;
35 31
 import org.apache.commons.logging.Log;
36 32
 import org.apache.commons.logging.impl.SimpleLog;
37 33
 
@@ -55,6 +51,10 @@ import org.apache.xmlgraphics.image.loader.ImageSessionContext;
55 51
 import org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext;
56 52
 import org.apache.xmlgraphics.util.UnitConv;
57 53
 
54
+import org.apache.fop.configuration.Configurable;
55
+import org.apache.fop.configuration.Configuration;
56
+import org.apache.fop.configuration.ConfigurationException;
57
+import org.apache.fop.configuration.DefaultConfiguration;
58 58
 import org.apache.fop.svg.font.FOPFontFamilyResolver;
59 59
 
60 60
 /**

+ 2
- 3
fop-core/src/main/java/org/apache/fop/svg/PDFDocumentGraphics2DConfigurator.java View File

@@ -23,12 +23,11 @@ import java.io.File;
23 23
 import java.net.URI;
24 24
 import java.util.List;
25 25
 
26
-import org.apache.avalon.framework.configuration.Configuration;
27
-import org.apache.avalon.framework.configuration.ConfigurationException;
28
-
29 26
 import org.apache.fop.apps.FOPException;
30 27
 import org.apache.fop.apps.io.InternalResourceResolver;
31 28
 import org.apache.fop.apps.io.ResourceResolverFactory;
29
+import org.apache.fop.configuration.Configuration;
30
+import org.apache.fop.configuration.ConfigurationException;
32 31
 import org.apache.fop.fonts.DefaultFontConfig;
33 32
 import org.apache.fop.fonts.DefaultFontConfigurator;
34 33
 import org.apache.fop.fonts.EmbedFontInfo;

+ 1
- 2
fop-core/src/main/java/org/apache/fop/svg/PDFTranscoder.java View File

@@ -27,8 +27,6 @@ import java.io.OutputStream;
27 27
 import org.w3c.dom.Document;
28 28
 import org.w3c.dom.svg.SVGLength;
29 29
 
30
-import org.apache.avalon.framework.configuration.Configuration;
31
-
32 30
 import org.apache.batik.bridge.BridgeContext;
33 31
 import org.apache.batik.bridge.UnitProcessor;
34 32
 import org.apache.batik.ext.awt.RenderingHintsKeyExt;
@@ -37,6 +35,7 @@ import org.apache.batik.transcoder.TranscoderOutput;
37 35
 import org.apache.batik.transcoder.image.ImageTranscoder;
38 36
 
39 37
 import org.apache.fop.Version;
38
+import org.apache.fop.configuration.Configuration;
40 39
 import org.apache.fop.fonts.FontInfo;
41 40
 import org.apache.fop.svg.font.FOPFontFamilyResolverImpl;
42 41
 

+ 2
- 3
fop-core/src/test/java/org/apache/fop/apps/AbstractRendererConfigParserTester.java View File

@@ -22,10 +22,9 @@ package org.apache.fop.apps;
22 22
 import static org.mockito.Mockito.mock;
23 23
 import static org.mockito.Mockito.when;
24 24
 
25
-import org.apache.avalon.framework.configuration.Configuration;
26
-import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
27
-
28 25
 import org.apache.fop.apps.FopConfBuilder.RendererConfBuilder;
26
+import org.apache.fop.configuration.Configuration;
27
+import org.apache.fop.configuration.DefaultConfigurationBuilder;
29 28
 import org.apache.fop.events.DefaultEventBroadcaster;
30 29
 import org.apache.fop.fonts.FontManager;
31 30
 import org.apache.fop.render.RendererConfig;

+ 1
- 2
fop-core/src/test/java/org/apache/fop/apps/AbstractRendererConfiguratorTest.java View File

@@ -27,9 +27,8 @@ import org.xml.sax.SAXException;
27 27
 import static org.mockito.Mockito.mock;
28 28
 import static org.mockito.Mockito.when;
29 29
 
30
-import org.apache.avalon.framework.configuration.ConfigurationException;
31
-
32 30
 import org.apache.fop.apps.FopConfBuilder.RendererConfBuilder;
31
+import org.apache.fop.configuration.ConfigurationException;
33 32
 import org.apache.fop.render.PrintRendererConfigurator;
34 33
 import org.apache.fop.render.intermediate.IFDocumentHandler;
35 34
 

+ 1
- 2
fop-core/src/test/java/org/apache/fop/apps/MutableConfig.java View File

@@ -21,13 +21,12 @@ import java.net.URI;
21 21
 import java.util.Map;
22 22
 import java.util.Set;
23 23
 
24
-import org.apache.avalon.framework.configuration.Configuration;
25
-
26 24
 import org.apache.xmlgraphics.image.loader.ImageManager;
27 25
 import org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext.FallbackResolver;
28 26
 import org.apache.xmlgraphics.io.ResourceResolver;
29 27
 
30 28
 import org.apache.fop.apps.io.InternalResourceResolver;
29
+import org.apache.fop.configuration.Configuration;
31 30
 import org.apache.fop.fonts.FontManager;
32 31
 import org.apache.fop.layoutmgr.LayoutManagerMaker;
33 32
 

+ 1
- 1
fop-core/src/test/java/org/apache/fop/config/BaseUserConfigTest.java View File

@@ -25,11 +25,11 @@ import java.io.InputStream;
25 25
 
26 26
 import org.xml.sax.SAXException;
27 27
 
28
-import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
29 28
 import org.apache.commons.logging.Log;
30 29
 import org.apache.commons.logging.LogFactory;
31 30
 
32 31
 import org.apache.fop.apps.FOUserAgent;
32
+import org.apache.fop.configuration.DefaultConfigurationBuilder;
33 33
 import org.apache.fop.render.pdf.BasePDFTest;
34 34
 
35 35
 import static org.apache.fop.FOPTestUtils.getBaseDir;

+ 4
- 4
fop-core/src/test/java/org/apache/fop/threading/AvalonAdapter.java View File

@@ -19,7 +19,7 @@
19 19
 
20 20
 package org.apache.fop.threading;
21 21
 
22
-import org.apache.avalon.framework.logger.Logger;
22
+import org.apache.commons.logging.Log;
23 23
 
24 24
 import org.apache.fop.events.Event;
25 25
 import org.apache.fop.events.EventFormatter;
@@ -31,10 +31,10 @@ import org.apache.fop.events.model.EventSeverity;
31 31
  */
32 32
 class AvalonAdapter implements EventListener {
33 33
 
34
-    private final Logger logger;
34
+    private final Log logger;
35 35
     private String filename;
36 36
 
37
-    public AvalonAdapter(Logger logger, String filename) {
37
+    public AvalonAdapter(Log logger, String filename) {
38 38
         this.logger = logger;
39 39
         this.filename = filename;
40 40
     }
@@ -49,7 +49,7 @@ class AvalonAdapter implements EventListener {
49 49
         } else if (severity == EventSeverity.ERROR) {
50 50
             logger.error(filename + ": "  + msg);
51 51
         } else if (severity == EventSeverity.FATAL) {
52
-            logger.fatalError(filename + ": "  + msg);
52
+            logger.fatal(filename + ": "  + msg);
53 53
         } else {
54 54
             assert false;
55 55
         }

+ 20
- 18
fop-core/src/test/java/org/apache/fop/threading/FOPTestbed.java View File

@@ -31,25 +31,27 @@ import javax.xml.transform.TransformerConfigurationException;
31 31
 import javax.xml.transform.TransformerFactory;
32 32
 import javax.xml.transform.stream.StreamSource;
33 33
 
34
-import org.apache.avalon.framework.CascadingRuntimeException;
35
-import org.apache.avalon.framework.activity.Executable;
36
-import org.apache.avalon.framework.activity.Initializable;
37
-import org.apache.avalon.framework.configuration.Configurable;
38
-import org.apache.avalon.framework.configuration.Configuration;
39
-import org.apache.avalon.framework.configuration.ConfigurationException;
40
-import org.apache.avalon.framework.container.ContainerUtil;
41
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
42 34
 import org.apache.commons.io.IOUtils;
43 35
 import org.apache.commons.io.output.CountingOutputStream;
44 36
 import org.apache.commons.io.output.NullOutputStream;
37
+import org.apache.commons.logging.Log;
38
+import org.apache.commons.logging.LogFactory;
39
+
40
+import org.apache.fop.activity.ContainerUtil;
41
+import org.apache.fop.activity.Initializable;
42
+import org.apache.fop.configuration.Configurable;
43
+import org.apache.fop.configuration.Configuration;
44
+import org.apache.fop.configuration.ConfigurationException;
45 45
 
46 46
 /**
47 47
  * Testbed for multi-threading tests. The class can run a configurable set of task a number of
48 48
  * times in a configurable number of threads to easily reproduce multi-threading issues.
49 49
  */
50
-public class FOPTestbed extends AbstractLogEnabled
50
+public class FOPTestbed
51 51
             implements Configurable, Initializable {
52 52
 
53
+    private static final Log LOG = LogFactory.getLog(FOPTestbed.class);
54
+
53 55
     private int repeat;
54 56
     private List taskList = new java.util.ArrayList();
55 57
     private int threads;
@@ -85,7 +87,7 @@ public class FOPTestbed extends AbstractLogEnabled
85 87
      * Starts the stress test.
86 88
      */
87 89
     public void doStressTest() {
88
-        getLogger().info("Starting stress test...");
90
+        LOG.info("Starting stress test...");
89 91
         long start = System.currentTimeMillis();
90 92
         this.counter = 0;
91 93
 
@@ -94,7 +96,7 @@ public class FOPTestbed extends AbstractLogEnabled
94 96
         List threadList = new java.util.LinkedList();
95 97
         for (int ti = 0; ti < this.threads; ti++) {
96 98
             TaskRunner runner = new TaskRunner();
97
-            ContainerUtil.enableLogging(runner, getLogger());
99
+            // ContainerUtil.enableLogging(runner, logger);
98 100
             Thread thread = new Thread(workerGroup, runner, "Worker- " + ti);
99 101
             threadList.add(thread);
100 102
         }
@@ -150,7 +152,7 @@ public class FOPTestbed extends AbstractLogEnabled
150 152
         }
151 153
     }
152 154
 
153
-    private class TaskRunner extends AbstractLogEnabled implements Runnable {
155
+    private class TaskRunner implements Runnable {
154 156
 
155 157
         public void run() {
156 158
             try {
@@ -158,12 +160,12 @@ public class FOPTestbed extends AbstractLogEnabled
158 160
                     for (Object aTaskList : taskList) {
159 161
                         TaskDef def = (TaskDef) aTaskList;
160 162
                         final Task task = new Task(def, counter++, foprocessor);
161
-                        ContainerUtil.enableLogging(task, getLogger());
163
+                        // ContainerUtil.enableLogging(task, logger);
162 164
                         task.execute();
163 165
                     }
164 166
                 }
165 167
             } catch (Exception e) {
166
-                getLogger().error("Thread ended with an exception", e);
168
+                LOG.error("Thread ended with an exception", e);
167 169
             }
168 170
         }
169 171
 
@@ -178,12 +180,12 @@ public class FOPTestbed extends AbstractLogEnabled
178 180
             Class clazz = Class.forName(this.fopCfg.getAttribute("class",
179 181
                     "org.apache.fop.threading.FOProcessorImpl"));
180 182
             Processor fop = (Processor)clazz.getDeclaredConstructor().newInstance();
181
-            ContainerUtil.enableLogging(fop, getLogger());
183
+            // ContainerUtil.enableLogging(fop, logger);
182 184
             ContainerUtil.configure(fop, this.fopCfg);
183 185
             ContainerUtil.initialize(fop);
184 186
             return fop;
185 187
         } catch (Exception e) {
186
-            throw new CascadingRuntimeException("Error creating FO Processor", e);
188
+            throw new RuntimeException("Error creating FO Processor", e);
187 189
         }
188 190
     }
189 191
 
@@ -243,7 +245,7 @@ public class FOPTestbed extends AbstractLogEnabled
243 245
     }
244 246
 
245 247
 
246
-    private class Task extends AbstractLogEnabled implements Executable {
248
+    private class Task {
247 249
 
248 250
         private TaskDef def;
249 251
         private int num;
@@ -257,7 +259,7 @@ public class FOPTestbed extends AbstractLogEnabled
257 259
 
258 260
 
259 261
         public void execute() throws Exception {
260
-            getLogger().info("Processing: " + def);
262
+            LOG.info("Processing: " + def);
261 263
             long start = System.currentTimeMillis();
262 264
             try {
263 265
                 DecimalFormat df = new DecimalFormat("00000");

+ 12
- 8
fop-core/src/test/java/org/apache/fop/threading/FOProcessorImpl.java View File

@@ -36,25 +36,29 @@ import javax.xml.transform.sax.SAXResult;
36 36
 
37 37
 import org.xml.sax.SAXException;
38 38
 
39
-import org.apache.avalon.framework.activity.Initializable;
40
-import org.apache.avalon.framework.configuration.Configurable;
41
-import org.apache.avalon.framework.configuration.Configuration;
42
-import org.apache.avalon.framework.configuration.ConfigurationException;
43
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
44 39
 import org.apache.commons.io.FilenameUtils;
45 40
 
41
+import org.apache.commons.logging.Log;
42
+import org.apache.commons.logging.LogFactory;
43
+
44
+import org.apache.fop.activity.Initializable;
46 45
 import org.apache.fop.apps.FOPException;
47 46
 import org.apache.fop.apps.FOUserAgent;
48 47
 import org.apache.fop.apps.Fop;
49 48
 import org.apache.fop.apps.FopFactory;
50 49
 import org.apache.fop.apps.MimeConstants;
50
+import org.apache.fop.configuration.Configurable;
51
+import org.apache.fop.configuration.Configuration;
52
+import org.apache.fop.configuration.ConfigurationException;
51 53
 
52 54
 /**
53 55
  * Default implementation of the {@link Processor} interface using FOP.
54 56
  */
55
-public class FOProcessorImpl extends AbstractLogEnabled
57
+public class FOProcessorImpl
56 58
             implements Processor, Configurable, Initializable {
57 59
 
60
+    private static final Log LOG = LogFactory.getLog(FOProcessorImpl.class);
61
+
58 62
     private FopFactory fopFactory;
59 63
     private TransformerFactory factory = TransformerFactory.newInstance();
60 64
     private URI userconfig;
@@ -74,7 +78,7 @@ public class FOProcessorImpl extends AbstractLogEnabled
74 78
 
75 79
     public void initialize() throws Exception {
76 80
         if (this.userconfig != null) {
77
-            getLogger().debug("Setting user config: " + userconfig);
81
+            LOG.debug("Setting user config: " + userconfig);
78 82
             fopFactory = FopFactory.newInstance(new File(userconfig));
79 83
         } else {
80 84
             fopFactory = FopFactory.newInstance(new File(".").toURI());
@@ -92,7 +96,7 @@ public class FOProcessorImpl extends AbstractLogEnabled
92 96
             URL url = new URL(src.getSystemId());
93 97
             String filename = FilenameUtils.getName(url.getPath());
94 98
             foUserAgent.getEventBroadcaster().addEventListener(
95
-                    new AvalonAdapter(getLogger(), filename));
99
+                    new AvalonAdapter(LOG, filename));
96 100
         } catch (MalformedURLException mfue) {
97 101
             throw new RuntimeException(mfue);
98 102
         }

+ 13
- 8
fop-core/src/test/java/org/apache/fop/threading/IFProcessorImpl.java View File

@@ -35,17 +35,19 @@ import javax.xml.transform.stream.StreamResult;
35 35
 
36 36
 import org.xml.sax.ContentHandler;
37 37
 
38
-import org.apache.avalon.framework.activity.Initializable;
39
-import org.apache.avalon.framework.configuration.Configurable;
40
-import org.apache.avalon.framework.configuration.Configuration;
41
-import org.apache.avalon.framework.configuration.ConfigurationException;
42
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
43 38
 import org.apache.commons.io.FilenameUtils;
44 39
 
40
+import org.apache.commons.logging.Log;
41
+import org.apache.commons.logging.LogFactory;
42
+
43
+import org.apache.fop.activity.Initializable;
45 44
 import org.apache.fop.apps.FOPException;
46 45
 import org.apache.fop.apps.FOUserAgent;
47 46
 import org.apache.fop.apps.FopFactory;
48 47
 import org.apache.fop.apps.MimeConstants;
48
+import org.apache.fop.configuration.Configurable;
49
+import org.apache.fop.configuration.Configuration;
50
+import org.apache.fop.configuration.ConfigurationException;
49 51
 import org.apache.fop.render.intermediate.IFDocumentHandler;
50 52
 import org.apache.fop.render.intermediate.IFException;
51 53
 import org.apache.fop.render.intermediate.IFParser;
@@ -54,9 +56,12 @@ import org.apache.fop.render.intermediate.IFUtil;
54 56
 /**
55 57
  * Implementation of the {@link Processor} interface that renders IF XML to a final output format.
56 58
  */
57
-public class IFProcessorImpl extends AbstractLogEnabled
59
+public class IFProcessorImpl
58 60
             implements Processor, Configurable, Initializable {
59 61
 
62
+    private static final Log LOGGER = LogFactory.getLog(IFProcessorImpl.class);
63
+
64
+
60 65
     private FopFactory fopFactory;
61 66
     private TransformerFactory factory = TransformerFactory.newInstance();
62 67
     private String userconfig;
@@ -73,7 +78,7 @@ public class IFProcessorImpl extends AbstractLogEnabled
73 78
     /** {@inheritDoc} */
74 79
     public void initialize() throws Exception {
75 80
         if (this.userconfig != null) {
76
-            getLogger().debug("Setting user config: " + userconfig);
81
+            LOGGER.debug("Setting user config: " + userconfig);
77 82
             fopFactory = FopFactory.newInstance(new File(this.userconfig));
78 83
         } else {
79 84
             fopFactory = FopFactory.newInstance(new File(".").toURI());
@@ -89,7 +94,7 @@ public class IFProcessorImpl extends AbstractLogEnabled
89 94
             URL url = new URL(src.getSystemId());
90 95
             String filename = FilenameUtils.getName(url.getPath());
91 96
             foUserAgent.getEventBroadcaster().addEventListener(
92
-                    new AvalonAdapter(getLogger(), filename));
97
+                    new AvalonAdapter(LOGGER, filename));
93 98
         } catch (MalformedURLException mfue) {
94 99
             throw new RuntimeException(mfue);
95 100
         }

+ 6
- 7
fop-core/src/test/java/org/apache/fop/threading/Main.java View File

@@ -23,11 +23,9 @@ import java.io.BufferedReader;
23 23
 import java.io.File;
24 24
 import java.io.IOException;
25 25
 
26
-import org.apache.avalon.framework.ExceptionUtil;
27
-import org.apache.avalon.framework.configuration.Configuration;
28
-import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
29
-import org.apache.avalon.framework.container.ContainerUtil;
30
-import org.apache.avalon.framework.logger.ConsoleLogger;
26
+import org.apache.fop.activity.ContainerUtil;
27
+import org.apache.fop.configuration.Configuration;
28
+import org.apache.fop.configuration.DefaultConfigurationBuilder;
31 29
 
32 30
 /**
33 31
  * Starter class for the multi-threading testbed.
@@ -61,7 +59,7 @@ public final class Main {
61 59
 
62 60
             //Setup testbed
63 61
             FOPTestbed testbed = new FOPTestbed();
64
-            ContainerUtil.enableLogging(testbed, new ConsoleLogger(ConsoleLogger.LEVEL_INFO));
62
+            // ContainerUtil.enableLogging(testbed, new ConsoleLogger(ConsoleLogger.LEVEL_INFO));
65 63
             ContainerUtil.configure(testbed, cfg);
66 64
             ContainerUtil.initialize(testbed);
67 65
 
@@ -70,7 +68,8 @@ public final class Main {
70 68
 
71 69
             System.exit(0);
72 70
         } catch (Exception e) {
73
-            System.err.println(ExceptionUtil.printStackTrace(e));
71
+            // System.err.println(ExceptionUtil.printStackTrace(e));
72
+            e.printStackTrace(System.err);
74 73
             System.exit(-1);
75 74
         }
76 75
     }

+ 4
- 1
fop-core/src/test/java/org/apache/fop/threading/Processor.java View File

@@ -24,10 +24,13 @@ import java.io.OutputStream;
24 24
 import javax.xml.transform.Source;
25 25
 import javax.xml.transform.Templates;
26 26
 
27
+import org.apache.fop.activity.Initializable;
28
+import org.apache.fop.configuration.Configurable;
29
+
27 30
 /**
28 31
  * Represents a processor.
29 32
  */
30
-public interface Processor {
33
+public interface Processor extends Configurable, Initializable {
31 34
 
32 35
     /**
33 36
      * Process a file.

+ 3
- 3
fop-core/src/test/java/org/apache/fop/visual/AbstractPSPDFBitmapProducer.java View File

@@ -32,14 +32,14 @@ import javax.xml.transform.Transformer;
32 32
 import javax.xml.transform.sax.SAXResult;
33 33
 import javax.xml.transform.stream.StreamSource;
34 34
 
35
-import org.apache.avalon.framework.configuration.Configurable;
36
-import org.apache.avalon.framework.configuration.Configuration;
37
-import org.apache.avalon.framework.configuration.ConfigurationException;
38 35
 import org.apache.commons.io.IOUtils;
39 36
 
40 37
 import org.apache.fop.apps.FOUserAgent;
41 38
 import org.apache.fop.apps.Fop;
42 39
 import org.apache.fop.apps.FopFactory;
40
+import org.apache.fop.configuration.Configurable;
41
+import org.apache.fop.configuration.Configuration;
42
+import org.apache.fop.configuration.ConfigurationException;
43 43
 import org.apache.fop.util.DefaultErrorListener;
44 44
 
45 45
 /**

+ 4
- 4
fop-core/src/test/java/org/apache/fop/visual/BatchDiffer.java View File

@@ -30,10 +30,6 @@ import javax.xml.transform.stream.StreamSource;
30 30
 
31 31
 import org.xml.sax.SAXException;
32 32
 
33
-import org.apache.avalon.framework.configuration.Configuration;
34
-import org.apache.avalon.framework.configuration.ConfigurationException;
35
-import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
36
-import org.apache.avalon.framework.container.ContainerUtil;
37 33
 import org.apache.commons.io.FileUtils;
38 34
 import org.apache.commons.io.filefilter.AndFileFilter;
39 35
 import org.apache.commons.io.filefilter.IOFileFilter;
@@ -44,6 +40,10 @@ import org.apache.commons.logging.LogFactory;
44 40
 
45 41
 import org.apache.xmlgraphics.image.writer.ImageWriterUtil;
46 42
 
43
+import org.apache.fop.activity.ContainerUtil;
44
+import org.apache.fop.configuration.Configuration;
45
+import org.apache.fop.configuration.ConfigurationException;
46
+import org.apache.fop.configuration.DefaultConfigurationBuilder;
47 47
 import org.apache.fop.layoutengine.LayoutEngineTestUtils;
48 48
 
49 49
 /**

+ 3
- 1
fop-core/src/test/java/org/apache/fop/visual/BitmapProducer.java View File

@@ -22,10 +22,12 @@ package org.apache.fop.visual;
22 22
 import java.awt.image.BufferedImage;
23 23
 import java.io.File;
24 24
 
25
+import org.apache.fop.configuration.Configurable;
26
+
25 27
 /**
26 28
  * Interface for a converter.
27 29
  */
28
-public interface BitmapProducer {
30
+public interface BitmapProducer extends Configurable {
29 31
 
30 32
     /**
31 33
      * Produces a BufferedImage from the source file by invoking the FO processor and

+ 3
- 3
fop-core/src/test/java/org/apache/fop/visual/BitmapProducerJava2D.java View File

@@ -30,15 +30,15 @@ import javax.xml.transform.Transformer;
30 30
 import javax.xml.transform.sax.SAXResult;
31 31
 import javax.xml.transform.stream.StreamSource;
32 32
 
33
-import org.apache.avalon.framework.configuration.Configurable;
34
-import org.apache.avalon.framework.configuration.Configuration;
35
-import org.apache.avalon.framework.configuration.ConfigurationException;
36 33
 import org.apache.commons.io.IOUtils;
37 34
 
38 35
 import org.apache.fop.apps.FOUserAgent;
39 36
 import org.apache.fop.apps.Fop;
40 37
 import org.apache.fop.apps.FopFactory;
41 38
 import org.apache.fop.apps.MimeConstants;
39
+import org.apache.fop.configuration.Configurable;
40
+import org.apache.fop.configuration.Configuration;
41
+import org.apache.fop.configuration.ConfigurationException;
42 42
 import org.apache.fop.util.DefaultErrorListener;
43 43
 
44 44
 /**

+ 3
- 4
fop-core/src/test/java/org/apache/fop/visual/ReferenceBitmapLoader.java View File

@@ -23,9 +23,9 @@ import java.awt.image.BufferedImage;
23 23
 import java.io.File;
24 24
 import java.net.URI;
25 25
 
26
-import org.apache.avalon.framework.configuration.Configurable;
27
-import org.apache.avalon.framework.configuration.Configuration;
28
-import org.apache.avalon.framework.configuration.ConfigurationException;
26
+import org.apache.fop.configuration.Configurable;
27
+import org.apache.fop.configuration.Configuration;
28
+import org.apache.fop.configuration.ConfigurationException;
29 29
 
30 30
 /**
31 31
  * BitmapProducer implementation that simply loads preproduced reference bitmaps from a
@@ -47,7 +47,6 @@ public class ReferenceBitmapLoader extends AbstractBitmapProducer implements Con
47 47
         super(baseUri);
48 48
     }
49 49
 
50
-    /** @see org.apache.avalon.framework.configuration.Configurable */
51 50
     public void configure(Configuration cfg) throws ConfigurationException {
52 51
         this.bitmapDirectory = new File(cfg.getChild("directory").getValue(null));
53 52
         if (!bitmapDirectory.exists()) {

+ 0
- 12
fop-servlet/pom.xml View File

@@ -44,16 +44,6 @@
44 44
       <artifactId>commons-logging</artifactId>
45 45
       <version>${commons.logging.version}</version>
46 46
     </dependency>
47
-    <dependency>
48
-      <groupId>org.apache.avalon.framework</groupId>
49
-      <artifactId>avalon-framework-api</artifactId>
50
-      <version>${avalon.version}</version>
51
-    </dependency>
52
-    <dependency>
53
-      <groupId>org.apache.avalon.framework</groupId>
54
-      <artifactId>avalon-framework-impl</artifactId>
55
-      <version>${avalon.version}</version>
56
-    </dependency>
57 47
   </dependencies>
58 48
 
59 49
   <build>
@@ -63,8 +53,6 @@
63 53
         <version>${war.plugin.version}</version>
64 54
         <configuration>
65 55
           <packagingIncludes>
66
-            WEB-INF/lib/avalon-framework-api-${avalon.version}.jar,
67
-            WEB-INF/lib/avalon-framework-impl-${avalon.version}.jar,
68 56
             WEB-INF/lib/batik-all-*.jar,
69 57
             WEB-INF/lib/commons-io-${commons.io.version}.jar,
70 58
             WEB-INF/lib/commons-logging-${commons.logging.version}.jar,

+ 0
- 11
fop-transcoder-allinone/pom.xml View File

@@ -42,17 +42,6 @@
42 42
       <version>${commons.logging.version}</version>
43 43
     </dependency>
44 44
     <dependency>
45
-      <groupId>org.apache.avalon.framework</groupId>
46
-      <artifactId>avalon-framework-api</artifactId>
47
-      <version>${avalon.version}</version>
48
-    </dependency>
49
-    <dependency>
50
-      <groupId>org.apache.avalon.framework</groupId>
51
-      <artifactId>avalon-framework-impl</artifactId>
52
-      <version>${avalon.version}</version>
53
-    </dependency>
54
-    <!-- test deps -->
55
-    <dependency>
56 45
       <groupId>junit</groupId>
57 46
       <artifactId>junit</artifactId>
58 47
       <version>${junit.version}</version>

+ 0
- 4
fop-transcoder-allinone/src/tools/resources/assembly/assembly.xml View File

@@ -22,10 +22,6 @@
22 22
       <unpack>true</unpack>
23 23
       <unpackOptions>
24 24
         <includes>
25
-          <include>org/apache/avalon/framework/*</include>
26
-          <include>org/apache/avalon/framework/activity/*</include>
27
-          <include>org/apache/avalon/framework/configuration/*</include>
28
-          <include>org/apache/avalon/framework/container/*</include>
29 25
           <include>org/apache/commons/io/*.class</include>
30 26
           <include>org/apache/commons/io/filefilter/*.class</include>
31 27
           <include>org/apache/commons/io/output/*.class</include>

+ 1
- 8
fop/build.xml View File

@@ -73,7 +73,6 @@ list of possible build targets.
73 73
   <fileset dir="${basedir}/.." id="dist.bin.lib">
74 74
     <patternset id="dist.lib">
75 75
       <include name="fop/lib/README*"/>
76
-      <include name="fop/lib/avalon-framework*"/>
77 76
       <include name="fop/lib/batik*"/>
78 77
       <include name="fop/lib/commons-io*"/>
79 78
       <include name="fop/lib/commons-logging*"/>
@@ -597,7 +596,6 @@ list of possible build targets.
597 596
     <echo message="Creating the WAR file"/>
598 597
     <war warfile="${build.dir}/fop.war" webxml="${servlet.src.dir}/main/webapp/WEB-INF/web.xml">
599 598
       <lib dir="${lib.dir}">
600
-        <include name="avalon-framework*.jar"/>
601 599
         <include name="commons-logging*.jar"/>
602 600
         <include name="batik*.jar"/>
603 601
         <include name="commons-io*.jar"/>
@@ -642,6 +640,7 @@ list of possible build targets.
642 640
       <include name="org/apache/fop/util/DecimalFormatCache*.class"/>
643 641
       <include name="org/apache/fop/util/ImageObject.class"/>
644 642
       <include name="org/apache/fop/util/HexEncoder.class"/>
643
+      <include name="org/apache/fop/configuration/**"/>
645 644
     </patternset>
646 645
 <!-- PDF transcoder -->
647 646
     <patternset>
@@ -665,7 +664,6 @@ list of possible build targets.
665 664
   </fileset>
666 665
   <fileset dir="${lib.dir}" id="transcoder-lib-files">
667 666
     <include name="commons-io*.jar"/>
668
-    <include name="avalon-framework*.jar"/>
669 667
     <include name="commons-logging*.jar"/>
670 668
     <include name="xmlgraphics-commons*.jar"/>
671 669
   </fileset>
@@ -698,10 +696,6 @@ list of possible build targets.
698 696
     <mkdir dir="${transcoder-deps}"/>
699 697
     <unjar dest="${transcoder-deps}">
700 698
       <patternset>
701
-        <include name="org/apache/avalon/framework/*"/>
702
-        <include name="org/apache/avalon/framework/activity/*"/>
703
-        <include name="org/apache/avalon/framework/configuration/*"/>
704
-        <include name="org/apache/avalon/framework/container/*"/>
705 699
         <include name="org/apache/commons/logging/**"/>
706 700
         <include name="org/apache/commons/io/*.class"/>
707 701
         <include name="org/apache/commons/io/filefilter/*.class"/>
@@ -712,7 +706,6 @@ list of possible build targets.
712 706
     <mkdir dir="${transcoder-deps}/legal"/>
713 707
     <copy todir="${transcoder-deps}/legal">
714 708
       <fileset dir="${lib.dir}">
715
-        <include name="avalon.LICENSE.txt"/>
716 709
         <include name="commons-io.LICENSE.txt"/>
717 710
         <include name="commons-logging.LICENSE.txt"/>
718 711
       </fileset>

+ 0
- 1
fop/examples/embedding/build.xml View File

@@ -33,7 +33,6 @@
33 33
 	<!-- stuff -->
34 34
 	<path id="project.class.path">
35 35
      <fileset dir="${fop.lib.dir}">
36
-        <include name="avalon-framework*.jar"/>
37 36
         <include name="batik*.jar"/>
38 37
         <include name="xml-apis*.jar"/>
39 38
         <include name="xerces*.jar"/>

+ 1
- 3
fop/examples/embedding/java/embedding/ExampleAWTViewer.java View File

@@ -31,8 +31,6 @@ import javax.xml.transform.TransformerFactory;
31 31
 import javax.xml.transform.sax.SAXResult;
32 32
 import javax.xml.transform.stream.StreamSource;
33 33
 
34
-import org.apache.avalon.framework.ExceptionUtil;
35
-
36 34
 import org.apache.fop.apps.FOPException;
37 35
 import org.apache.fop.apps.Fop;
38 36
 import org.apache.fop.apps.FopFactory;
@@ -103,7 +101,7 @@ public class ExampleAWTViewer {
103 101
 
104 102
             System.out.println("Success!");
105 103
         } catch (Exception e) {
106
-            System.err.println(ExceptionUtil.printStackTrace(e));
104
+//            System.err.println(ExceptionUtil.printStackTrace(e));
107 105
             System.exit(-1);
108 106
         }
109 107
     }

+ 4
- 4
fop/examples/embedding/java/embedding/ExampleEPS.java View File

@@ -21,12 +21,12 @@
21 21
 package embedding;
22 22
 
23 23
 import java.awt.Font;
24
+import java.io.File;
24 25
 import java.io.FileOutputStream;
25 26
 import java.io.OutputStream;
26 27
 
27
-import org.apache.avalon.framework.configuration.Configuration;
28
-import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
29
-
28
+import org.apache.fop.configuration.Configuration;
29
+import org.apache.fop.configuration.DefaultConfigurationBuilder;
30 30
 import org.apache.xmlgraphics.java2d.GraphicContext;
31 31
 import org.apache.xmlgraphics.java2d.ps.EPSDocumentGraphics2D;
32 32
 
@@ -43,7 +43,7 @@ public class ExampleEPS {
43 43
     try {
44 44
       String configFile = "examples/fop-eps.xconf";
45 45
       DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder();
46
-      Configuration c = cfgBuilder.buildFromFile(configFile);
46
+      Configuration c = cfgBuilder.buildFromFile(new File(configFile));
47 47
 
48 48
       FontInfo fontInfo = PDFDocumentGraphics2DConfigurator.createFontInfo(c, false);
49 49
 

+ 3
- 3
fop/examples/embedding/java/embedding/ExampleJava2D2PDF.java View File

@@ -30,13 +30,13 @@ import java.io.StringReader;
30 30
 
31 31
 import javax.swing.JEditorPane;
32 32
 
33
-import org.apache.avalon.framework.configuration.Configuration;
34
-import org.apache.avalon.framework.configuration.ConfigurationException;
35
-import org.apache.avalon.framework.configuration.DefaultConfiguration;
36 33
 import org.apache.commons.io.IOUtils;
37 34
 
38 35
 import org.apache.xmlgraphics.util.UnitConv;
39 36
 
37
+import org.apache.fop.configuration.Configuration;
38
+import org.apache.fop.configuration.ConfigurationException;
39
+import org.apache.fop.configuration.DefaultConfiguration;
40 40
 import org.apache.fop.svg.PDFDocumentGraphics2D;
41 41
 import org.apache.fop.svg.PDFDocumentGraphics2DConfigurator;
42 42
 

+ 0
- 8
fop/lib/README.txt View File

@@ -27,14 +27,6 @@ Normal Dependencies
27 27
     
28 28
     Apache License v2.0
29 29
 
30
-- Apache Avalon Framework
31
-
32
-    avalon-framework-*.jar
33
-    http://excalibur.apache.org/framework/
34
-    (Avalon Framework, maintained by the Apache Excalibur project)
35
-    
36
-    Apache License v2.0
37
-
38 30
 - Apache XML Graphics Commons
39 31
 
40 32
     xmlgraphics-commons-*.jar

BIN
fop/lib/avalon-framework-api-4.3.1.jar View File


BIN
fop/lib/avalon-framework-impl-4.3.1.jar View File


+ 0
- 175
fop/lib/avalon-framework.LICENSE.txt View File

@@ -1,175 +0,0 @@
1
-
2
-                                 Apache License
3
-                           Version 2.0, January 2004
4
-                        http://www.apache.org/licenses/
5
-
6
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
-   1. Definitions.
9
-
10
-      "License" shall mean the terms and conditions for use, reproduction,
11
-      and distribution as defined by Sections 1 through 9 of this document.
12
-
13
-      "Licensor" shall mean the copyright owner or entity authorized by
14
-      the copyright owner that is granting the License.
15
-
16
-      "Legal Entity" shall mean the union of the acting entity and all
17
-      other entities that control, are controlled by, or are under common
18
-      control with that entity. For the purposes of this definition,
19
-      "control" means (i) the power, direct or indirect, to cause the
20
-      direction or management of such entity, whether by contract or
21
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
-      outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
-      "You" (or "Your") shall mean an individual or Legal Entity
25
-      exercising permissions granted by this License.
26
-
27
-      "Source" form shall mean the preferred form for making modifications,
28
-      including but not limited to software source code, documentation
29
-      source, and configuration files.
30
-
31
-      "Object" form shall mean any form resulting from mechanical
32
-      transformation or translation of a Source form, including but
33
-      not limited to compiled object code, generated documentation,
34
-      and conversions to other media types.
35
-
36
-      "Work" shall mean the work of authorship, whether in Source or
37
-      Object form, made available under the License, as indicated by a
38
-      copyright notice that is included in or attached to the work
39
-      (an example is provided in the Appendix below).
40
-
41
-      "Derivative Works" shall mean any work, whether in Source or Object
42
-      form, that is based on (or derived from) the Work and for which the
43
-      editorial revisions, annotations, elaborations, or other modifications
44
-      represent, as a whole, an original work of authorship. For the purposes
45
-      of this License, Derivative Works shall not include works that remain
46
-      separable from, or merely link (or bind by name) to the interfaces of,
47
-      the Work and Derivative Works thereof.
48
-
49
-      "Contribution" shall mean any work of authorship, including
50
-      the original version of the Work and any modifications or additions
51
-      to that Work or Derivative Works thereof, that is intentionally
52
-      submitted to Licensor for inclusion in the Work by the copyright owner
53
-      or by an individual or Legal Entity authorized to submit on behalf of
54
-      the copyright owner. For the purposes of this definition, "submitted"
55
-      means any form of electronic, verbal, or written communication sent
56
-      to the Licensor or its representatives, including but not limited to
57
-      communication on electronic mailing lists, source code control systems,
58
-      and issue tracking systems that are managed by, or on behalf of, the
59
-      Licensor for the purpose of discussing and improving the Work, but
60
-      excluding communication that is conspicuously marked or otherwise
61
-      designated in writing by the copyright owner as "Not a Contribution."
62
-
63
-      "Contributor" shall mean Licensor and any individual or Legal Entity
64
-      on behalf of whom a Contribution has been received by Licensor and
65
-      subsequently incorporated within the Work.
66
-
67
-   2. Grant of Copyright License. Subject to the terms and conditions of
68
-      this License, each Contributor hereby grants to You a perpetual,
69
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
-      copyright license to reproduce, prepare Derivative Works of,
71
-      publicly display, publicly perform, sublicense, and distribute the
72
-      Work and such Derivative Works in Source or Object form.
73
-
74
-   3. Grant of Patent License. Subject to the terms and conditions of
75
-      this License, each Contributor hereby grants to You a perpetual,
76
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
-      (except as stated in this section) patent license to make, have made,
78
-      use, offer to sell, sell, import, and otherwise transfer the Work,
79
-      where such license applies only to those patent claims licensable
80
-      by such Contributor that are necessarily infringed by their
81
-      Contribution(s) alone or by combination of their Contribution(s)
82
-      with the Work to which such Contribution(s) was submitted. If You
83
-      institute patent litigation against any entity (including a
84
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
85
-      or a Contribution incorporated within the Work constitutes direct
86
-      or contributory patent infringement, then any patent licenses
87
-      granted to You under this License for that Work shall terminate
88
-      as of the date such litigation is filed.
89
-
90
-   4. Redistribution. You may reproduce and distribute copies of the
91
-      Work or Derivative Works thereof in any medium, with or without
92
-      modifications, and in Source or Object form, provided that You
93
-      meet the following conditions:
94
-
95
-      (a) You must give any other recipients of the Work or
96
-          Derivative Works a copy of this License; and
97
-
98
-      (b) You must cause any modified files to carry prominent notices
99
-          stating that You changed the files; and
100
-
101
-      (c) You must retain, in the Source form of any Derivative Works
102
-          that You distribute, all copyright, patent, trademark, and
103
-          attribution notices from the Source form of the Work,
104
-          excluding those notices that do not pertain to any part of
105
-          the Derivative Works; and
106
-
107
-      (d) If the Work includes a "NOTICE" text file as part of its
108
-          distribution, then any Derivative Works that You distribute must
109
-          include a readable copy of the attribution notices contained
110
-          within such NOTICE file, excluding those notices that do not
111
-          pertain to any part of the Derivative Works, in at least one
112
-          of the following places: within a NOTICE text file distributed
113
-          as part of the Derivative Works; within the Source form or
114
-          documentation, if provided along with the Derivative Works; or,
115
-          within a display generated by the Derivative Works, if and
116
-          wherever such third-party notices normally appear. The contents
117
-          of the NOTICE file are for informational purposes only and
118
-          do not modify the License. You may add Your own attribution
119
-          notices within Derivative Works that You distribute, alongside
120
-          or as an addendum to the NOTICE text from the Work, provided
121
-          that such additional attribution notices cannot be construed
122
-          as modifying the License.
123
-
124
-      You may add Your own copyright statement to Your modifications and
125
-      may provide additional or different license terms and conditions
126
-      for use, reproduction, or distribution of Your modifications, or
127
-      for any such Derivative Works as a whole, provided Your use,
128
-      reproduction, and distribution of the Work otherwise complies with
129
-      the conditions stated in this License.
130
-
131
-   5. Submission of Contributions. Unless You explicitly state otherwise,
132
-      any Contribution intentionally submitted for inclusion in the Work
133
-      by You to the Licensor shall be under the terms and conditions of
134
-      this License, without any additional terms or conditions.
135
-      Notwithstanding the above, nothing herein shall supersede or modify
136
-      the terms of any separate license agreement you may have executed
137
-      with Licensor regarding such Contributions.
138
-
139
-   6. Trademarks. This License does not grant permission to use the trade
140
-      names, trademarks, service marks, or product names of the Licensor,
141
-      except as required for reasonable and customary use in describing the
142
-      origin of the Work and reproducing the content of the NOTICE file.
143
-
144
-   7. Disclaimer of Warranty. Unless required by applicable law or
145
-      agreed to in writing, Licensor provides the Work (and each
146
-      Contributor provides its Contributions) on an "AS IS" BASIS,
147
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
-      implied, including, without limitation, any warranties or conditions
149
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
-      PARTICULAR PURPOSE. You are solely responsible for determining the
151
-      appropriateness of using or redistributing the Work and assume any
152
-      risks associated with Your exercise of permissions under this License.
153
-
154
-   8. Limitation of Liability. In no event and under no legal theory,
155
-      whether in tort (including negligence), contract, or otherwise,
156
-      unless required by applicable law (such as deliberate and grossly
157
-      negligent acts) or agreed to in writing, shall any Contributor be
158
-      liable to You for damages, including any direct, indirect, special,
159
-      incidental, or consequential damages of any character arising as a
160
-      result of this License or out of the use or inability to use the
161
-      Work (including but not limited to damages for loss of goodwill,
162
-      work stoppage, computer failure or malfunction, or any and all
163
-      other commercial damages or losses), even if such Contributor
164
-      has been advised of the possibility of such damages.
165
-
166
-   9. Accepting Warranty or Additional Liability. While redistributing
167
-      the Work or Derivative Works thereof, You may choose to offer,
168
-      and charge a fee for, acceptance of support, warranty, indemnity,
169
-      or other liability obligations and/or rights consistent with this
170
-      License. However, in accepting such obligations, You may act only
171
-      on Your own behalf and on Your sole responsibility, not on behalf
172
-      of any other Contributor, and only if You agree to indemnify,
173
-      defend, and hold each Contributor harmless for any liability
174
-      incurred by, or claims asserted against, such Contributor by reason
175
-      of your accepting any such warranty or additional liability.

+ 0
- 11
fop/lib/avalon-framework.NOTICE.TXT View File

@@ -1,11 +0,0 @@
1
-   =========================================================================
2
-   ==  NOTICE file corresponding to the section 4 d of                    ==
3
-   ==  the Apache License, Version 2.0,                                   ==
4
-   =========================================================================
5
-
6
-   This product is developed by the Apache Avalon Project.
7
-   http://avalon.apache.org
8
-
9
-   The names "Avalon" and "Merlin" must not be used to endorse or promote 
10
-   products derived from this software without prior written permission. 
11
-   For written permission, please contact pmc@avalon.apache.org.

+ 0
- 1
pom.xml View File

@@ -12,7 +12,6 @@
12 12
 
13 13
   <properties>
14 14
     <antrun.plugin.version>1.8</antrun.plugin.version>
15
-    <avalon.version>4.3.1</avalon.version>
16 15
     <batik.version>1.11.0-SNAPSHOT</batik.version>
17 16
     <build.helper.plugin.version>1.9.1</build.helper.plugin.version>
18 17
     <checkstyle.plugin.version>2.14</checkstyle.plugin.version>

Loading…
Cancel
Save