public static boolean parseBool(String bool, boolean def) throws SAXException {
        if (bool == null || bool.equals(""))
            return def;
        else
            return Boolean.valueOf(bool);
        //else
        //    throw new SAXException("Expected a boolean, got'"+bool+"'");
    }
Parses an integer from a string, if the string is null returns
def.

@param i The string to parse
@param def The default value if the string is null
@return the parsed value or def
@throws SAXException in case of a syntax error
jme3-core/src/main/java/com/jme3/util/xml/SAXUtil.java