diff options
Diffstat (limited to 'common/src/at/gv/egovernment/moa/util/BoolUtils.java')
-rw-r--r-- | common/src/at/gv/egovernment/moa/util/BoolUtils.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/common/src/at/gv/egovernment/moa/util/BoolUtils.java b/common/src/at/gv/egovernment/moa/util/BoolUtils.java new file mode 100644 index 000000000..fcd39b4dd --- /dev/null +++ b/common/src/at/gv/egovernment/moa/util/BoolUtils.java @@ -0,0 +1,24 @@ +package at.gv.egovernment.moa.util; + +/** + * Utility class for parsing XML schema boolean values. + * + * @author Patrick Peck + * @version $Id$ + */ +public class BoolUtils { + + /** + * Return the boolean value of an <code>xsd:boolean</code> type of DOM + * element/attribute. + * + * @param boolStr The value of the <code>xsd:boolean</code> element/attribute. + * @return <code>true</code>, if <code>boolStr</code> equals + * <code>"true"</code> or <code>"1;"</code>. Otherwise, + * <code>false</code> is returned. + */ + public static boolean valueOf(String boolStr) { + return "true".equals(boolStr) || "1".equals(boolStr); + } + +} |