if ( ( (String) source ).equalsIgnoreCase( "true" ) ) return Boolean.valueOf( "true" ); else if ( ( (String) source ).equalsIgnoreCase( "false" ) ) return Boolean.valueOf( "false" ); else
try { if ( ( (String) source ).equalsIgnoreCase( "true" ) ) return Boolean.valueOf( "true" ); else if ( ( (String) source ).equalsIgnoreCase( "false" ) ) return Boolean.valueOf( "false" ); else if ( Integer.parseInt( (String) source ) == 0 ) return Boolean.valueOf( "false" ); else if ( Integer.parseInt( (String) source ) != 0 ) return Boolean.valueOf( "true" ); } catch ( NumberFormatException e ) {
	public static Boolean toBoolean( Object source ) throws BirtException	{		if ( source == null )			return null;				if ( source instanceof Boolean )		{			return (Boolean) source;		}		else if ( source instanceof Integer )		{			int intValue = ( (Integer) source ).intValue( );			if ( intValue == 0 )				return new Boolean( false );			return new Boolean( true );		}		else if ( source instanceof BigDecimal )		{			int intValue = ( (BigDecimal) source ).intValue( );			if ( intValue == 0 )				return new Boolean( false );			return new Boolean( true );		}		else if ( source instanceof Double )		{			int intValue = ( (Double) source ).intValue( );			if ( intValue == 0 )				return new Boolean( false );			return new Boolean( true );		}		else if ( source instanceof String )		{			if ( ( (String) source ).equalsIgnoreCase( "true" ) )				return Boolean.valueOf( "true" );			else if ( ( (String) source ).equalsIgnoreCase( "false" ) )				return Boolean.valueOf( "false" );			else				throw new BirtException( pluginId,						ResourceConstants.CONVERT_FAILS,						new Object[]{								source.toString( ), "Boolean"						} );		}		else		{			throw new BirtException( pluginId,					ResourceConstants.CONVERT_FAILS,					new Object[]{							source.toString( ), "Boolean"					},					resourceBundle );		}	}