You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ar...@apache.org on 2001/02/21 02:09:17 UTC
cvs commit: xml-fop/src/org/apache/fop/configuration Configuration.java
arved 01/02/20 17:09:17
Modified: src/org/apache/fop/configuration Configuration.java
Log:
Updated command line support
Revision Changes Path
1.3 +16 -15 xml-fop/src/org/apache/fop/configuration/Configuration.java
Index: Configuration.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/configuration/Configuration.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Configuration.java 2000/12/17 22:18:11 1.2
+++ Configuration.java 2001/02/21 01:09:16 1.3
@@ -1,3 +1,9 @@
+/*
+ * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
+ * For details on use and redistribution please refer to the
+ * LICENSE file included with these sources."
+ */
+
package org.apache.fop.configuration;
@@ -97,23 +103,18 @@
* convenience methods to access boolean values in the configuration
* @param key a string containing the key value for the configuration value
* role detemines the configuration target
- * @return boolean true or false as value
- * -1 if the key is not defined.
+ * @return Boolean true or false as value
+ * null if the key is not defined.
*/
public static Boolean getBooleanValue(String key, int role) {
Object obj = Configuration.getValue (key, role);
- if (obj instanceof String) {
- String value = (String) obj;
- if (value.equals("true")) {
- return new Boolean(true);
- } else if (value.equals("false")) {
- return new Boolean(false);
- } else {
- return null;
- }
- } else {
- return null;
- }
+ if (obj instanceof String) {
+ return new Boolean((String)obj);
+ } else if (obj instanceof Boolean) {
+ return (Boolean) obj;
+ } else {
+ return null;
+ }
};
/**
@@ -189,7 +190,7 @@
*
* @param key a string containing the key value for the configuration value
* @return boolean true or false as value
- * -1 if the key is not defined.
+ * null if the key is not defined.
*/
public static Boolean getBooleanValue(String key) {
return Configuration.getBooleanValue(key, Configuration.STANDARD);