[jdom-interest] Attribute.getBooleanValue()

Ted Erickson ted at longhairtech.com
Thu Apr 26 08:45:36 PDT 2001


We are using the released version which has Attribute.getBooleanValue().
We use this method to get  the HTML radio button values.  We based our
design on the published javadocs and the published code.

Please do not remove existing functionality.

Thanks,

Ted Erickson

  -----Original Message-----
  From: jdom-interest-admin at jdom.org [mailto:jdom-interest-admin at jdom.org]On
Behalf Of philip.nelson at omniresources.com
  Sent: Wednesday, April 25, 2001 7:43 PM
  To: jdom-interest at jdom.org
  Subject: RE: [jdom-interest] Attribute.getBooleanValue()


  JDOM ignores 0 & 1 now in the same way as "true" and "false".
getBooleanValue() was removed a *long* time ago.  You should update your
version of JDOM  :-)
    -----Original Message-----
    From: Zoltan Grose [mailto:zgrose at pacbell.net]
    Sent: Wednesday, April 25, 2001 7:42 PM
    To: jdom-interest at jdom.org
    Subject: [jdom-interest] Attribute.getBooleanValue()


    Hi. JDOM newbie here. :)

    I'm using JDOM in a servlet project and I was about to change all my
True/False type attributes in the XML to be 0 / 1 when I decided to peek at
the JDOM source to see just what kind of values were considered boolean. To
my surprise, 0 and 1 wasn't on the list. Was this an intention omission? It
seems to be a fairly common representation. I did a quick search through the
archives and didn't see anything on the topic.

    Loving JDOM so far!

    -zoltan

    For convenience I've copied the source (beta6) below:

        public boolean getBooleanValue() throws DataConversionException {
            if ((value.equalsIgnoreCase("true")) ||
                (value.equalsIgnoreCase("on")) ||
                (value.equalsIgnoreCase("yes"))) {
                return true;
            } else if ((value.equalsIgnoreCase("false")) ||
                       (value.equalsIgnoreCase("off")) ||
                       (value.equalsIgnoreCase("no"))) {
                return false;
            } else {
                throw new DataConversionException(name, "boolean");
            }
        }


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20010426/b5c644f3/attachment.htm


More information about the jdom-interest mailing list