axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Problem with setting boolean to nil
Date Mon, 23 Jun 2008 06:12:21 GMT
Thanks for your reply Amila.

I have tried as you suggested, but am getting compile errors now when 

This is the code snippet generated to delcare the boolean attriute.


                        * field for IgnoreConflict
                         protected java.lang.Boolean localIgnoreConflict ;
                           * Auto generated getter method
                           * @return java.lang.Boolean
                           public  java.lang.Boolean getIgnoreConflict(){
                               return localIgnoreConflict;

                               * Auto generated setter method
                               * @param param IgnoreConflict
                               public void 
setIgnoreConflict(java.lang.Boolean param){


which it has created as a Boolean

however the code generated to set this value is :

                                  while (!reader.isStartElement() && 
                                    if (reader.isStartElement() && new 
                                       nillableValue = 
                                       if (!"true".equals(nillableValue) 
&& !"1".equals(nillableValue)){
                                    java.lang.String content = 
                                       } else {
                                           reader.getElementText(); // 
throw away text nodes if any.

Note the call to setIgnoreConflict, which uses 
This method returns a boolean, not a Boolean.


    public static boolean convertToBoolean(String s) {

        boolean returnValue = false;
        if ((s != null) && (s.length() > 0)) {
            if ("1".equals(s) || s.toLowerCase().equals("true")) {
                returnValue = true;
            } else if (!"0".equals(s) && !s.toLowerCase().equals("false")) 
                throw new RuntimeException("in valid string -" + s + " for 
boolean value");
        return returnValue;


Hence causing the compile error.

Is this a known problem, or have I done something wrong during the 
If it is a known problem, I'm guessing I will have to modify the 
convertToBoolean method (assuming nothing else uses it), or is there 
another way around this problem??



This transmission is for the intended addressee only and is confidential information. If you
have received this transmission in error, please notify the sender and delete the transmission.
The contents of this e-mail are the opinion of the writer only and are not endorsed by the
Mincom Group of companies unless expressly stated otherwise.

View raw message