From 2b27f33d92db172a1a4d4e741cc1a6c2b5b347fb Mon Sep 17 00:00:00 2001 From: Peter Bernard West Date: Sun, 14 Mar 2004 03:12:36 +0000 Subject: [PATCH] Fixes to options hierarchy 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 | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/java/org/apache/fop/apps/Fop.java b/src/java/org/apache/fop/apps/Fop.java index 6773532e0..93b58bf83 100644 --- a/src/java/org/apache/fop/apps/Fop.java +++ b/src/java/org/apache/fop/apps/Fop.java @@ -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(); -- 2.39.5