public static float parseFloat(String f) throws SAXException {
        if (f == null)
            throw new SAXException("Expected a decimal");
        else{
            try {
                return Float.parseFloat(f);
            } catch (NumberFormatException ex){
                throw new SAXException("Expected a decimal, got '" + f + "'");
            }
        }
    }
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