cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r165534 - /cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/BooleanField.java
Date Sun, 01 May 2005 18:21:21 GMT
Author: antonio
Date: Sun May  1 11:21:20 2005
New Revision: 165534

URL: http://svn.apache.org/viewcvs?rev=165534&view=rev
Log:
Use BooleanUtils

Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/BooleanField.java

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/BooleanField.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/BooleanField.java?rev=165534&r1=165533&r2=165534&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/BooleanField.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/BooleanField.java
Sun May  1 11:21:20 2005
@@ -25,6 +25,7 @@
 import org.xml.sax.SAXException;
 import org.apache.cocoon.forms.validation.ValidationErrorAware;
 import org.apache.cocoon.forms.validation.ValidationError;
+import org.apache.commons.lang.BooleanUtils;
 
 /**
  * A widget to select a boolean value. Usually rendered as a checkbox.
@@ -111,7 +112,7 @@
     public void generateItemSaxFragment(ContentHandler contentHandler, Locale locale) throws
SAXException {
         // value element
         contentHandler.startElement(Constants.INSTANCE_NS, VALUE_EL, Constants.INSTANCE_PREFIX_COLON
+ VALUE_EL, XMLUtils.EMPTY_ATTRIBUTES);
-        String stringValue = String.valueOf(value != null && value.booleanValue()
== true? "true": "false");
+        String stringValue = String.valueOf(BooleanUtils.toBoolean(value));
         contentHandler.characters(stringValue.toCharArray(), 0, stringValue.length());
         contentHandler.endElement(Constants.INSTANCE_NS, VALUE_EL, Constants.INSTANCE_PREFIX_COLON
+ VALUE_EL);
         // validation message element: only present if the value is not valid



Mime
View raw message