void setFormatString ( StartElement startElement , StreamingCell cell ) { Attribute cellStyle = startElement . getAttributeByName ( new QName ( "s" ) ) ; String cellStyleString = ( cellStyle != null ) ? cellStyle . getValue ( ) : null ; XSSFCellStyle style = null ; if ( cellStyleString != null ) { style = stylesTable . getStyleAt ( Integer . parseInt ( cellStyleString ) ) ; } else if ( stylesTable . getNumCellStyles ( ) > 0 ) { style = stylesTable . getStyleAt ( 0 ) ; } if ( style != null ) { cell . setNumericFormatIndex ( style . getDataFormat ( ) ) ; String formatString = style . getDataFormatString ( ) ; if ( formatString != null ) { cell . setNumericFormat ( formatString ) ; } else { cell . setNumericFormat ( BuiltinFormats . getBuiltinFormat ( cell . getNumericFormatIndex ( ) ) ) ; } } else { cell . setNumericFormatIndex ( null ) ; cell . setNumericFormat ( null ) ; } }
Read the numeric format string out of the styles table for this cell . Stores the result in the Cell .