if ( oCachedJavaFormatter instanceof DateFormat )
if ( oCachedJavaFormatter instanceof IDateFormatWrapper )
	public static final String format( Object oValue, FormatSpecifier fs,			ULocale lcl, Object oCachedJavaFormatter ) throws ChartException	{		String sValue;		if ( oValue == null ) // NULL VALUES CANNOT BE FORMATTED		{			return null;		}		else if ( oValue instanceof String )		{			return (String) oValue;		}		if ( fs == null ) // IF A FORMAT SPECIFIER WAS NOT ASSOCIATED WITH THE		// VALUE		{			if ( oCachedJavaFormatter != null ) // CHECK IF AN INTERNAL JAVA			// FORMAT SPECIFIER WAS COMPUTED			{				if ( oValue instanceof Double )				{					if ( oCachedJavaFormatter instanceof DecimalFormat )					{						final double dValue = ( (Double) oValue ).doubleValue( );						sValue = ( (DecimalFormat) oCachedJavaFormatter ).format( ( (Double) oValue ).doubleValue( ) );						return correctNumber( sValue, dValue );					}				}				else if ( oValue instanceof NumberDataElement )				{					if ( oCachedJavaFormatter instanceof DecimalFormat )					{						final double dValue = ( (NumberDataElement) oValue ).getValue( );						sValue = ( (DecimalFormat) oCachedJavaFormatter ).format( dValue );						return correctNumber( sValue, dValue );					}				}				else if ( oValue instanceof Calendar )				{					if ( oCachedJavaFormatter instanceof DateFormat )					{						return ( (DateFormat) oCachedJavaFormatter ).format( ( (Calendar) oValue ).getTime( ) );					}				}				else if ( oValue instanceof DateTimeDataElement )				{					if ( oCachedJavaFormatter instanceof DecimalFormat )					{						return ( (DateFormat) oCachedJavaFormatter ).format( ( (DateTimeDataElement) oValue ).getValueAsCalendar( ) );					}				}			}			else			{				if ( oValue instanceof NumberDataElement )				{					return String.valueOf( ( (NumberDataElement) oValue ).getValue( ) );				}				else if ( oValue instanceof DateTimeDataElement )				{					return String.valueOf( ( (DateTimeDataElement) oValue ).getValueAsCalendar( ) );				}			}		}		else if ( NumberFormatSpecifier.class.isInstance( fs ) )		{			final NumberFormatSpecifier nfs = (NumberFormatSpecifier) fs;			final double dValue = asPrimitiveDouble( oValue, lcl );			return correctNumber( nfs.format( dValue, lcl ), dValue );		}		else if ( JavaNumberFormatSpecifier.class.isInstance( fs ) )		{			final JavaNumberFormatSpecifier nfs = (JavaNumberFormatSpecifier) fs;			final double dValue = asPrimitiveDouble( oValue, lcl );			return correctNumber( nfs.format( dValue, lcl ), dValue );		}		else if ( FractionNumberFormatSpecifier.class.isInstance( fs ) )		{			final FractionNumberFormatSpecifier fnfs = (FractionNumberFormatSpecifier) fs;			final double dValue = asPrimitiveDouble( oValue, lcl );			return correctNumber( fnfs.format( dValue, lcl ), dValue );		}		else if ( DateFormatSpecifier.class.isInstance( fs ) )		{			final DateFormatSpecifier dfs = (DateFormatSpecifier) fs;			return dfs.format( asCalendar( oValue, lcl ), lcl );		}		else if ( JavaDateFormatSpecifier.class.isInstance( fs ) )		{			final JavaDateFormatSpecifier jdfs = (JavaDateFormatSpecifier) fs;			return jdfs.format( asCalendar( oValue, lcl ), lcl );		}		else		{			if ( oValue instanceof NumberDataElement )			{				return String.valueOf( ( (NumberDataElement) oValue ).getValue( ) );			}			else if ( oValue instanceof DateTimeDataElement )			{				return String.valueOf( ( (DateTimeDataElement) oValue ).getValueAsCalendar( ) );			}		}		return oValue.toString( );	}