]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Fixes to options hierarchy
authorPeter Bernard West <pbwest@apache.org>
Sun, 14 Mar 2004 03:12:36 +0000 (03:12 +0000)
committerPeter Bernard West <pbwest@apache.org>
Sun, 14 Mar 2004 03:12:36 +0000 (03:12 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197447 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/apps/Fop.java

index 6773532e07f9bdba866055c4149e4fb5db908b46..93b58bf83530ef7e2ec3427437210b02dac1f2cb 100644 (file)
@@ -21,6 +21,7 @@
 package org.apache.fop.apps;
 
 //import java.util.logging.Handler;
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Enumeration;
@@ -28,9 +29,11 @@ import java.util.Properties;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import org.apache.fop.configuration.*;
+import org.apache.fop.configuration.CLI_Options;
 import org.apache.fop.configuration.ConfigurationResource;
 import org.apache.fop.configuration.Configuration;
+import org.apache.fop.configuration.SystemOptions;
+import org.apache.fop.configuration.UserOptions;
 
 public class Fop {
 
@@ -111,6 +114,8 @@ public class Fop {
         logger.setLevel(Level.WARNING);
         Driver driver;
         SystemOptions options = null;
+        UserOptions userOptions = null;
+        CLI_Options cliOptions = null;
         Boolean bool = null;
 
         runtime = Runtime.getRuntime();
@@ -121,9 +126,21 @@ public class Fop {
         try {
             configuration = new Configuration();
             if (args == null) {
-                options = new UserOptions(configuration);
+                userOptions = new UserOptions(configuration);
+                options = userOptions;
+                try {
+                    userOptions.configure();
+                } catch (FileNotFoundException e2) {
+                    throw new FOPException(e2);
+                }
             } else {
-                options = new CLI_Options(configuration, args);
+                cliOptions = new CLI_Options(configuration, args);
+                options = cliOptions;
+                try {
+                    cliOptions.configure(args);
+                } catch (FileNotFoundException e2) {
+                    throw new FOPException(e2);
+                }
             }
             driver = new Driver(configuration, options);
             driver.run();