public static Boolean parseBoolean( String str, 
					boolean caseSensitive )
	throws NullPointerException,
	       NumberFormatException {

	if( str == null )
	    throw new NullPointerException( "Cannot parse null to a boolean." );
	
	if( caseSensitive )
	    str = str.toLowerCase();

	
	// This method only recognizes "true" and "false"!
	if( str.equals("true") )
	    return new Boolean( true );
	else if( str.equals("false") )
	    return new Boolean( false );
	else
	    throw new NumberFormatException( "The passed string does not represent a boolean value: '" + str + "'." );
    }